A2: disk-conflict banner, overwrite question and Local History dialog

- Banner inside the editor pane for a dirty tab whose file changed
  (Reload (discard mine) / Keep mine / Compare) or was deleted (Keep as
  unsaved / Close); state in stores/diskConflicts.ts, the old notice is gone.
- Save and save all ask Overwrite / Cancel when the engine refuses with
  disk_changed.
- Diff tabs against the disk text (file.readDisk) and a Local History
  entry (history.read); "Revert to This" in the caption.
- Show Local History dialog (history.show: tree context menu, palette,
  File menu) with Show Diff and an undoable Revert to This.
- History failures warn once until a snapshot works again.
- Docs: docs/local-history.md, G2 in gaps.md, ui-parity, architecture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
danny 2026-11-08 12:23:14 +01:00
parent dfe2f19ca5
commit d2344bf216
29 changed files with 1999 additions and 52 deletions

View file

@ -2,7 +2,7 @@
/**
* The project tree's context menu (M4.3). For a file: Open, Show Diff
* (`vcs.showDiff {path}`) and Show History (`vcs.showHistory {path}`,
* M4.6), the Git items dimmed while their command is disabled. For a file
* M4.6) and Show Local History (`history.show {path}`, C10 A2), the Git items dimmed while their command is disabled. For a file
* and a folder: Upload to Server, Compare with Server (a diff for a file,
* the sync preview for a folder, C9 D2) and Download from Server
* (`deployment.upload` / `deployment.compare` / `deployment.download
@ -20,6 +20,7 @@ import { t } from "../../i18n";
import { useEditorStore } from "../../stores/editor";
import { SHOW_DIFF_COMMAND } from "../vcs/diff/diff";
import { SHOW_HISTORY_COMMAND } from "../vcs/log/log";
import { SHOW_HISTORY_COMMAND as SHOW_LOCAL_HISTORY_COMMAND } from "../history/localHistory";
const props = defineProps<{
/** Project-relative path of the file. */
@ -103,6 +104,12 @@ const fileItems = computed<MenuItem[]>(() => [
enabled: commands.isEnabled(SHOW_HISTORY_COMMAND),
run: () => commands.execute(SHOW_HISTORY_COMMAND, { path: props.path }),
},
{
id: "showLocalHistory",
label: t("project.tree.menu.showLocalHistory"),
enabled: commands.isEnabled(SHOW_LOCAL_HISTORY_COMMAND),
run: () => commands.execute(SHOW_LOCAL_HISTORY_COMMAND, { path: props.path }),
},
]);
/** The items, in order. */