Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Suggestions in Zen mode #11187

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

juliancoffee
Copy link

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

@juliancoffee juliancoffee marked this pull request as draft March 13, 2024 00:41
@juliancoffee juliancoffee changed the title DRAFT: Suggestions in Zen mode Draft: Suggestions in Zen mode Mar 13, 2024
@@ -25,7 +25,7 @@
{% else %}
{% perm 'suggestion.delete' suggestion as user_can_delete_suggestion %}
{% if user_can_vote_suggestion or user_can_accept_suggestion or user_can_delete_suggestion %}
<div class="btn-float pull-right flip">
<div class="btn-float pull-right flip" style="top: -20px">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid inline styles.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I don't like it too, I wonder what should I do instead? Changing the original class doesn't sound like a good idea either, I guess I could create new one?

# Handle accepting/deleting suggestions
_obj, unit_set, _context = parse_path_units(
request, path, (Translation, ProjectLanguage, CategoryLanguage)
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already done at top of this function.

or "spam" in request.POST
or "upvote" in request.POST
or "downvote" in request.POST
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is essentially a copy of code from translate function, it should be shared.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I just put such a function in the same file, or it should go to some utils.py file?


unit = checksum_form.cleaned_data["unit"]
# We are ignoring any redirects and responses here
_response = handle_suggestions(request, unit, "", "")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the return value is not needed, there is no need to store it in a variable.

Copy link

codecov bot commented Apr 3, 2024

Codecov Report

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

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

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 Coverage Δ
weblate/trans/views/edit.py 80.36% <0.00%> (-1.25%) ⬇️

... and 103 files with indirect coverage changes

@juliancoffee
Copy link
Author

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

Copy link

github-actions bot commented May 8, 2024

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 github-actions bot added the wontfix Nobody will work on this. label May 8, 2024
@juliancoffee
Copy link
Author

meow, bot

@github-actions github-actions bot removed the wontfix Nobody will work on this. label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants