Skip to content

feat(desktop): expand a whole file from its header, and show a file that only moved as its lines - #3797

Merged
luke-agent[bot] merged 22 commits into
mainfrom
luke/files-changed-whole-file
Oct 19, 2026
Merged

luke-agent[bot] merged 22 commits into
mainfrom
luke/files-changed-whole-file

Conversation

@dastratakos

@dastratakos dastratakos commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Part of the stage-cli features the developer chose: expand or collapse a whole file, as stage-cli's file header does (file-diff-list.tsx:522, lib/file-expansion-context.tsx, lib/full-file-preview.ts). Built on #3762's readTexts and stacked on the header actions PR.

  • Expand full file / Collapse to changes.
    • A compact header button (UnfoldVertical/FoldVertical, with a pressed state and a tooltip) draws the whole file, every unchanged line among its changes, until it's pressed again.
    • It's offered only on files feat(desktop): expand context lines in Files changed #3762 lets expand: changed in place or moved with changes, a patch drawn, not a secret path.
    • It's also offered on files that only moved. It's never offered on images drawn as pictures.
  • How the file gets drawn. Pierre 1.5.2's CodeView only has a list-wide expandUnchanged. So instead of driving expandHunk across a file's hunks, the item's fileDiff is replaced with parseDiffFromFile(before, after, { context: MAX }): one hunk holding every line.
    • It's cached per texts object, so redrawing a file for its notes keeps the same diff.
    • Collapse re-parses the patch fresh, which returns the file to its changes, gaps closed.
    • It survives virtualization by construction: the item's diff is the whole file, so scrolling away and back draws it the same. I checked this in the harness: lines 1… are still drawn after scrolling 30,000 px away and back.
  • Reading the file. It goes through the same door as the gaps (FileTexts.read): one TASKS_FILE read at headSha, blobSha-checked, kept for the answer's life.
    • Nothing is read until the button is pressed, and a file whose gaps were already opened isn't read again.
    • A refused read leaves the file as it is and shows the refusal line, as a gap's refusal does.
  • A pure rename (no hunks) still says "renamed without changes" at first. Once expanded, it shows its whole text as unchanged lines (textsOf treats the text before as the text after).
    • stage-cli shows these up front, because its CLI sends both sides of every file.
    • Here that would be one GitHub read per renamed file on every open, so it's behind the same button.
    • The note itself offers it too: "File renamed without changes to its contents. · Show file", a link-toned TextButton that runs the same toggle.
  • Threads stay anchored, since annotations are keyed by side and line. Commenting stays limited to lines GitHub accepts (commentLines is unchanged).

Screenshots

PR #2908's build.mjs in the harness (Chromium).

light dark
the button's hint
expanded, lines from 1
a pure rename's Show file (PR #2855)

Evidence

  • tsc --noEmit for panel and desktop: clean.
  • ./scripts/oxlint.sh: 0 errors.
  • pnpm knip: clean.
  • ./scripts/repository-checks.sh: passed.
  • vitest run --project panel --project desktop: 231 files, 2366 tests passed, run with this change in the tree.
  • New test in agent-changes-tab.test.ts:
    • An added file is offered nothing; a file that only moved starts as its notice.
    • Expanding hands the bundle whole texts. For the moved file, pressed through its note's Show file, before equals after and it's no longer a lead.
    • Collapse to changes drops whole.
    • Re-expanding reads nothing new: two files, two reads.

Invariants

  • Checks green locally, as listed above.
  • JSON Schema goldens unchanged.
  • Behaviour tested.
  • No new as.
  • No raw async primitives.
  • Test count +1.
  • Deps unchanged.

Made with Luke

View guided diff Turn on auto-fix

Review fixes (Devin)

  • A pure rename shown whole drew nothing: two identical texts diff to no hunk. diff-view/whole-diff.ts now lays such a file out as one context hunk. A file with no lines keeps its notice.
  • Threads on a file drawn whole are placed against every line of its texts, not just the patch's rows. This covers a pure rename and threads outside the hunks of an expanded file.
  • A stale whole read (from before a refresh) is dropped instead of overwriting files expanded since.

dastratakos and others added 9 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>
…ere on its row, and fold every file with ⌥

A file's header now copies the path it names on a press, as stage-cli's
does, a renamed file's old path and new path each its own; a press anywhere
else on the row folds the file, its controls keeping their own presses;
and ⌥ with a press on the fold folds every file the filter keeps, or
unfolds them all, which the fold's hint says.

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>
…er-actions

Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
…hat only moved as its lines

A file's header now offers Expand full file, as stage-cli's does: the file
is read as its gaps read it, once, at the pull request's head, its text
before turned back from its patch, and drawn whole, every unchanged line
among its changes, until Collapse to changes. A file that only moved, which
said so in its lines' place, shows its whole text as unchanged lines once
expanded. Only a file whose gaps open, or one that only moved, is offered;
a secret one never is, and one whose read is refused stays as it is and
says why.

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.

Project Deployment Actions Updated
luke-web Ready Ready Preview Oct 19, 2026 12:58pm UTC

Request Review

luke-agent Bot added a commit that referenced this pull request Oct 19, 2026
Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
A pure rename's note offers its lines directly, read only on the press.

Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
dastratakos and others added 5 commits October 19, 2026 04:53
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>
…-file

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>

# Conflicts:
#	packages/panel/src/tasks/agent-changes-tab.test.ts
#	packages/panel/src/tasks/agent-changes-tab.tsx
Base automatically changed from luke/files-changed-header-actions to main October 19, 2026 10:49
Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>

# Conflicts:
#	packages/panel/src/tasks/agent-changes-tab.tsx
@luke-agent
luke-agent Bot marked this pull request as ready for review October 19, 2026 10:59
@luke-agent
luke-agent Bot enabled auto-merge October 19, 2026 10:59
devin-ai-integration[bot]

This comment was marked as resolved.

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

# Conflicts:
#	packages/panel/src/tasks/agent-changes-tab.tsx
…ts threads on them, and drop a stale whole read

- Two texts alike diff to no hunk, so a pure rename shown whole drew nothing:
  whole-diff.ts lays its lines out as one hunk of context; a file of no line
  keeps its notice.
- A file drawn whole places its review threads against every line of its
  texts rather than its patch's rows.
- A whole read of an earlier answer that lands after a refresh is dropped,
  rather than overwriting the files expanded since.

Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
@luke-agent
luke-agent Bot enabled auto-merge October 19, 2026 11:41
devin-ai-integration[bot]

This comment was marked as resolved.

dastratakos and others added 2 commits October 19, 2026 11:57
…read, and whole-diff's headers lead

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>
@luke-agent
luke-agent Bot enabled auto-merge October 19, 2026 12:04
@luke-agent
luke-agent Bot added this pull request to the merge queue Oct 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 19, 2026
Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>

# Conflicts:
#	packages/panel/src/diff-view/index.ts
#	packages/panel/src/tasks/agent-changes-tab.tsx
@luke-agent
luke-agent Bot enabled auto-merge October 19, 2026 12:25
@luke-agent
luke-agent Bot added this pull request to the merge queue Oct 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 19, 2026
Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>

# Conflicts:
#	packages/panel/src/tasks/agent-changes-tab.tsx
@luke-agent
luke-agent Bot enabled auto-merge October 19, 2026 12:55
@luke-agent
luke-agent Bot added this pull request to the merge queue Oct 19, 2026
Merged via the queue into main with commit f4fd2bc Oct 19, 2026
11 checks passed
@luke-agent
luke-agent Bot deleted the luke/files-changed-whole-file branch October 19, 2026 13:07

This branch was successfully deployed

1 active deployment
Preview — b3d1aa70 Deployed Oct 19, 2026 by vercel[bot]
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