Skip to content

feat(metadata): show unsaved changes warning for sidebar navigation attempts#4506

Draft
olehrybak wants to merge 1 commit intobox:masterfrom
olehrybak:metadata-warning-modal-improvements
Draft

feat(metadata): show unsaved changes warning for sidebar navigation attempts#4506
olehrybak wants to merge 1 commit intobox:masterfrom
olehrybak:metadata-warning-modal-improvements

Conversation

@olehrybak
Copy link
Copy Markdown

Unsaved changes warning modal was previously triggered in metadata sidebar only when a user was selecting a new template when edit was in progress. This PR extends this logic to also show the warning modal when a user tries to navigate to other sidebar tabs (i.e. when sidebar router history is changing).

Changes

  • Added history.block navigation guard that intercepts sidebar tab switches while the metadata editor is open (gated behind isConfidenceScoreReviewEnabled feature flag)
  • On "Discard Changes": removes the blocker, clears the editor, and completes the pending navigation via history.push
  • On "Continue Editing": re-syncs the URL back to /metadata via history.replace to fix any URL desync caused by external navigators (e.g., Box AI button in EndUserApp), then re-installs the blocker
  • Blocker is automatically cleaned up when editing ends or the component unmounts

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 16, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 16, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0fdcaeec-6038-43fd-a0f5-09e43c2bb5b5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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