Skip to content

Open viewer entries at their first change and add a changes only view - #871

Merged
SimonCropp merged 7 commits into
mainfrom
viewer-change-navigation
Sep 22, 2026
Merged

SimonCropp merged 7 commits into
mainfrom
viewer-change-navigation

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

Every entry opened at line 1, so a snapshot failing on line 200 was shown as the 200 lines above it, and each path that brought an entry on screen reset to row 0 on its own. They all go through ViewerSession.Open now, which scrolls to the first change with three rows of context above it: selecting, stepping, a re-run that rewrote the text, a variant cycled to, and the entry on screen going.

Moving between changes was n and p, which nothing on screen mentioned. Prev change and Next change sit in the footer of both modes, each disabled when no change is left in its direction. Navigation lands a change three rows under the top rather than on it, and is defined over those landing places (DiffView.Next and Previous) rather than over the top row, which is what makes previous undo next and stops a change already in place being taken for the next one.

Changes only (m) switches to a minimal view: each change with three rows either side, and every longer unchanged run folded into one RowKind.Folded row saying how many lines it stands for. It is a second DiffView built with each entry, so switching costs nothing, and it keeps the row being read on the same line of the screen. Scrolling, the scrollbar and navigation count rows of the view on screen. A selection stays in rows of the entry, unfolded from the head's rows in ViewerSession.Drag, so it survives switching and a fold inside it copies the lines it stands for. The status line names lines of the file rather than rows of the view: "lines 1-1 of 1" beside a fold of forty lines said nothing true. Pictures never fold, since their rows are their properties.

RowKind.Folded and the m key are additive ABI values, so DEVIEW_VERSION stays 8, as it did for DEVIEW_QUEUE_HEADER: a stale library draws a fold as a plain row. The native sources draw it dimmed on a band of its own, and the Swift head no longer prints -1 in the gutter of a row with no number. DeviewStructTests now holds the row kind and key enums against the header too, because a row kind crosses as a cast and a mismatch would fail nowhere.

The ASCII test grid goes from 96 to 136 columns, because the new buttons left no room for the status line that half the screen snapshots are about. Those change in footer and width only, apart from NextChange, which now lands with context. The Linux and macOS pixel baselines need re-accepting from CI, and build-native has to run for the committed binaries.

Every entry opened at line 1, so a snapshot failing on line 200 was shown as the
200 lines above it, and each path that brought an entry on screen reset to row 0
on its own. They all go through ViewerSession.Open now, which scrolls to the first
change with three rows of context above it: selecting, stepping, a re-run that
rewrote the text, a variant cycled to, and the entry on screen going.

Moving between changes was n and p, which nothing on screen mentioned. Prev change
and Next change sit in the footer of both modes, each disabled when no change is
left in its direction. Navigation lands a change three rows under the top rather
than on it, and is defined over those landing places (DiffView.Next and Previous)
rather than over the top row, which is what makes previous undo next and stops a
change already in place being taken for the next one.

Changes only (m) switches to a minimal view: each change with three rows either
side, and every longer unchanged run folded into one RowKind.Folded row saying
how many lines it stands for. It is a second DiffView built with each entry, so
switching costs nothing, and it keeps the row being read on the same line of the
screen. Scrolling, the scrollbar and navigation count rows of the view on screen.
A selection stays in rows of the entry, unfolded from the head's rows in
ViewerSession.Drag, so it survives switching and a fold inside it copies the lines
it stands for. The status line names lines of the file rather than rows of the
view: "lines 1-1 of 1" beside a fold of forty lines said nothing true. Pictures
never fold, since their rows are their properties.

RowKind.Folded and the m key are additive ABI values, so DEVIEW_VERSION stays 8,
as it did for DEVIEW_QUEUE_HEADER: a stale library draws a fold as a plain row.
The native sources draw it dimmed on a band of its own, and the Swift head no
longer prints -1 in the gutter of a row with no number. DeviewStructTests now
holds the row kind and key enums against the header too, because a row kind
crosses as a cast and a mismatch would fail nowhere.

The ASCII test grid goes from 96 to 136 columns, because the new buttons left no
room for the status line that half the screen snapshots are about. Those change
in footer and width only, apart from NextChange, which now lands with context.
The Linux and macOS pixel baselines need re-accepting from CI, and build-native
has to run for the committed binaries.
@SimonCropp SimonCropp added this to the 20.4.0 milestone Sep 21, 2026
@SimonCropp
SimonCropp merged commit 152ccac into main Sep 22, 2026
12 checks passed
@SimonCropp
SimonCropp deleted the viewer-change-navigation branch September 22, 2026 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant