M4.4: Git gutter change markers and status colours in tree and tabs

- git.lineChanges {id} -> {ranges: [{kind, startLine, endLine}], version}:
  the buffer against its index blob, line diff with similar (Myers +
  Replace, no Compact) off the lock, CRLF-safe; index texts cached per
  path and dropped on gitChanged (State::emit -> git_lines::observe)
- editor gutter markers for added, modified and deleted lines, queried
  150 ms after edits, on show and on gitChanged, mapped through edits
- vcsStatus store (git.status on projectOpened and gitChanged, no
  polling) colouring file names in the project tree and editor tabs with
  the --lt-vcs-* tokens; contrast also checked on the active tab
- tests: unit and property tests, real-repo engine tests, Vitest
- docs: architecture, parity, gaps, roadmap, ui-parity, ROADMAP

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
danny 2026-10-25 17:36:59 +01:00
parent 56dadc91dc
commit fc8ae6c2e3
24 changed files with 1970 additions and 20 deletions

View file

@ -4,13 +4,16 @@
*
* A click activates a tab, a middle click or the close button closes it,
* Left/Right move between tabs. A dot marks unsaved changes. Closing a
* dirty tab asks first (see the editor store).
* dirty tab asks first (see the editor store). Names are coloured by their
* Git status (`--lt-vcs-*`, M4.4).
*/
import { X } from "@lucide/vue";
import { t } from "../../i18n";
import { useEditorStore } from "../../stores/editor";
import { useVcsStatusStore } from "../../stores/vcsStatus";
const editor = useEditorStore();
const vcs = useVcsStatusStore();
/**
* Closes a tab on a middle click.
@ -67,7 +70,11 @@ function onKeydown(event: KeyboardEvent): void {
@mousedown.middle.prevent
@auxclick="onAuxClick($event, tab.id)"
>
<span class="tabs__name">{{ tab.name }}</span>
<span
class="tabs__name"
:class="vcs.colourOf(tab.path) ? `tabs__name--vcs-${vcs.colourOf(tab.path)}` : undefined"
:data-vcs="vcs.colourOf(tab.path) ?? undefined"
>{{ tab.name }}</span>
<span
v-if="tab.dirty"
class="tabs__dirty"
@ -127,6 +134,30 @@ function onKeydown(event: KeyboardEvent): void {
outline-offset: -1px;
}
.tabs__name--vcs-added {
color: var(--lt-vcs-added);
}
.tabs__name--vcs-modified {
color: var(--lt-vcs-modified);
}
.tabs__name--vcs-deleted {
color: var(--lt-vcs-deleted);
}
.tabs__name--vcs-untracked {
color: var(--lt-vcs-untracked);
}
.tabs__name--vcs-ignored {
color: var(--lt-vcs-ignored);
}
.tabs__name--vcs-conflicted {
color: var(--lt-vcs-conflicted);
}
.tabs__dirty {
width: 7px;
height: 7px;