F1: cosmetics: regex error reason, one date format, Close Tab
- 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:
parent
1b6bd1f870
commit
33a7185d75
18 changed files with 147 additions and 52 deletions
|
|
@ -27,7 +27,7 @@
|
|||
import { RangeSet, RangeSetBuilder, StateEffect, StateField, type EditorState, type Extension, type Text } from "@codemirror/state";
|
||||
import { EditorView, GutterMarker, ViewPlugin, gutter, showTooltip, type PluginValue, type Tooltip, type ViewUpdate } from "@codemirror/view";
|
||||
import { runWaiting, type JsonValue } from "../../ipc";
|
||||
import { t } from "../../i18n";
|
||||
import { formatDate, formatDateTime, t } from "../../i18n";
|
||||
import type { AssistBuffer } from "./assist";
|
||||
|
||||
/** Delay between the last edit and the query. */
|
||||
|
|
@ -154,18 +154,13 @@ export function ageLevel(iso: string, now: number): number {
|
|||
}
|
||||
|
||||
/**
|
||||
* A short local date, `YYYY-MM-DD`.
|
||||
* A short local date, `YYYY-MM-DD` ({@link formatDate}).
|
||||
*
|
||||
* @param iso - ISO 8601 date.
|
||||
* @returns the date, or the input when it cannot be read.
|
||||
*/
|
||||
export function shortDate(iso: string): string {
|
||||
const date = new Date(iso);
|
||||
if (Number.isNaN(date.getTime())) {
|
||||
return iso;
|
||||
}
|
||||
const pad = (n: number): string => String(n).padStart(2, "0");
|
||||
return `${String(date.getFullYear())}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
|
||||
return formatDate(iso);
|
||||
}
|
||||
|
||||
/** The text and look of one annotated line. */
|
||||
|
|
@ -343,9 +338,7 @@ function hoverCard(line: BlameLine): { dom: HTMLElement; message: HTMLElement }
|
|||
head.textContent = t("editor.blame.notCommitted");
|
||||
message.textContent = t("editor.blame.notCommittedHint");
|
||||
} else {
|
||||
const date = new Date(line.date);
|
||||
const when = Number.isNaN(date.getTime()) ? line.date : date.toLocaleString();
|
||||
head.textContent = t("editor.blame.byLine", { hash: line.hash.slice(0, 8), author: line.author, date: when });
|
||||
head.textContent = t("editor.blame.byLine", { hash: line.hash.slice(0, 8), author: line.author, date: formatDateTime(line.date) });
|
||||
message.textContent = messages.get(line.hash) ?? line.summary;
|
||||
const hint = document.createElement("div");
|
||||
hint.className = "lt-blame-tooltip__hint";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue