Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

fix: OPTIC-354: Comment draft preserved between annotations #1652

Merged

Conversation

Travis1282
Copy link
Contributor

@Travis1282 Travis1282 commented Dec 28, 2023

Currently when user starts replying on one comment, and than switch to another annotation, comment entered (but not submitted) on the first annotation is not removed from the comment filed, and can be accidentally sent. This fix persists drafts between annotations on a task by putting unsubmitted draft comments in a map using annotation id as a key for each draft comment.
OPTIC-354

@codecov-commenter
Copy link

codecov-commenter commented Dec 28, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (88ba15c) 68.27% compared to head (4b5a30c) 68.28%.
Report is 6 commits behind head on master.

Files Patch % Lines
src/components/Comments/CommentForm.tsx 0.00% 0 Missing and 1 partial ⚠️
src/stores/Comment/CommentStore.js 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1652   +/-   ##
=======================================
  Coverage   68.27%   68.28%           
=======================================
  Files         443      443           
  Lines       28690    28690           
  Branches     7633     7630    -3     
=======================================
+ Hits        19589    19591    +2     
+ Misses       7849     7846    -3     
- Partials     1252     1253    +1     

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

@Travis1282 Travis1282 force-pushed the fb-optic-354/comment-draft-preserved-between-annotations branch from 1300f73 to 1e63e53 Compare December 28, 2023 00:51
src/components/SidePanels/DetailsPanel/DetailsPanel.tsx Outdated Show resolved Hide resolved
src/components/SidePanels/DetailsPanel/DetailsPanel.tsx Outdated Show resolved Hide resolved
Copy link

@luarmr luarmr left a comment

Choose a reason for hiding this comment

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

LGTM

@nikitabelonogov nikitabelonogov force-pushed the fb-optic-354/comment-draft-preserved-between-annotations branch from 264385c to ffa585e Compare January 3, 2024 08:43
src/components/Comments/Comments.tsx Outdated Show resolved Hide resolved
src/stores/Comment/CommentStore.js Outdated Show resolved Hide resolved
src/stores/Comment/CommentStore.js Outdated Show resolved Hide resolved
src/stores/Comment/CommentStore.js Outdated Show resolved Hide resolved
Travis1282 and others added 2 commits January 3, 2024 13:57
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@Travis1282 Travis1282 enabled auto-merge (squash) January 3, 2024 19:57
src/stores/Comment/CommentStore.js Outdated Show resolved Hide resolved
src/stores/Comment/CommentStore.js Outdated Show resolved Hide resolved
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…s' of github.com:heartexlabs/label-studio-frontend into fb-optic-354/comment-draft-preserved-between-annotations
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@Travis1282 Travis1282 merged commit d1e4416 into master Jan 3, 2024
11 of 14 checks passed
@Travis1282 Travis1282 deleted the fb-optic-354/comment-draft-preserved-between-annotations branch January 3, 2024 21:18
MasherJames pushed a commit to HelloPareto/label-studio-frontend that referenced this pull request Feb 29, 2024
…nal#1652)

* fix: optic-354: coment draft preserved between annotations

* fix typo, remove console

* retest

* Update src/stores/Comment/CommentStore.js

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update src/components/Comments/Comments.tsx

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: Nikita Belonogov <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants