Skip to content
Source
Sign inSign up
pingdotgg/t3code

[bug] I can't close the View diff sidepanel? #935

ClosedAndreasGJ(GitHub profile, opens in a new tab) opened this issue 3 comments

The agent returns a block of changed files and I click the View diff button

Image

Then I can't close the diff sidepanel again? Not even when clicking the top panel diff button:

Image
  1. okay, I see it, will push PR soon. cc @juliusmarminge

  2. eggfriedrice24(GitHub profile, opens in a new tab)commented

    Opened #937 to fix this.

    Root cause: retainSearchParams(["diff"]) checks !(key in result) to decide whether to re-inject from the current URL. Both closeDiff and onToggleDiff used stripDiffSearchParams which removes the diff key entirely via destructuring, so the middleware always re-added it.

    Fix: set diff: undefined explicitly when closing so the key is present in the result object and the middleware skips it.

    The core fix is the same as #930 by @atharvadeosthale. The difference is that #930 introduces a new clearDiffSearchParams helper to set all three keys to undefined, while this PR just inlines { diff: undefined } at the two call sites since that is the only key that matters for the middleware. Fewer files changed, no new abstraction. #930 also bundles an unrelated UX addition (click outside overlay + z-index bump to close the inline diff sidebar) which might be worth a separate PR. cc @juliusmarminge

  3. juliusmarminge closed this

Sign in to join this conversation.