Skip to content

Allow comment authors to edit and delete their own comments#4024

Merged
mathjazz merged 7 commits intomozilla:mainfrom
MundiaNderi:2383-edit-delete-comment
Mar 26, 2026
Merged

Allow comment authors to edit and delete their own comments#4024
mathjazz merged 7 commits intomozilla:mainfrom
MundiaNderi:2383-edit-delete-comment

Conversation

@MundiaNderi
Copy link
Copy Markdown
Collaborator

Fixes #2383

This PR
Adds edit and delete comment views, corresponding URLs, changes the comment components and adds tests for both views and component changes

To test/how I tested:

  • Test the changes locally to see you can edit & delete comments.
  • Check if the corresponding tests pass / are sufficient

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 17, 2026

Codecov Report

❌ Patch coverage is 64.39394% with 47 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.79%. Comparing base (4f2d355) to head (40986a1).
⚠️ Report is 6 commits behind head on main.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Allow comment authors to edit and delete their own comments

This commit
Adds edit and delete comment views, corresponding URLs, changes
the comment component and adds tests for both views and component
changes
@MundiaNderi MundiaNderi force-pushed the 2383-edit-delete-comment branch from 9bc8ae9 to e0066eb Compare March 18, 2026 07:54
Copy link
Copy Markdown
Collaborator

@mathjazz mathjazz left a comment

Choose a reason for hiding this comment

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

Great work!

The feature works fine and the code looks good on the surface.

My only complaint is that the alignment of the comment editor in Translation History panel and the alignment of buttons underneath it, is off:

Image

BTW, this feature will also need docs update (just added a label to the issue):
https://mozilla-l10n.github.io/localizer-documentation/tools/pontoon/glossary.html#comment

@mathjazz
Copy link
Copy Markdown
Collaborator

Thanks for the update!

In translation comments, the editor (and the avatar) are still indented right.

@MundiaNderi
Copy link
Copy Markdown
Collaborator Author

Thanks for the update!

In translation comments, the editor (and the avatar) are still indented right.

It was not registering to me that we have comments underneath the editor but I finally got it. I had seen them before but the comments to the right of the editor came more naturally to me.

Screenshot 2026-03-19 at 21 27 02

@mathjazz
Copy link
Copy Markdown
Collaborator

One more thing - while editing a comment, the buttons and the timestamp of the edited comment appear much lower relative to the editor compare to how they appear for the non-edited comment. Please make sure the distance is consistent.

Posnetek zaslona 2026-03-23 ob 12 49 08

The info row uses margin top -2px to be close to the comment bubble
In edit mode, this adds 14px of extra height pushing the info section
row down. Compensate with margin-top: -16px on .is-editing .info.
Copy link
Copy Markdown
Collaborator

@mathjazz mathjazz left a comment

Choose a reason for hiding this comment

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

@MundiaNderi Sorry for the tedious review process. Found a few more smaller things.

One other thing I noticed is that when you hover the Cancel, Delete and Edit buttons, the middot separating the buttons also changes color. It shouldn't.

Also, we could use var(--status-error) when hovering the Delete button.

Copy link
Copy Markdown
Collaborator

@mathjazz mathjazz left a comment

Choose a reason for hiding this comment

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

Great work, thanks for keeping up with the tedious review process! :)

@mathjazz mathjazz merged commit 762e63d into mozilla:main Mar 26, 2026
8 checks passed
@mathjazz
Copy link
Copy Markdown
Collaborator

BTW, this feature will also need docs update (just added a label to the issue):

Actually none of the existig docs get outdated by merging this change. As a bonus, we can still document the ability to edit and delete comments, but a blog post would be even better.

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.

Add ability to edit and remove a comment

4 participants