Skip to content

Rework the Lite diff file header, reviewed state, and keyboard navigation - #15658

Merged
PavelLaptev merged 8 commits into
masterfrom
diff-changes
Aug 30, 2026
Merged

Rework the Lite diff file header, reviewed state, and keyboard navigation#15658
PavelLaptev merged 8 commits into
masterfrom
diff-changes

Conversation

@PavelLaptev

@PavelLaptev PavelLaptev commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

🧢 Changes

Related to GB-1912

Diff view work in Lite:

  • Match the diff file header to the design, and add air under it before the first hunk separator.
  • Say what the header's line counts mean, and add a ChangeScale component (with stories) that replaces the old ChangeTypeBadge.
  • Mark reviewed files in the file lists, backed by a new reviewed-paths module.
  • Rename the bulk review action labels.

Before:

Screenshot 2026-08-30 at 16-46-05

After:

Screenshot 2026-08-30 at 16-47-46
  • Move between files in the diff with Alt+Shift+↑/↓.
  • Focus the diff file header on click, and drop the platform focus ring around the diff pane.
Screen.Recording.2026-08-30.at.16.51.34.mov

☕️ Reasoning

The diff pane header was carrying unlabelled numbers and a badge that didn't match
the design, and there was no way to tell which files you'd already looked at or to
step between files from the keyboard. This brings the header in line with the design,
makes the line counts self-explanatory, and adds reviewed-state tracking plus keyboard
navigation so a multi-file diff can be worked through without the mouse.

@github-actions

Copy link
Copy Markdown

This pull request changes Lite's UI, so it is labelled
screenshots needed. Before/after screenshots make it reviewable
without checking the branch out.

Attach them however you like — drag images straight into a comment, or
have an agent capture them for you (the lite-screenshots skill in
this repository does it against seeded fixtures).

Swap the label for screenshots once they are posted, or remove it if
this change is not visual. Either sticks — this is asked once per pull
request, so later pushes will not put it back.

@github-actions github-actions Bot added the screenshots needed Before/after UI screenshots are wanted on this PR label Aug 30, 2026
Adds Previous/Next file navigation to the diff pane, one step above the
existing Alt+arrow hunk navigation. Landing on a file scrolls its header
to the top, matching what picking the file in the file list does.
CodeView makes the diff scroller focusable, so the first arrow keypress
turned it :focus-visible and raised the UA focus ring around the whole
pane. The file tree already suppresses its own; the diff pane shows focus
on the selected lines instead.
Adds a ChangeScale component - the green/red squares that show at a glance
how much of a change is additions - beside the +N -N counts, and regroups the
header's trailing cluster into tallies, a separator, then the controls.

The review control becomes the design's "Viewed" button: one button carrying
checkbox semantics with the box drawn inside it, rather than a real Checkbox
nested in a button or a label, either of which leaves two controls where the
design has one. The change type badge goes, as the design has no place for it.
Clicking a file header fell through to the whole-diff container, so the next
Tab restarted at the first file in the diff rather than walking the actions of
the header you clicked. A tabindex of -1 makes the header mouse-focusable
without adding a tab stop.
The +N -N in a file header carried no wording: the units live in the colours,
which say nothing to a screen reader and little to anyone who has not learnt
them. It gets a tooltip and a matching label, as the files panel's counts
already have.

The phrasing moves to describeLineStats so ChangeStats shares it rather than
keeping a second copy of the pluralisation.
Update the workspace details toolbar button text from "Mark all
reviewed/unreviewed" to "Mark all viewed/unviewed".

Use wording that matches the viewed state tracked by the UI so the bulk
action label is clearer and more accurate.
A file list said nothing about what had been reviewed, so the only way to
find your place was to open files one by one. A reviewed file now shows a
tick where its change type sits, and what the row says about it recedes -
its actions stay at full strength, since dimming a control reads as
disabling it.

Reviewing records the version it saw, so the tick tracks the diff on show
and drops as soon as the file changes again, matching the indeterminate
state its diff header draws. The uncommitted list holds changes but no
diffs, so useReviewedPaths fetches them for the reviewed paths alone -
nothing reviewed, nothing fetched - and those are the queries the diff pane
loads anyway. Both lists share one predicate so they cannot drift apart.
@PavelLaptev PavelLaptev added screenshots Before/after UI screenshots are attached and removed screenshots needed Before/after UI screenshots are wanted on this PR labels Aug 30, 2026
@linear-code

linear-code Bot commented Aug 30, 2026

Copy link
Copy Markdown

GB-1912

@PavelLaptev
PavelLaptev merged commit 21a0145 into master Aug 30, 2026
42 checks passed
@PavelLaptev
PavelLaptev deleted the diff-changes branch August 30, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

@gitbutler/lite screenshots Before/after UI screenshots are attached

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant