Skip to content

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

Description

@AndreasGJ

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

Activity

  1. eggfriedrice24 commented on Mar 11, 2026

    @eggfriedrice24
    Contributor

    you got latest version?

  2. eggfriedrice24 commented on Mar 11, 2026

    @eggfriedrice24
    Contributor

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

  3. eggfriedrice24 commented on Mar 11, 2026

    @eggfriedrice24
    Contributor

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions