Skip to content

Unfold or fold every file of the Code tab from one row - #74

Merged
krishhgg merged 12 commits into
masterfrom
t3term/pull-request-fold-all
Oct 18, 2026
Merged

krishhgg merged 12 commits into
masterfrom
t3term/pull-request-fold-all

Conversation

@krishhgg

@krishhgg krishhgg commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Adds the desktop's Expand all files and Collapse all files button to the Code tab, as a row under the count.

  • The row reads ⇊ Expand all files while every file is folded, and ⇈ Collapse all files once any file shows unfolded. Enter or a click unfolds every file or folds them all, and the status line says Enter expand all files or Enter collapse all files.
  • The tab now keeps one fold for every file plus the files the reader folded or unfolded on their own, as the desktop does. Expand all sets that fold and forgets each file's own, so files from a later slice show unfolded too. A file folded after keeps its fold through a read again, and another diff picked from the commits shows its files folded.
  • The row shows once the tab has files, after the count and its notes, and before the list of conversations off the diff.
  • docs/pull-request-panel.md gains a Fold all row, and its known limits no longer list fold-all. The README names the row among the Code tab's keys and clicks.
  • The Code recipe folds and unfolds every file with Enter and with a click, keeps a file folded after through a refresh, has the second slice follow the row, and checks that a picked commit starts folded. The row adds a stop for ↓, so the recipe counts the toolbar's rows in TB (7712fa5).

Stacked on #73.

The Code tab of #7 with every file folded. Under 8 files · 3 / 8 viewed and the yellow note that the host withheld part of the diff, the row ⇊ Expand all files is chosen, and the status line reads Enter expand all files.

After Enter: the row reads ⇈ Collapse all files and stays chosen, assets/config-flow.png says it is a binary file, and src/config/reader.rs shows its numbered lines with removals in red and additions in green. The status line reads Enter collapse all files.

Both come from the fixture server, with #7's invented diff at 120x40. r refresh leaves the second status line because Enter collapse all files is two characters longer and the line has no room for it, as the status line already drops r first.

Decision log

What I noticed. docs/pull-request-panel.md listed the desktop's fold-all toggle among what the Code tab lacked. Reading a change file by file meant one Enter per file.

How I confirmed it. In the pinned T3 source (f570bd2):

  • The toolbar's button says Expand all files while every file is collapsed and Collapse all files otherwise (apps/web/src/components/pullRequest/PullRequestCodeTab.tsx:1239-1258). "Every file is collapsed" is areAllDiffFilesCollapsed, which is false for no files (apps/web/src/lib/diffCollapse.ts).
  • The fold state is an override of expanded, folded or none, on top of the diffFilesCollapsed setting, plus the keys of files toggled apart from it, both held in the tab's own state (PullRequestCodeTab.tsx:225-232, pullRequestDiff.logic.ts:25-50). toggleAllFiles sets the override and clears the toggled keys (PullRequestCodeTab.tsx:675-681), so a file that arrives later follows the override.
  • A new scope, such as a commit picked from the list, clears both (268-277).

Options.

  • Chosen: a row under the count and its notes, since t3term's controls are rows that ↑, ↓ and a click choose. Rejected: a key alone, which the status line can only offer while some row is chosen and which a reader wouldn't find. Rejected: putting it on the scope row, since Pick a commit on the Code tab to read its own diff #70 kept one control to a row.
  • Chosen: one fold for every file plus the files toggled apart from it, as the desktop keeps them. Rejected: unfolding the files shown by adding each path to the set, which would leave a file from a later slice folded after Expand all.
  • Chosen: ⇊ and ⇈ before the words, as the desktop puts chevrons on the button, so the row reads as a control and not as a note.

What review changed.

  • 21 mutations of the new code: 19 failed a test. A grey row survived, and the new test now checks the row's color. Dropping the check that the tab has files from all_folded survived too, since the row and Enter both need files first, so that check is gone.
  • Greptile reviewed the 7 files and added no comments.

f7866d8 merges #73 at dd84318, which brings #66's fix for a hunk that removes nothing at the highest line number (8073497) and its test. That test read the file's header at a fixed row, and the Expand all row moves it down, so f4d6ccc finds the header by its text.

ed13d8b and ce3e374 merge #73 at 8b26331 and e92d45f, which bring #72's fix that counts each Enter on a run while the file's text is read and the fixes that lay a thread's comments and its loaded pages out again when the theme changes (#68's ad1590c and #69's 942dad5).

Known limits.

  • The fold isn't saved. The desktop's override lives in the tab too and goes when it unmounts, and the diffFilesCollapsed setting that picks the first fold isn't read, so files always start folded.
  • Expand all lays out every file at once. 3,000 files of 200,000 lines took 0.2 seconds on an Apple M5 in a release build, then 20 milliseconds each time the details are laid out again.
  • The Code tab still lacks the toolbar's whitespace, split view and wrap toggles and the file tree.

Tests

  • code/tests.rs: no row before a slice comes or with no files, the row's label and action as files fold and unfold, the row in the text's color, Expand all and Collapse all, a file folded after keeping its fold, a later slice's file following Expand all, every file folded one at a time offering Expand all again, a read again keeping the fold, a commit's diff starting folded, and the row wrapping whole at 8 columns. Every test that compares the tab's rows has the row.
  • pull_requests.rs: ↓ choosing the row first, Enter unfolding and folding every file with the row still chosen and nothing read, and a click doing the same.
  • mod.rs: the status line saying Enter expand all files with the row chosen.
  • On f4d6ccc, fmt, clippy and all 869 tests pass (788 lib, 2 main, 31 CLI, 48 RPC). The Code recipe passes on f4d6ccc's build and fails on Show which files of a pull request the reader marked viewed #73's (dd84318) at recipe line 24, the first wait for the ⇊ Expand all files row.
  • On ce3e374, fmt, clippy and all 871 tests pass (790 lib, 2 main, 31 CLI, 48 RPC), and the Code recipe passes on its build.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

Adds one row to expand or collapse every file on the Code tab.

  • The Code tab folds or unfolds every file from one row.

No actionable issues found.

Reviews (5) · Last reviewed commit: "Merge the viewed-files branch at e92d45f..." · Reviewed by Greptile

krishhgg and others added 2 commits October 15, 2026 06:46
The row under the count reads Expand all files while every file is
folded and Collapse all files once any shows unfolded, as the desktop's
toolbar button does. It sets one fold for every file and forgets each
file's own, so files from later slices follow it, and another diff
picked starts folded again.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Mutations showed the row could turn grey unnoticed, and that all_folded's
check for no files never changes what shows: the row and Enter both need
files first.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
krishhgg and others added 8 commits October 17, 2026 14:04
…7e50cd

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… again after a theme change

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… page recipe

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…043b63 and the fixes and recipes under it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The row under the count pushes each file down one row and adds a stop for ↓,
so the recipe counts the toolbar's rows in TB. The new section folds and
unfolds every file with Enter and with a click, keeps a file folded after
through a refresh, has the second slice follow the row, and checks that a
picked commit starts folded. It also takes #70's viewed-fail race fix from
the viewed-files branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ds fail from its first open in the Code recipe

The fold-all branch already held the same change, so the tree stays as it was.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ine count at the highest line number

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…'s rows

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@krishhgg

Copy link
Copy Markdown
Owner Author

PASS+NOTES for head f4d6ccc6a1c3d41fa91301a994462a7e77d7d2ad, patch id 431b1c35b75771ac37daeff916667de4e74e62f5.
Verifier: GPT-6.1 Sol (xhigh), not the author.
Base dd843188f25bab9e4e95443f76af5a6681580451, the parent layer. Scenario links, 100x30 and 80x24, truecolor. Round 1.

Claim Base Head
Open Code and choose the fold row by keyboard or click Row absent; new recipe fails at line 24 Correct labels and actions at 100x30 and 80x24; Enter and click fold or unfold every file
Fold one file after Expand all, then read again Individual folds only That file stays folded; other files stay unfolded
Read another slice after Expand all, then choose a commit No global fold override Later files follow Expand all; a picked commit starts folded
Toggle the new control after all slices are loaded No control No additional RPC or HTTP diff request

Regression sweep: 13 of 13 recipes passed on both the parent and head. The parent sweep reuses the run for the identical dd84318 binary and recipes in /tmp/t3v-verdict/73/round1/smoke-head-run/. All 12 other recipes have the same rpcRequestsByTag on the paired builds. Captures match after accounting for fixture ports, run IDs, clocks and spinners. Master's sweep is 11 of 13 on each build, with the two baseline failures described under Notes.
Rules: all runs passed doctor and their checks after t3v stop. Completed positive recipes also passed check while live, before cleanup. Summary issued no diff or viewed read. Toggling the new controls added no RPC or HTTP diff request. Unchanged recipe counters and normalized screens are in sweep-comparison/ and final-comparison.json.

Tests: independent cargo test --locked passed 869 tests. CI on this head passed macOS, E2E smoke (macOS), Linux build and Greptile.
Revert controls: removing the fold-all action makes its test fail. Replacing start.saturating_add(1) with start + 1 makes a_hunk_that_removes_nothing_after_the_highest_line_unfolds panic on overflow, so the updated header lookup still catches #66. Greptile has no review threads or new finding.

Findings: no new product finding.

Notes: Master 7ae927b recipes were also run against both binaries. Its CLI recipe stops at launch, which neither stack revision implements, and its Code recipe predates the changes in the earlier Code layers. These failures occur on the parent too. The changed Code feature file is present in each head. Its other 11 recipes are covered by the comparison above.
The pinned desktop source f570bd21663f56ce94c41829d3b7d72886e25a34 was fetched read-only from pingdotgg/t3code and inspected. The stock fixture always uses host-backed viewed marks and has no over-budget whitespace hunk; environment-backed marks, absent capability, bounds and budget cases were covered by the passing unit tests.

Binary driven LC_UUID
dd843188f25bab9e4e95443f76af5a6681580451 2878EF61-5E44-3792-A62D-7791FCC72226
f4d6ccc6a1c3d41fa91301a994462a7e77d7d2ad 0E61109F-29A9-3880-B6F7-495CC0B62ED8

