feat(vcs): clearer branch sync indicators and diff line-ending badges (#1667)

Branch sync markers were drawn three different ways in the title bar, the branches popup and the Git Log tree. Diff panels also said "Contents are identical" for files that differ only in line endings.

The markers now share one `BranchSync` component. The diff labels each side with its line ending when they differ, and shows "Contents differ only in line separators" when nothing else does.

Siblings covered: long branch names truncate in the Git Log tree without clipping the markers, and static sides with mixed line endings are compared as they are. A live working file with mixed line endings still reads as identical to its normalized form, because open documents are normalized.

Co-authored-by: muutot <[email protected]>
Цей коміт міститься в:
Muuтаmuutot authored and GitHub committed 2026-11-08 22:00:32 +08:00
1 джерело c20f4c0e84
коміт 24bee8eef2
23 files changed
+232 -62

No files matched your search

+3
Переглянути файл
@@ -30,6 +30,7 @@ import {
} from "@codemirror/state";
import { GutterMarker, ViewPlugin, type EditorView } from "@codemirror/view";
import type { LanguageDescription } from "@codemirror/language";
import type { LineEnding } from "@/platform/ipc";
import { create } from "zustand";
import { maybeEditorService } from "@/workbench/contributions";
@@ -636,6 +637,8 @@ export interface DocumentAttachment {
doc: number;
/** Current document text; build the view's state from it. */
text(): string;
/** The document's line ending (detected on load, as the status bar shows). */
lineEnding(): LineEnding;
/** The document's language mode name (backend-assigned, as the editor tabs use). */
uiMode(): string | null;
readOnly: boolean;
+1
Переглянути файл
@@ -126,6 +126,7 @@ export async function attachDocument(
path,
doc: model.doc,
text: () => model.sync.localText.toString(),
lineEnding: () => model.getMeta().lineEnding,
uiMode: () => model.getMeta().uiMode,
get readOnly() {
return model.getMeta().readOnly || model.virtual;