fix(web): diff panel opens on all branch changes, not just uncommitted (#15005)

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
Theo BrowneandClaude Opus 5.5 authored and GitHub committed 2026-10-02 22:52:42 -07:00
1 parent 8283b481a3
commit d1034d62b2
18 files changed
+611 -176

No files matched your search

+17 -4
View File
@@ -14,18 +14,31 @@ describe("diffPanelStore", () => {
}),
);
it("defaults each thread to working tree changes without requiring git status", () => {
it("defaults each thread to Changes without requiring git status", () => {
expect(
selectThreadDiffPanelSelection(useDiffPanelStore.getState().byThreadKey, THREAD_REF),
).toEqual({ kind: "unstaged" });
).toEqual({ kind: "branch", baseRef: null });
});
it("defaults to working tree changes before a thread is selected", () => {
it("defaults to Changes before a thread is selected", () => {
expect(selectThreadDiffPanelSelection(useDiffPanelStore.getState().byThreadKey, null)).toEqual({
kind: "unstaged",
kind: "branch",
baseRef: null,
});
});
it("keeps a custom base when a generic open selects Changes again", () => {
const store = useDiffPanelStore.getState();
store.selectBranchBaseRef(THREAD_REF, "origin/release");
store.selectGitScope(THREAD_REF, "branch");
store.selectTurn(THREAD_REF, RunId.make("turn-1"));
store.selectGitScope(THREAD_REF, "branch");
expect(
selectThreadDiffPanelSelection(useDiffPanelStore.getState().byThreadKey, THREAD_REF),
).toEqual({ kind: "branch", baseRef: "origin/release" });
});
it("preserves an explicit branch selection", () => {
useDiffPanelStore.getState().selectGitScope(THREAD_REF, "branch");