Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix:diff panel doesnt collapse #992

ClosedHeinrich-XIAO(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/992/headopened View on GitHub

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.
    1. 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.

    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

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

    4. juliusmarminge closed this

Sign in to join this conversation.