Binaries are /tmp/t3v-bin/<sha>/t3term. The parent cache was reused; each missing head build printed Compiling t3term. Verification used stock t3v from master 7ae927b, with each revision's own recipes for its sweep and the head recipe for the parent negative control.

Evidence: /tmp/t3v-verdict/74/round1/. controls-base/ and controls-head-final/ contain the paired size checks; identity.json records the commits, patch id, paths and UUIDs. Rendered captures were inspected.

krishhgg added a commit that referenced this pull request Oct 18, 2026
The trip that reads no marks has to come back within 15 s of their
first read. The whitespace steps sat inside that span, and on a macOS
runner on CI the trip came back after 19 s, so t3term read the marks
again and the recipe failed at its check on #76, #77 and #79. The trip
now comes right after the second slice, as on #73 and #74, and a
gotcha keeps later steps out of the span.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
krishhgg and others added 2 commits October 18, 2026 06:01
…a run while the file's text is read and brings #68's fix that lays review threads out again when the theme changes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…comments out again when the theme changes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@krishhgg

Copy link
Copy Markdown
Owner Author

PASS+NOTES for head ce3e374939e3a1d94580596435286c2d215f3604, patch id 30586a04cb16882c719ffcdaa51aacbeed2de435.
Verifier: GPT-6.1 Sol (xhigh), not the author. Base e92d45f8f3e2549515c39b9847b7f9e1ba13f490, the named parent layer. Scenario links, 100x30 and 80x24, truecolor. Round 2.

Claim Base Head
Choose the fold-all row with the keyboard or a click Row absent; the head recipe fails at its first fold-all wait Enter and clicks expand and collapse every file at both sizes, with the correct label and action
Fold one file after Expand all, then refresh Individual folds only That file stays folded while the others remain unfolded
Read another slice after Expand all, then choose a commit No global override Later files follow Expand all; another commit starts folded
Toggle the fold-all row after both slices are loaded No global control No additional RPC or HTTP diff request

Regression sweep: 13/13 own recipes passed on the parent and head. The parent run reuses the identical binary and recipes under /tmp/t3v-verdict/73/round2/own-smoke-head/. All 12 other recipes have the same rpcRequestsByTag. Compared 94 own-recipe capture pairs and 71 master-recipe pairs. No unexplained screen difference remains after matching fixture ports, clocks and spinners and letting delayed reads finish. The full five-minute live-refresh and idle checks passed.

Rules: every positive drive and recipe passed its live check and its check after t3v stop. Negative controls and failed attempts were stopped and passed their after-stop checks. No scope, fixture, screen, control or secret rule failed. The focused controls at 100x30 and 80x24 added no RPC or HTTP diff request once both slices were loaded.

Patch review: compared the source additions and deletions against round 1's parent dd84318 and head f4d6ccc. They match exactly. The inherited Unchanged lines feature description retains #72's new wording beside this layer's Fold all description. This layer's Code recipe passes, and its parent negative control stops at the first fold-all wait.

CI: macOS, E2E smoke (macOS), Linux build and Greptile all passed on this exact head. Greptile has no review thread or new finding. The Code feature file is updated.

Findings: no new product finding.

Notes: a connection capture caught the feed just before its reconnect word drew, while the thread already showed the protocol error. Repeating the same recipe on both builds gives identical captures and RPC counts. A Summary capture also caught the conversation's delayed reviewer rows at different times; fresh paired settled captures and requests match. See connection-repeat-base, connection-repeat-head, settled-reviewers-head-v3 and the paired settled run under #73.

Master c250a7510b9d6ee71b635fd8ea6f9fa793f72fbe passed 11/13 recipes on both sides. Its features/cli.md:32 requests launch, which these stack revisions do not implement. Its old features/pull-request-code.md:39 and :41 wait for files pushed below the viewport by the earlier Code layers and this layer's toolbar. The failures occur on the parent too. The branch's own feature file has the updated steps and passes. These are baseline recipe limits, not new product findings.

Binary driven LC_UUID
/tmp/t3v-bin/e92d45f8f3e2549515c39b9847b7f9e1ba13f490/t3term 5B656748-E5FE-31BF-B25E-878C3F1AD399
/tmp/t3v-bin/ce3e374939e3a1d94580596435286c2d215f3604/t3term 9C6D7C6E-5B76-3B34-B9FA-896755F83597

Every newly built head printed Compiling t3term. The same cached parent binary was reused. Verification used t3v from the pinned master above, which includes the build-race fix, with each revision's own recipes and master's recipes. Rendered captures at both sizes were inspected.

Evidence: /tmp/t3v-verdict/74/round2/, especially own-smoke-head, master-smoke-head, head-recipe-on-base, controls-base-*, controls-head-*, sweep-comparison, source-edits-delta.diff and the settled runs named above. All servers and data were invented and local. No PR, source branch or main-checkout file was changed.

@krishhgg
krishhgg changed the base branch from t3term/pull-request-viewed-files to master October 18, 2026 19:17
@krishhgg
krishhgg merged commit 7b0f9b5 into master Oct 18, 2026
4 checks passed
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