Skip to content

Stop the Code tab's lines wrapping, and scroll them sideways - #76

Merged
krishhgg merged 18 commits into
masterfrom
t3term/pull-request-wrap
Oct 18, 2026
Merged

krishhgg merged 18 commits into
masterfrom
t3term/pull-request-wrap

Conversation

@krishhgg

@krishhgg krishhgg commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Adds a row to the Code tab that stops its lines wrapping, as the desktop's wrap toggle does, and lets the reader scroll those lines sideways.

  • ↵ Disable line wrapping sits under the fold row once the tab has files. Enter or a click lets each line run on in one row, and the row then reads ↵ Enable line wrapping. A read again and another diff picked from the commits keep the choice. The status line says Enter disable line wrapping or Enter enable line wrapping.
  • While the lines don't wrap, Shift+→ or L scrolls their text half the details' width to the right, and Shift+← or H scrolls it back. A sideways turn of the wheel scrolls it 4 columns, in a terminal that reports one. The line numbers and marks stay put, and the headers, notes and review threads don't move. The text stops once the end of the widest line shows, and starts again at the left for another diff and when the details open again.
  • The status line offers H/L sideways while a line runs past the details. On the other tabs, Shift+← and Shift+→ still act as ← and →.
  • The status line now draws after the details, so it describes the frame drawn rather than the one before.
  • docs/pull-request-panel.md gains a Wrap row and the README names the row, the keys and the wheel.
  • The Code recipe unwraps reader.rs's long line, scrolls it with L, H and the shifted arrows to its end and back, and checks that Esc with Alt+B and a refresh keep the scroll while the details opened again from the list start at the left. A picked commit keeps the lines unwrapped and Pick a commit on the Code tab to read its own diff #70 starts wrapped (6e4f715).

Stacked on #75.

The details dialog on #7's Code tab with src/config/reader.rs unfolded and the row ↵ Disable line wrapping chosen. Lines 25 to 27 wrap onto a second row under their text. The status line reads Enter disable line wrapping.

After Enter, the row reads ↵ Enable line wrapping. Each line takes one row and is cut at the dialog's edge, so line 33 reads // A reload reads and checks the file a.

After L, the text of each line has moved 26 columns to the left while the numbers and marks stay, so line 25 reads 25 Result Config, Error and line 33 reads 33 + and checks the file as a load does, so a file e.

After four more presses of L, line 33 ends with since the last load can't skip the schema check. at the dialog's right edge, and the text goes no further.

All four come from the fixture server at 120x48, where the details show as a dialog. The fixture's reader.rs gains a long comment line so the dialog has something to scroll.

Decision log

What I noticed. docs/pull-request-panel.md listed the desktop's wrap toggle among what the Code tab lacked. t3term always wrapped, so a long line split across rows and a reader couldn't see its shape or line it up with the lines around it.

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

  • wordWrap is a client setting that defaults to true (packages/contracts/src/settings.ts:506). The Code tab copies it into its own state (apps/web/src/components/pullRequest/PullRequestCodeTab.tsx:235), so another diff picked keeps the choice.
  • The toggle says Disable line wrapping or Enable line wrapping (PullRequestCodeTab.tsx:1279-1298) and sets @pierre/diffs' overflow to wrap or scroll (874).
  • pierre 1.5.2 wraps with pre-wrap and break-word. With overflow: scroll, each file scrolls sideways on its own under its own scrollbar, and [data-overflow=scroll] [data-gutter]{position:sticky} keeps the numbers in place.

Options.

  • Chosen: one sideways offset for every file. Rejected: an offset per file, as pierre has. A terminal has no scrollbar per file to drag, so the reader would need a way to pick which file a key scrolls, and the files would drift out of line with each other.
  • Chosen: Shift+←/→ and H/L, with Shift+arrows only on the Code tab. ←/→ and h/l already move between tabs, so the shifted keys scroll in the same directions. On the other tabs, Shift+arrows act as plain arrows, as they did before.
  • Chosen: half the details' width per key and 4 columns, a tab stop, per wheel turn. A whole width leaves no text in view from before the step, and a few columns per key take many presses to cross a long line. A trackpad sends many turns per swipe, so its step is small.
  • Chosen: lay the lines out once, unwrapped, and cut only the rows in view at each frame. Rejected: laying the files out again at each offset. Cutting 48 rows 2,000 characters long took 0.88 ms a frame, and a scroll builds nothing.
  • Chosen: draw the status line after the details. The H/L sideways hint depends on whether the frame's lines run past the details, which the frame decides. Drawn first, it described the frame before, and an idle TUI might never draw again to correct it.

What review changed.

  • A mutation pass changed code.rs, pull_requests.rs, details.rs and mod.rs in 48 ways, and the tests caught 40.
    • One survivor drew the status line twice, before and after the details, so the later draw hid it. Done properly, by moving the draw, the mod.rs test catches it.
    • One dropped the wrap from the check of whether a file's rows can be reused. The toggle already lays every file out again, as the whitespace toggle does, so the check is gone.
    • Five are now caught by new checks: the widest row taken across files rather than the last file's, a step of one column on a page one column wide, a frame of another link's details not limiting the scroll, a row exactly the page's width not scrolling, and a commit opened from the Timeline starting at the left.
    • The last resets the offset when the TUI follows another thread. That can't fail a test, since the details only show again through the toggle, which resets it too. It stays so follow resets the offset along with the scroll.
  • Hide whitespace changes on the Code tab, with a row that shows them #75's fix for Greptile's finding there is merged in.

