дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-03 16:51:16 +02:00
⌘F12 / Ctrl+F12 in a focused table editor now opens Go to Column: the table's columns with types and key icons, filtered as you type; Enter selects that column's cell in the current row and scrolls to it. The grid also scrolls sideways when arrow keys or the search bar's current match move to a column outside the view.
17 рядки
628 B
TypeScript
17 рядки
628 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { filterColumns } from "./ColumnsPopup";
|
|
|
|
const columns = ["id", "user_id", "name", "created_at", "username"].map((name) => ({ name, type: "TEXT" }));
|
|
|
|
describe("filterColumns", () => {
|
|
it("lists every column for an empty query", () => {
|
|
expect(filterColumns(columns, " ")).toEqual([0, 1, 2, 3, 4]);
|
|
});
|
|
|
|
it("puts prefix matches first, then other matches, ignoring case", () => {
|
|
expect(filterColumns(columns, "US")).toEqual([1, 4]);
|
|
expect(filterColumns(columns, "name")).toEqual([2, 4]);
|
|
expect(filterColumns(columns, "_id")).toEqual([1]);
|
|
});
|
|
});
|