дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-28 21:42:27 +02:00
Search Everywhere and Recent Files lists now support multi-selection: Shift+Up/Down and Shift+click extend a range from the anchor, Cmd/Ctrl+click toggles a row, and Enter opens every selected file, symbol or text result in list order, leaving focus on the lead row. Actions in a mixed selection are skipped; a single selection behaves as before. Selection resets when the query or tab changes. The row-selection model used by Find in Files moves to src/ui so the shared List can opt into modifier selection. Fixes #647
23 рядки
950 B
TypeScript
23 рядки
950 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { selectRow, selectedRows } from "./rowSelection";
|
|
|
|
describe("list selection across sections", () => {
|
|
it("selects only options across headers in either direction", () => {
|
|
const rows = [
|
|
{ key: "files", section: true },
|
|
{ key: "a", section: false },
|
|
{ key: "symbols", section: true },
|
|
{ key: "b", section: false },
|
|
{ key: "actions", section: true },
|
|
{ key: "c", section: false },
|
|
];
|
|
const single = { lead: 3, anchor: 3, keys: null };
|
|
const section = (row: (typeof rows)[number]) => row.section;
|
|
const down = selectRow(rows, single, 5, "range", section);
|
|
expect(selectedRows(rows, down).map((r) => r.key)).toEqual(["b", "c"]);
|
|
const up = selectRow(rows, down, 1, "range", section);
|
|
expect(selectedRows(rows, up).map((r) => r.key)).toEqual(["a", "b"]);
|
|
expect(selectRow(rows, up, 2, "toggle", section)).toBe(up);
|
|
});
|
|
});
|