a634a86 and ef9e2ca merge #75 at 15bb2da and 3036809, which bring #66's fix for a hunk that removes nothing at the highest line number (8073497) and its test, with the same patch.

bc9fb2d merges #75 at d9fd767, which returns from the Timeline before its whitespace steps, with the same patch.

b916980 and 044993f merge #75 at 7d8ecf8 and 49e292e, which bring #72's fix that counts each Enter on a run while the file's text is read, #75's test that no hunk is read once the whitespace steps run out, 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). On this branch lay_out also returns which rows scroll sideways, so the merges take three values in the new theme test, as for the other tests.

Known limits.

  • Lines wrap between any two characters, where the desktop breaks at a space where it can.
  • Every file scrolls by the same offset, with no scrollbar.
  • The wheel scrolls sideways only in a terminal that reports a sideways turn. Shift+arrows and H/L work everywhere.
  • The wordWrap setting isn't read, so the lines always start wrapped, and the choice isn't saved.
  • At 120 columns beside the sidebar, the status line has no room for H/L sideways while a row is chosen. The keys still work.
  • The Code tab still lacks the toolbar's split view and the file tree.

Tests

  • code/tests.rs: no row before a slice or with no files, the rows wrapped and unwrapped, the row's label, action and color both ways, its width at 8 columns, bodies laid out again after the toggle, and the runs of rows that scroll with their lead. Also: the runs split around review threads, a later slice joining them, the widest row across files, and the choice kept through a read again and a commit's diff.
  • pull_requests.rs: half-width steps and the clamp at the widest line, the wheel's 4 columns, the other tabs keeping the offset, a wider page scrolling back, a row exactly the page's width, a page one column wide, a frame of another link, and the resets for wrapping again, a commit picked, a commit opened from the Timeline and the details shown again. A row cut sideways keeps its lead and styles, and a wide character shows as spaces where the left edge cuts it and not at all where the right edge does.
  • mod.rs: Shift+arrows, H, L and the wheel in the pane and the dialog, Shift+arrows on the other tabs, and the status line offering H/L sideways on the first frame after the toggle and dropping it before the other keys when narrow.
  • On ef9e2ca, fmt, clippy and all 887 tests pass (806 lib, 2 main, 31 CLI, 48 RPC). The Code recipe passes on ef9e2ca's build and fails on Hide whitespace changes on the Code tab, with a row that shows them #75's (3036809) at recipe line 24, the first wait for the ↵ Disable line wrapping row. bc9fb2d changes only the Code recipe, which passes with it on ef9e2ca's build.
  • On 044993f, fmt, clippy and all 890 tests pass (809 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; no blocking issues were found.

Summary

Adds a wrap toggle and sideways scrolling to the Code tab.

  • The Code tab lets readers turn off wrapping and scroll long lines sideways.

No actionable new issues were found. No previous review threads were supplied.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Toggle wrapping] --> B[Clear cached file rows]
  B --> C[Lay out wrapped or unwrapped lines]
  D[Sideways key or wheel] --> E[Change sideways offset]
  C --> F[Clamp offset to widest line]
  E --> F
  F --> G[Cut visible text and keep numbers fixed]
  G --> H[Draw status hints]
Loading

Reviews (6) · Last reviewed commit: "Merge the whitespace branch at 49e292e, ..." · Reviewed by Greptile

krishhgg and others added 6 commits October 15, 2026 08:00
…sideways

The desktop's toolbar has a toggle that lets a diff's lines run on past
the edge, where its numbers stay while the code scrolls. A row under the
fold row now does that here: each line takes one row, and Shift+arrows,
H and L, and the wheel turned sideways scroll their text while the
numbers stay. The rows the tests compare gain the new row.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ows off other tabs

Shift+← and Shift+→ scroll sideways only on the Code tab and act as ← and → elsewhere,
as they did before. The status line draws after the details, so the first frame after
the wrap row offers H/L where the lines run past them.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A file's rows no longer note whether they wrap, since the toggle already lays every file
out again. Tests now check the widest row across files, a step on a page one column wide,
a frame of another link, a row exactly the page's width and a commit opened from the
Timeline.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@krishhgg
krishhgg marked this pull request as ready for review October 15, 2026 15:26
krishhgg and others added 10 commits October 17, 2026 14:05
…50cd

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

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

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

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

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The recipe unwraps reader.rs's long line, scrolls it with L, H and the shifted
arrows to its end and back, and checks that Esc with Alt+B and a refresh keep
the scroll while the details opened again from the list start at the left. A
picked commit keeps the lines unwrapped and #70 starts wrapped. TB counts the
third toolbar row.

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… in the boundary unfold test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ne before the whitespace steps

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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:04
…run while the file's text is read, tests that no hunk is read once the whitespace steps run out 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>
…mments out again when the theme changes

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

