What Changed#
This PR fixes the diff panel so it can be closed again while keeping normal diff search-param retention behavior.
Why#
The chat route was re-retaining diff=1 during close navigations, which caused the diff panel to immediately reopen instead of collapsing.
UI Changes#
N/A The expected behaviour was already working before, but it was broken a few days ago, so this is the PR to fix it.
Checklist#
Note
Fix collapsing diff panel by replacing diff param removal with a clearDiff signal#
- Previously, closing the diff panel removed the
diff search param, but retainSearchParams would immediately re-add it on the next navigation, preventing the panel from actually closing.
- Closing the diff now sets
clearDiff=1 in the URL instead of unsetting diff. A new retainDiffUnlessCleared middleware in _chat.$threadId.tsx carries the diff param forward across navigations unless clearDiff is present.
- After the middleware processes the signal,
stripSearchParams(["clearDiff"]) removes clearDiff from the final URL so it doesn't persist.
Macroscope summarized b71fc43.
Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID:
2388b2d0-6660-46fc-9125-6cfe4fd707a2You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
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
Tip
Migrating from UI to YAML configuration.
Use the
@coderabbitai configurationcommand in a PR comment to get a dump of all your UI settings in YAML format. You can then edit this YAML file and upload it to the root of your repository to configure CodeRabbit programmatically.