weblate icon indicating copy to clipboard operation
weblate copied to clipboard

Draft: Suggestions in Zen mode

Open juliancoffee opened this issue 11 months ago • 10 comments

Proposed changes

Solves #671, kind of. At the time of writing, it is functional, but probably need to move most events to javascript to avoid resending Zen each time. Also, I went via always show suggestions route, but I think that probably may be configured.

Checklist

  • [ ] Lint and unit tests pass locally with my changes.
  • [ ] I have added tests that prove my fix is effective or that my feature works.
  • [ ] I have added documentation to describe my feature.
  • [ ] I have squashed my commits into logic units.
  • [ ] I have described the changes in the commit messages.

Other information

Summary by CodeRabbit

  • New Features
    • Introduced permission checks for user interactions on suggestions in the translation unit interface.
    • Added a form for users to submit suggestions, enhancing user engagement.
  • Bug Fixes
    • Adjusted the layout of the voting buttons for improved visual positioning.

juliancoffee avatar Mar 13 '24 00:03 juliancoffee

Codecov Report

Attention: Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.

Project coverage is 90.74%. Comparing base (6aee586) to head (8403ff0). Report is 3876 commits behind head on main.

Files with missing lines Patch % Lines
weblate/trans/views/edit.py 0.00% 7 Missing and 1 partial :warning:
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #11187      +/-   ##
==========================================
- Coverage   90.82%   90.74%   -0.08%     
==========================================
  Files         554      559       +5     
  Lines       57306    57680     +374     
  Branches     9122     9212      +90     
==========================================
+ Hits        52046    52341     +295     
- Misses       3640     3704      +64     
- Partials     1620     1635      +15     
Files with missing lines Coverage Δ
weblate/trans/views/edit.py 80.36% <0.00%> (-1.25%) :arrow_down:

... and 103 files with indirect coverage changes

codecov[bot] avatar Apr 03 '24 15:04 codecov[bot]

Thanks for the review! I want to continue working on it, just got interrupted somewhat.

juliancoffee avatar Apr 06 '24 15:04 juliancoffee

This pull request has been automatically marked as stale because there wasn’t any recent activity.

It will be closed soon if no further action occurs.

Thank you for your contributions!

github-actions[bot] avatar May 08 '24 01:05 github-actions[bot]

meow, bot

juliancoffee avatar May 08 '24 11:05 juliancoffee

This pull request has been automatically marked as stale because there wasn’t any recent activity.

It will be closed soon if no further action occurs.

Thank you for your contributions!

github-actions[bot] avatar Jun 08 '24 01:06 github-actions[bot]

This pull request has been automatically marked as stale because there wasn’t any recent activity.

It will be closed soon if no further action occurs.

Thank you for your contributions!

github-actions[bot] avatar Jul 10 '24 01:07 github-actions[bot]

This pull request has been automatically marked as stale because there wasn’t any recent activity.

It will be closed soon if no further action occurs.

Thank you for your contributions!

github-actions[bot] avatar Aug 10 '24 01:08 github-actions[bot]

This pull request has been automatically marked as stale because there wasn’t any recent activity.

It will be closed soon if no further action occurs.

Thank you for your contributions!

github-actions[bot] avatar Sep 10 '24 01:09 github-actions[bot]

Walkthrough

The pull request introduces modifications to the HTML templates and backend logic related to user suggestions in the translation interface. Changes include the addition of permission checks and a suggestion submission form in the zen-units.html template, as well as updates to the suggestions.html template for visual adjustments. The backend logic in edit.py is enhanced to process user actions related to suggestions, allowing for acceptance, deletion, and voting based on user permissions.

Changes

Files Change Summary
weblate/templates/snippets/suggestions.html Modified the HTML structure by adding an inline style to reposition the voting button container.
weblate/templates/zen-units.html Added permission checks for user actions and a form for submitting suggestions.
weblate/trans/views/edit.py Introduced a conditional block to handle user actions related to suggestions based on POST data.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Frontend
    participant Backend

    User->>Frontend: Submit suggestion
    Frontend->>Backend: POST request with suggestion data
    Backend->>Backend: Check permissions
    Backend->>Backend: Validate suggestion form
    Backend-->>Frontend: Return success or error response
    Frontend-->>User: Display result

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Sep 10 '24 01:09 coderabbitai[bot]