Skip to content

fix:diff panel doesnt collapse#992

Closed
Heinrich-XIAO wants to merge 3 commits intopingdotgg:mainfrom
Heinrich-XIAO:fix/collapsing-diff-panel
Closed

fix:diff panel doesnt collapse#992
Heinrich-XIAO wants to merge 3 commits intopingdotgg:mainfrom
Heinrich-XIAO:fix/collapsing-diff-panel

Conversation

@Heinrich-XIAO
Copy link
Copy Markdown

@Heinrich-XIAO Heinrich-XIAO commented Mar 12, 2026

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

  • This PR is small and focused
  • I explained what changed and why
  • N/A I included before/after screenshots for any UI changes
  • N/A I included a video for animation/interaction changes\

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.

- Remove `retainSearchParams` middleware for `diff` on `/_chat/$threadId`
- Let diff query state clear naturally so collapsed diff panel does not persist unexpectedly
- Clean up now-unused router imports/types
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 12, 2026

Important

Review skipped

Auto reviews are disabled on this repository. 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2388b2d0-6660-46fc-9125-6cfe4fd707a2

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
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

Migrating from UI to YAML configuration.

Use the @coderabbitai configuration command 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.

@github-actions github-actions bot added size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Mar 12, 2026
@Heinrich-XIAO Heinrich-XIAO changed the title Fix/collapsing diff panel fix:diff panel doesnt collapse Mar 12, 2026
@juliusmarminge
Copy link
Copy Markdown
Member

should already be fixed on main and coming out in the next release. diff: undefined was the fix from #937

@Heinrich-XIAO Heinrich-XIAO deleted the fix/collapsing-diff-panel branch March 17, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants