Skip to content

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

Merged
prabinoid merged 1 commit into
naxa-deployfrom
feat/7254-caching-comments-while-validating-tasks
May 26, 2026
Merged

feat: persist mapping and validation comments across page reloads#177
prabinoid merged 1 commit into
naxa-deployfrom
feat/7254-caching-comments-while-validating-tasks

Conversation

@sumitdahal7
Copy link
Copy Markdown

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

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

Related Issue

Fixes hotosm#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

@prabinoid prabinoid merged commit 4ee6553 into naxa-deploy May 26, 2026
2 of 3 checks passed
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.

2 participants