Compare commits

...
Author SHA1 Message Date
l0ng-ai 4a9cf256bc fix(agents): show the changes scope as compact tool window tabs
The Whole Task / Last Turn switch in the agent Changes pane was a full-width
segmented pill. It now uses the compact Tabs strip that tool window sub-views
use elsewhere.
2026-11-23 15:18:24 +08:00
3 changed files with 19 additions and 19 deletions

No files matched your search

+1 -1
View File
@@ -1274,7 +1274,7 @@
}
.changesScope {
flex: none;
padding: 6px 10px 2px;
padding: 0 4px;
}
.changesSummary {
flex: none;
+16 -16
View File
@@ -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 && <IconButton icon="chevron-right" title={tx("Hide changes")} size="small" onClick={onHide} />}
</div>
<div className={styles.changesScope}>
<SegmentedControl
ariaLabel={tx("Changes to show")}
options={[
{ value: "task", label: tx("Whole Task") },
{ value: "turn", label: tx("Last Turn") },
]}
value={scope}
onChange={(value) => {
setChangesOptions({ scope: value === "turn" ? "turn" : "task" });
void refreshChanges(task.id);
}}
/>
</div>
<Tabs
variant="compact"
className={styles.changesScope}
aria-label="Changes to show"
activeId={scope}
onSelect={(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) && (
<div className={styles.changesSummary}>
{scope === "turn" ? (
+2 -2
View File
@@ -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();
});
});