F1: cosmetics: regex error reason, one date format, Close Tab
Some checks are pending
ci / ci (macos-15) (push) Waiting to run
ci / ci (ubuntu-24.04) (push) Waiting to run
ci / ci (windows-2025) (push) Waiting to run

- Find shows a bad regex as "invalid pattern: unclosed group": the search
  crate keeps only the parser's reason, the UI drops the invalid-params
  prefix (userMessage).
- Dates read YYYY-MM-DD / YYYY-MM-DD HH:mm in local time everywhere
  (i18n formatDate/formatDateTime): Log, stash list, blame, recovery.
- buffer.close is "Close Tab" in the palette as in the menu; an engine test
  keeps palette labels starting with their menu item's wording.
- Docs: architecture, install (Jump List), localization parity, checklist.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
danny 2026-11-02 19:31:43 +01:00
parent 1b6bd1f870
commit 33a7185d75
18 changed files with 147 additions and 52 deletions

View file

@ -397,9 +397,9 @@ describe("Find tool window", () => {
it("shows a refused regex as an alert", async () => {
const { wrapper } = await mountFind();
findError = { code: "invalid_params", message: "bad regex" };
findError = { code: "invalid_params", message: "invalid params for search.find: invalid pattern: unclosed group" };
await searchFor(wrapper, "(");
expect(wrapper.get("[data-test=find-error]").text()).toBe("bad regex");
expect(wrapper.get("[data-test=find-error]").text()).toBe("invalid pattern: unclosed group");
expect(wrapper.get("[data-test=find-query]").attributes("aria-invalid")).toBe("true");
expect(wrapper.get("[data-test=find-status]").text()).toBe("");
});

View file

@ -1,13 +1,13 @@
/**
* Tests of the message catalog: the `t` helper (lookup, interpolation,
* missing keys) and a scan of the frontend source that every literal key
* missing keys), the one date format, and a scan of the frontend source that every literal key
* passed to `t` exists in `en.json`.
*/
import { readdirSync, readFileSync } from "node:fs";
import { join } from "node:path";
import { afterEach, describe, expect, it, vi } from "vitest";
import en from "../../src/i18n/en.json";
import { hasMessage, t } from "../../src/i18n";
import { formatDate, formatDateTime, hasMessage, t } from "../../src/i18n";
/** Root of the frontend source tree. */
const SRC = join(import.meta.dirname, "..", "..", "src");
@ -205,3 +205,15 @@ describe("en.json", () => {
expect(Object.keys(en).filter((key) => !used.has(key))).toEqual([]);
});
});
describe("dates", () => {
it("shows every date as YYYY-MM-DD and times as HH:mm in local time, whatever the system locale", () => {
const local = new Date(2026, 10, 1, 9, 5, 30);
expect(formatDate(local.getTime())).toBe("2026-11-01");
expect(formatDateTime(local.getTime())).toBe("2026-11-01 09:05");
expect(formatDateTime("2026-12-24T18:30:00")).toBe("2026-12-24 18:30");
expect(formatDate("2026-03-07T23:59:00")).toBe("2026-03-07");
expect(formatDateTime("not a date")).toBe("not a date");
expect(formatDate("")).toBe("");
});
});

View file

@ -29,7 +29,7 @@ import SettingsDialog from "../../src/components/settings/SettingsDialog.vue";
const ENGINE_COMMANDS = [
{ id: "app.about", label: "About Lutra", menuPath: "Help/About Lutra", defaultShortcut: null, params: "", enabled: true, ui: false },
{ id: "app.quit", label: "Quit", menuPath: "File/Quit", defaultShortcut: "Mod+Q", params: "", enabled: true, ui: false },
{ id: "buffer.close", label: "Close Buffer", menuPath: "File/Close Tab", defaultShortcut: "Mod+W", params: "", enabled: false, ui: false },
{ id: "buffer.close", label: "Close Tab", menuPath: "File/Close Tab", defaultShortcut: "Mod+W", params: "", enabled: false, ui: false },
{ id: "buffer.edit", label: "Edit Buffer", menuPath: null, defaultShortcut: null, params: "", enabled: true, ui: false },
{ id: "file.save", label: "Save", menuPath: "File/Save", defaultShortcut: "Mod+S", params: "", enabled: true, ui: false },
{ id: "file.saveAll", label: "Save All", menuPath: "File/Save All", defaultShortcut: "Mod+Alt+S", params: "", enabled: true, ui: false },

View file

@ -112,9 +112,7 @@ describe("RecoveryDialog", () => {
"src/b.php",
"c.php",
]);
expect(rows[0]?.text()).toContain(
`Saved ${new Date(ENTRIES[0]?.savedAt ?? 0).toLocaleString()}`,
);
expect(rows[0]?.text()).toMatch(/Saved \d{4}-\d{2}-\d{2} \d{2}:\d{2}/);
expect(rows[0]?.find("[data-test=recovery-changed]").exists()).toBe(false);
expect(rows[1]?.get("[data-test=recovery-changed]").text()).toBe(
"The file changed on disk since then",