krishhgg commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner Author

PASS+NOTES for head 044993f15bfd829e0da8e28444418027cf87693a, patch id b293884b3c77f0e7995adcfa1e3b752750077e25.
Verifier: GPT-6.1 Sol (xhigh), not the author. Base 49e292eb61f04f9facd4595b5ebb94d8398ac21f. Scenario links, 100x30 and 80x24, truecolor. This verdict covers this layer against the requested parent head.

Claim Base Head
A row stops wrapping and keeps that choice across refreshes and picked commits No wrap row; lines still wrap after L Enter and a click toggle wrapping; refreshes and picked commits preserve it; a new link starts wrapped
L/H and shifted arrows scroll text while numbers, marks and other rows stay fixed L cannot scroll the wrapped diff Driven at 100x30 and 80x24, to the widest line's end and back; further L does not move it; a focused 34-column details pane clamps at the same end
Offset retention and resets follow the contract No sideways offset Esc and Alt+B preserve it; refresh preserves it; a picked commit, details reopened from the list and another link start at the left
Other tabs retain shifted-arrow navigation; the wheel moves four columns Original arrow navigation Shifted arrows still navigate other tabs; head's unit tests cover four-column wheel turns in the pane and dialog

manual-head-80-r7/ completes the extra hand drive, including another link, a picked commit, Esc, Alt+B, refresh and the narrow pane. manual-head-100-r3/ and the head Code recipe cover the 100x30 limits and resets. narrow-pane/right-limit.txt and right-limit-again.txt match. I inspected rendered PNGs at both sizes and at the narrow pane. t3v's click --button accepts only left, wheel-up and wheel-down, so it cannot send a sideways wheel turn. tests.log records a fresh compile and all 890 tests passing, including shift_and_the_arrows_h_l_and_the_wheel_scroll_the_codes_lines_sideways and the clamp tests.

Regression sweep: 13 of 13 own-checkout recipes pass on each side. Base evidence /tmp/t3v-verdict/75/round2/smoke-head; head evidence /tmp/t3v-verdict/76/smoke-head. The identical parent-head build and recipe run are reused as the next layer's base. The changed source files reach Code layout, review comments, details input and the status line; the sweep drives all mapped features. Matched link-list, Summary and Timeline captures are identical. Thread details differ only by the fake server's port. Other capture differences are elapsed ages, spinner phases, generated run paths, the reconnect attempt's current error, and a Summary capture before versus after the three-second conversation reply fills its reviewers. matched-comparison.json and sweep-capture-comparison.json retain the comparisons.

Rules: doctor and check pass in the focused drives and before and after stop in the sweeps. Matched steps send the same rpcRequestsByTag: one each of subscribeServerConfig, orchestration.subscribeShell, orchestration.subscribeThread, pullRequests.subscribeRefreshes, pullRequests.detail, pullRequests.activity, pullRequests.stack and pullRequests.filesViewed. Both read the same two HTTP diff slices. The matched drive adds no RPC cost; the feature recipes and unit tests also check that toggles read nothing.

CI: all four checks pass on this exact head, including macOS and E2E smoke. Greptile: no review threads; no new unanswered finding. The head updates .claude/skills/verify-t3term/features/pull-request-code.md.

Binary provenance: base /tmp/t3v-bin/49e292eb61f04f9facd4595b5ebb94d8398ac21f/t3term, LC_UUID 829C7A80-B290-39F4-A708-D8899FBEDCCB; head /tmp/t3v-bin/044993f15bfd829e0da8e28444418027cf87693a/t3term, LC_UUID 3928E993-ADD1-3443-9128-C8EEE9D4B8F4. The base cache was reused; each newly built head logged Compiling t3term. The builds use t3v from master c250a7510b9d6ee71b635fd8ea6f9fa793f72fbe. The separate CLI executable used by the local Cargo integration tests is /tmp/t3v-verdict/75/round2/test-target/debug/t3term, also built from this head, LC_UUID 5F59B099-87BC-3B8F-931C-78103E6E30E9.

Notes: master's current sweep is 11 of 13 on both sides, at /tmp/t3v-verdict/75/round2/master-smoke-head and /tmp/t3v-verdict/76/master-smoke-head. Its CLI recipe at .claude/skills/verify-t3term/features/cli.md:32 asks these older pinned builds for the later launch command. Its Code recipe at .claude/skills/verify-t3term/features/pull-request-code.md:39 expects the pre-stack count and loading layout, before the viewed count and toolbar rows. Both fail on base as well as head. The updated recipes in this stack pass; these shared master-recipe incompatibilities are not a regression in this layer. A merge with newer master still needs the integration recheck from the skill.

No new blocking findings. Evidence stays under the paths above. All owned runs were stopped and checked; no branch or PR code was changed.

@krishhgg
krishhgg changed the base branch from t3term/pull-request-whitespace to master October 18, 2026 19:47
@krishhgg
krishhgg merged commit 707824d 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