Skip to content

feat: persist mapping and validation comments across page reloads#7257

Open
sumitdahal7 wants to merge 1 commit into
developfrom
feat/7254-caching-comments-while-validating-tasks
Open

feat: persist mapping and validation comments across page reloads#7257
sumitdahal7 wants to merge 1 commit into
developfrom
feat/7254-caching-comments-while-validating-tasks

Conversation

@sumitdahal7
Copy link
Copy Markdown
Collaborator

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation
  • 🧑‍💻 Refactor
  • ✅ Test
  • 🤖 Build or CI
  • ❓ Other (please specify)

Related Issue

Fixes #7254

Describe this PR

This PR introduces persistence for mapping and validation comments across page reloads, ensuring that user progress is not lost on accidental refreshes or navigation.

Key Changes:

  • Storage Migration: Replaced sessionStorage with a safeStorage utility (backed by localStorage) for better durability.
  • Improved Key Scoping: Updated storage keys to include projectId and taskId (e.g., tm-comment-mapping-{projectId}-{taskId}), preventing comment leakage between different tasks or projects.
  • Race Condition Prevention: Implemented a hasMounted ref in CommentInputField to ensure that empty initial states don't overwrite saved drafts before they can be restored.
  • Validation Flow Persistence: Added logic to TaskMapAction and CompletionTabForValidation to correctly restore and clear validation comments for multiple tasks simultaneously.
  • History Tab persistence: Updated PostComment in task history to also persist drafts using the new storage utility and scoped keys.

Screenshots

Screencast.from.2026-05-26.13-20-27.webm

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Caching comments while validating multiple tasks

1 participant