Skip to content

feat(desktop): mark files viewed and count their threads and lines on Files changed's tree rows - #3798

Merged
luke-agent[bot] merged 16 commits into
mainfrom
luke/files-changed-tree-viewed-counts
Oct 19, 2026
Merged

luke-agent[bot] merged 16 commits into
mainfrom
luke/files-changed-tree-viewed-counts

Conversation

@dastratakos

@dastratakos dastratakos commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

T1 of the "File tree: viewed and counts" stack, which brings stage-cli's tree rows to Files changed. Each file row in the tree beside Files changed now ends in:

  • Comment count: a speech mark with how many review threads are on the file. Like stage-cli, every thread counts, resolved or not.
  • Lines added and removed: a compact +N −M, shown only where the row has room for it.
  • Viewed toggle: a circle that writes through the same useViewedFiles door the header's Viewed box and V use, so it shows pending and refusal the same way. A press shows at once. If GitHub refuses, the mark goes back and the write note under the bar says why. Marking a file viewed folds it in the list, as the box does.
    • The toggle doesn't take room of its own. On a hovered or keyboard-focused row, it sits over the end of the marks, in their place.
    • A viewed row always shows its check in that same place, and the lane keeps room for it so the name is cut before the check rather than under it.
    • Pressing the toggle doesn't open the file or move the tree's keyboard focus.
  • Dimming: viewed rows are dimmed, except the file currently shown.

Folder rows are unchanged. No new GitHub request: the data comes from the viewed read, the review threads, and the changes answer.

Stacked on #3794.

How it's drawn

  • Contract extended, not drawn over. FileMark (file-tree/contract.ts) gains optional lines, threads and viewed, and FileTreeProps gains onViewed. The tree bundle draws them through Pierre's own renderRowDecoration, as one run of four parts in a fixed order. The new file-tree/row-marks.ts holds the decoration, the sheet that styles it, and how a press is matched to the toggle.
  • The name wins. The lane only gets the room the name leaves, as Pierre lays it out, so a mark never cuts a name short. Pierre cuts a name only when the row itself is too narrow, using its own middle ellipsis that keeps the extension. Where the leftover room runs out, the run gives up its parts from the end: −M, then +N, then the count's number, then the speech mark. The run is one line of a wrapping flex box with its second line clipped.
  • CSP fix along the way. Pierre writes unsafeCSS into an inline <style>, which the panel's style-src 'self' refuses. So the tree's existing thin-scrollbar rule never applied. The tree's rules are now a constructed sheet adopted by its shadow root, which the policy allows (as for the terminal, terminal/adopted-styles.ts). It's adopted again whenever Pierre moves its element. The thin scrollbar therefore now applies, as its comment always said it would.
  • Redraws. Pierre redraws rows only when the git status changes, so mark() asks it to redraw (setComposition) whenever a viewed mark or count changes.

Screenshots

PR #3645 drawn in the Files changed harness (Chromium, the panel's real CSP and stylesheet). The pointer rests on changes-list.tsx. Four files are marked viewed and six review threads sit on three files.

before after
dark 900
light 900
dark 600
light 600

Tests

  • file-tree/index.test.ts (new) mounts the real bundle and draws real Pierre rows in jsdom:
    • each file row's run and its hint; folder rows and bare marks draw nothing;
    • a press on the toggle marks the file and opens nothing, while a press on the rest of the row opens it;
    • marks handed again redraw the rows;
    • a mark with no viewed draws no toggle.
  • agent-changes-tab.test.ts:
    • the tree is handed each file's lines, thread count (resolved threads included) and viewed mark;
    • the tree's toggle writes mark-file-viewed, ticks the header box and folds the file;
    • no toggle is drawn before the marks are read.

Evidence

  • pnpm check:affected ran out of memory in discarded-effect. Its other steps passed, so I ran the fallback list:
    • tsc --noEmit for panel and desktop: clean;
    • vitest --project panel: 197 files, 2116 tests passed;
    • ./scripts/oxlint.sh: 0 errors;
    • pnpm knip: clean;
    • ./scripts/repository-checks.sh: passed;
    • biome check: no errors.
  • cd apps/desktop && node scripts/build.mjs: passed, bundle budget included.

Invariants

  • Checks green locally, as listed above.
  • JSON Schema goldens unchanged.

Made with Luke

View guided diff Turn on auto-fix

dastratakos and others added 12 commits October 19, 2026 03:24
…-cli does

Minimize inline comments folded each open thread to its head row, and left
resolved and outdated threads as they were, since those already stand
folded; on a pull request whose threads were resolved it changed nothing
to see. It now means what stage-cli's means: each line's threads draw as
one chip at the end of the line, in a row of no height, so the diff reads
as if the line held no comments. The chip names who wrote on the line,
how many comments, and how many are open; pressing it shows or hides the
line's threads, and the tab's find reads them and opens the line it
brings into view. I turns the setting on and off inside Files changed.

Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
…on no line a row for their chip

Two findings from review. The chip's fold was drawn anew each time it
opened or closed, so a find that opened a resolved thread's own fold inside
it had that fold drawn closed again, and a keyboard press lost the focus;
the fold is now kept and told whether it is open. And the chip of threads
on no line, above the diff or under a file's picture, floated up over what
stood before it; it now takes a row of its own.

Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
…iet fold and a clearer header

Each file's code area kept room for a scroll bar up and down, which a Mac
that always shows scroll bars drew as a strip at the end of every line, so
the rows and the bands between hunks stopped short of the file's header.
The code area keeps none now, and the header, the bands, the rows, and the
threads share one left and one right edge.

Each file is a card on the panel's ground, rounded whole and set apart by
the room between files; its header stuck at the top stands square, the
card's rounded top scrolled away. The fold is a compact quiet mark with no
fill while its file is open. The header names the file's folder quietly
and its name in the full ink, cutting the folder first where the row runs
short; its letter stands on a tint of its own colour; and Viewed says V in
its hint. The bands between hunks are 24 px and quieter, and the tree's
search stands level with the first card.

Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
…anged-design

Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
Adds I to Files changed's shortcut table (Review group) and to its dispatch record, after #3795.

Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
Viewed's hint now reads V from Files changed's shortcut table (#3795).

Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
… Files changed's tree rows

Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
…drawn

Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
@vercel

vercel Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
luke-web Ignored Ignored Preview Oct 19, 2026 10:43am UTC

Request Review

…anding in the marks' place

Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
@luke-agent
luke-agent Bot marked this pull request as ready for review October 19, 2026 05:32
devin-ai-integration[bot]

This comment was marked as resolved.

…he tree's tests on no clock

Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
devin-ai-integration[bot]

This comment was marked as resolved.

Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
@luke-agent
luke-agent Bot added this pull request to the merge queue Oct 19, 2026
Merged via the queue into main with commit 17f2f17 Oct 19, 2026
5 checks passed
@luke-agent
luke-agent Bot deleted the luke/files-changed-tree-viewed-counts branch October 19, 2026 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant