Open viewer entries at their first change and add a changes only view - #871
Merged
Merged
Conversation
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.
…e-navigation Rebuild native renderer binaries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.