fix(vcs): drop check marks from the Git Log User filter menu (#6290)

The Git Log User filter menu showed check marks next to users, reading like a multi-select, while a click sets the filter to that user alone (IDEA's behaviour; several users go through Select…). The rows no longer carry check marks.

Refs #6289

Co-authored-by: formiat <[email protected]>
Цей коміт міститься в:
Alexanderтаformiat authored and GitHub committed 2026-12-01 15:43:13 +08:00
1 джерело 711349c6c1
коміт aee715f797
2 files changed
+38 -2

No files matched your search

+35
Переглянути файл
@@ -362,6 +362,41 @@ test("long Git Log filter values shorten inside their buttons", async ({ workben
await expect(clear).toBeHidden();
});
test("a click in the User filter shows only that user's commits, without check marks", async ({ workbench: page }) => {
const alice = "Alice <[email protected]>";
const bob = "Bob <[email protected]>";
await page.evaluate(
async ([alice, bob]) => {
const optionsModule = "/src/features/vcs/logOptions.ts";
const { setLogOptions } = await import(/* @vite-ignore */ optionsModule);
// Room for the User filter on the bar.
setLogOptions({ showBranches: false, showDetails: false });
const h = window.__ipc.handlers;
h.vcs_log_users = () => [alice, "Author <[email protected]>", bob];
const log = h.vcs_log!;
h.vcs_log = (args) => {
(window as { logAuthors?: unknown }).logAuthors = (args.query as { authors: string[] }).authors;
return log(args);
};
},
[alice, bob],
);
const toolbar = page.getByRole("toolbar", { name: "Log filters" });
const user = toolbar.getByRole("button", { name: /^User/ });
const item = (name: string) => page.getByRole("menuitem", { name, exact: true });
const logAuthors = () => page.evaluate(() => (window as { logAuthors?: unknown }).logAuthors);
await user.click();
await item(alice).click();
await expect(user).toHaveText(`User: ${alice}`);
await expect.poll(logAuthors).toEqual([alice]);
await user.click();
await expect(page.getByRole("menuitemcheckbox", { name: alice, exact: true })).toHaveCount(0);
await item(bob).click();
await expect(user).toHaveText(`User: ${bob}`);
await expect.poll(logAuthors).toEqual([bob]);
});
test("Git Log puts affected changes on the changed-files toolbar and groups preview options", async ({
workbench: page,
}) => {
+3 -2
Переглянути файл
@@ -218,12 +218,13 @@ export function FilterBar({ fileHistory = false }: { fileHistory?: boolean }) {
label: authors.join(", "),
run: () => setLogFilters({ authors }),
})),
{ label: ME, checked: filters.authors.includes(ME), run: () => setLogFilters({ authors: [ME] }) },
// A click sets the filter to that user alone, as IDEA does (several users go through Select…), so the
// rows carry no check marks that would read as a multi-select.
{ label: ME, run: () => setLogFilters({ authors: [ME] }) },
...(authors.length ? [{ kind: "separator" as const }] : []),
...authors.slice(0, 30).map((a) => ({
verbatim: true,
label: a,
checked: filters.authors.includes(a),
run: () => setLogFilters({ authors: [a] }),
})),
{ kind: "separator" },