t3code icon indicating copy to clipboard operation
t3code copied to clipboard

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

Open AndreasGJ opened this issue 8 months ago • 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

AndreasGJ avatar Mar 11 '26 22:03 AndreasGJ

you got latest version?

eggfriedrice24 avatar Mar 11 '26 22:03 eggfriedrice24

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

eggfriedrice24 avatar Mar 11 '26 22:03 eggfriedrice24

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

eggfriedrice24 avatar Mar 11 '26 22:03 eggfriedrice24