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

Unwrap mention tags when entering annotation edit mode #6816

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

acelaya
Copy link
Contributor

@acelaya acelaya commented Feb 10, 2025

This is a follow up of #6815, which ensures mention tags are unwrapped into their plain-text version when entering annotation edit mode.

Test steps

  1. Checkout this branch
  2. Create an annotation with a mention
  3. Edit the annotation you just created. The mention should be loaded in the textarea in plain-text format.

In main, when editing an annotation that has mentions, it will load the mention tags.

Copy link

codecov bot commented Feb 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.45%. Comparing base (cf33ef3) to head (6d6aa66).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6816   +/-   ##
=======================================
  Coverage   99.45%   99.45%           
=======================================
  Files         271      271           
  Lines       10405    10406    +1     
  Branches     2488     2488           
=======================================
+ Hits        10348    10349    +1     
  Misses         57       57           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -566,6 +567,8 @@ export default function MarkdownEditor({
// The input element where the user inputs their comment.
const input = useRef<HTMLTextAreaElement>(null);

const textWithoutMentionTags = useMemo(() => unwrapMentions(text), [text]);
Copy link
Contributor Author

@acelaya acelaya Feb 10, 2025

Choose a reason for hiding this comment

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

I considered doing this conditionally based on the at_mentions feature flag, but it should be harmless to do it unconditionally, and has the benefit that we avoid accidentally loading a mention tag in the text area.

@acelaya acelaya marked this pull request as ready for review February 10, 2025 15:58
@acelaya acelaya requested a review from robertknight February 10, 2025 15:58
@acelaya acelaya merged commit cadccc1 into main Feb 10, 2025
4 checks passed
@acelaya acelaya deleted the mentions-edition branch February 10, 2025 16:36
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.

2 participants