Порівняти коміти

..
Автор SHA1 Повідомлення Дата
l0ng-ai c60cf55dbc perf: add a scenario for switching between and scrolling long agent conversations
`agentTabs` opens two agent tasks with 150-turn (2,100-entry) conversations,
switches between them with the Switcher (Ctrl+Tab) and scrolls one, with
scroll anchoring off as in WebKit. Budgets cover the conversation's DOM size,
rows that never skip rendering off screen, switch latency and main-thread
time, scroll jumps and scroll frame pacing.

The conversations come from a dev/perf-only `agents.openSampleConversations`
action.
2026-11-09 11:36:14 +08:00
6 змінених файлів з 6 додано та 67 видалено

No files matched your search

Бінарний файл не відображається.

До

Ширина:  |  Висота:  |  Розмір: 86 KiB

Після

Ширина:  |  Висота:  |  Розмір: 377 KiB

+1 -2
Переглянути файл
@@ -72,11 +72,10 @@
"tabs.openSmallMs": 100,
"tabs.switchP95Ms": 33,
"tabs.switcherP50Ms": 33,
"agentTabs.conversationNodes": 20000,
"agentTabs.rowsAlwaysRendered": 0,
"agentTabs.switchP95Ms": 50,
"agentTabs.switchP95Ms": 66,
"agentTabs.switchMainThreadMs": 50,
"agentTabs.switchTbtMs": 50,
"agentTabs.scrollJumps": 0,
+1 -15
Переглянути файл
@@ -455,21 +455,7 @@ const tabs: Scenario = {
switches.push(await h.measure(() => tab.click(), ".cm-content", `// tab-${i}`));
}
}
// The Switcher (Ctrl+Tab) back and forth between the two most recent tabs.
const before = await h.counters();
const switcher: number[] = [];
for (let i = 0; i < 10; i++) {
const tag = i % 2 ? names.length - 1 : names.length - 2;
switcher.push(await h.measure(() => h.pressAction("navigate.switcher"), ".cm-content", `// tab-${tag}`));
await h.page.waitForTimeout(150);
}
const work = Harness.delta(before, await h.counters());
return {
openSmallMs,
...latencySummary(switches, "switch"),
...latencySummary(switcher, "switcher"),
switcherMainThreadMs: work.taskMs / switcher.length,
};
return { openSmallMs, ...latencySummary(switches, "switch") };
},
};
-6
Переглянути файл
@@ -435,15 +435,10 @@
display: flex;
height: 100%;
min-height: min(520px, calc(100vh - 200px));
/* A cap, not just a floor: left list and right form scroll on their own
(IDEA), so the panes never grow the dialog body into one shared scroller.
vh − ~104px is what a full-height resized dialog's body can hold anyway. */
max-height: calc(100vh - 120px);
}
.editSidebar {
flex: none;
width: 250px;
min-height: 0;
display: flex;
flex-direction: column;
border-right: 1px solid var(--border-popup);
@@ -457,7 +452,6 @@
}
.editList {
flex: 1;
min-height: 0;
overflow: auto;
padding: 4px 0;
}
+1 -37
Переглянути файл
@@ -55,7 +55,7 @@ vi.mock("../find/windowStore", async (orig) => ({
const contributions = await import("@/workbench/contributions");
const { commands } = await import("@/platform/ipc");
const { RecentPopupsOverlay } = await import("../recent/RecentPopups");
const { cycleSwitcher, showRecentPopup, hideRecentPopup, useRecentPopup } = await import("../recent/store");
const { showRecentPopup, hideRecentPopup, useRecentPopup } = await import("../recent/store");
const { openLocation } = await import("../common/open");
const { usePlatform } = await import("@/platform/platformInfo");
const { allActions } = await import("@/platform/actions");
@@ -476,42 +476,6 @@ describe("Recent Files multi-selection", () => {
});
});
describe("Switcher", () => {
afterEach(() => vi.restoreAllMocks());
it("opens the selection when Ctrl is released, once the popup gave focus back, in the same task", async () => {
const tab = (key: string, lastActive: number) => ({
input: { kind: "agent-session", key },
title: key,
icon: "toolwindow-agents",
lastActive,
});
const seen: Array<{ key: string; popup: boolean; focus: Element | null }> = [];
vi.spyOn(commands, "recentFiles").mockResolvedValue({ status: "ok", data: [] });
vi.spyOn(contributions, "maybeEditorService").mockReturnValue({
openTabs: () => [tab("task-b", 2), tab("task-a", 1)],
openPaths: () => [],
activePath: () => null,
openInput: async (input: { key: string }) => {
seen.push({ key: input.key, popup: !!screen.queryByRole("dialog"), focus: document.activeElement });
},
} as unknown as import("@/workbench/contributions").EditorService);
render(
<>
<button type="button">editor</button>
<RecentPopupsOverlay />
</>,
);
const editor = screen.getByRole("button", { name: "editor" });
editor.focus();
act(() => cycleSwitcher(1));
await tick();
expect(screen.getByRole("dialog", { name: "Switcher" })).toBeInTheDocument();
act(() => void fireEvent.keyUp(window, { key: "Control" }));
expect(seen).toEqual([{ key: "task-a", popup: false, focus: editor }]);
});
});
describe("Find in Files dialog", () => {
it("streams results and highlights the matches while replacing, as IDEA", async () => {
render(<FindInFilesOverlay />);
+3 -7
Переглянути файл
@@ -1,6 +1,5 @@
import { useFilePresentation } from "@/platform/filePresentation";
import { useEffect, useMemo, useRef, useState, type KeyboardEvent, type MouseEvent as ReactMouseEvent } from "react";
import { flushSync } from "react-dom";
import clsx from "clsx";
import { editorsFor, getNavigationHistory } from "@/editor/api";
import { call, commands, type OutlineItem } from "@/platform/ipc";
@@ -62,13 +61,10 @@ export function RecentPopupsOverlay() {
const NAV_KEYS = ["ArrowDown", "ArrowUp", "PageDown", "PageUp"];
/**
* Runs `fn` once the dialog has unmounted and given focus back, in the same frame: the
* popup closing and what it opens paint together, without a frame of the old editor between.
*/
/** Defers work until the dialog unmounted and restored focus. */
const afterClose = (fn: () => void) => {
flushSync(hideRecentPopup);
fn();
hideRecentPopup();
setTimeout(fn, 0);
};
// ---------------------------------------------------------------------------