diff --git a/src/features/agents/Session.module.css b/src/features/agents/Session.module.css index cf1de13d6..8df4e46c0 100644 --- a/src/features/agents/Session.module.css +++ b/src/features/agents/Session.module.css @@ -1274,7 +1274,7 @@ } .changesScope { flex: none; - padding: 6px 10px 2px; + padding: 0 4px; } .changesSummary { flex: none; diff --git a/src/features/agents/session/ChangesPane.tsx b/src/features/agents/session/ChangesPane.tsx index ae0a11c38..a0879e521 100644 --- a/src/features/agents/session/ChangesPane.tsx +++ b/src/features/agents/session/ChangesPane.tsx @@ -4,14 +4,13 @@ import { repositoryPath } from "@/features/vcs/repositoryPaths"; import { tx } from "@/platform/i18n"; import { call, commands, onIdeEvent } from "@/platform/ipc"; import { basename, dirname, relativeDir } from "@/platform/project"; -import { fileIconName, Icon, IconButton, showContextMenu, Spinner, T, Tree } from "@/ui"; +import { fileIconName, Icon, IconButton, showContextMenu, Spinner, T, Tabs, Tree } from "@/ui"; import { notifications } from "@/workbench/contributions"; import { confirm } from "@/workbench/messages"; import { useCallback, useEffect, useMemo, useState } from "react"; import { ChangesResizer } from "../ChangesResizer"; import styles from "../Session.module.css"; import { setChangesOptions, type ChangesScope } from "../changesOptions"; -import { SegmentedControl } from "../ConfigPickers"; import { formatSentAt } from "../conversation"; import { branchLabel } from "../model"; import { acceptChanges, refreshChanges, rollbackChanges, useAgents } from "../store"; @@ -386,20 +385,21 @@ export function ChangesPane({ )} {!docked && } -
- { - setChangesOptions({ scope: value === "turn" ? "turn" : "task" }); - void refreshChanges(task.id); - }} - /> -
+ { + if (id === scope) return; + setChangesOptions({ scope: id === "turn" ? "turn" : "task" }); + void refreshChanges(task.id); + }} + items={[ + { id: "task", label: "Whole Task" }, + { id: "turn", label: "Last Turn" }, + ]} + /> {(scope === "turn" || grouped || head || task.base) && (
{scope === "turn" ? ( diff --git a/src/features/agents/sessionState.test.tsx b/src/features/agents/sessionState.test.tsx index 6855bd34f..6eb9bb0ba 100644 --- a/src/features/agents/sessionState.test.tsx +++ b/src/features/agents/sessionState.test.tsx @@ -3046,7 +3046,7 @@ describe("last turn changes", () => { const pane = await screen.findByRole("complementary", { name: "Changes" }); expect(await within(pane).findByText("a.ts")).toBeInTheDocument(); - fireEvent.click(within(pane).getByRole("radio", { name: "Last Turn" })); + fireEvent.click(within(pane).getByRole("tab", { name: "Last Turn" })); await waitFor(() => expect(within(pane).queryByText("a.ts")).toBeNull()); expect(within(pane).getByText("b.ts")).toBeInTheDocument(); expect(within(pane).getByText("Since the last turn started")).toBeInTheDocument(); @@ -3059,7 +3059,7 @@ describe("last turn changes", () => { backend.turnChanges = []; fireEvent.click(within(pane).getByRole("button", { name: "Refresh" })); expect(await within(pane).findByText("The last turn changed no files")).toBeInTheDocument(); - fireEvent.click(within(pane).getByRole("radio", { name: "Whole Task" })); + fireEvent.click(within(pane).getByRole("tab", { name: "Whole Task" })); expect(await within(pane).findByText("a.ts")).toBeInTheDocument(); }); });