Repository navigation
Conversation
|
Thanks for this, @aakhter, and sorry it sat while the rail stack went in. This extends the hollow-pane PageUp/PageDown fallback to Codex through a new I ran this PR's
Each one is a few lines in One thing I couldn't check here: the installed Codex is 0.147.0, so I couldn't reproduce the alt-screen Codex you measured on 0.157.1 and 0.160. If you know which Codex version started drawing on the alt screen, a line about it in the invariants paragraph would help whoever reads it next. #525 and #526 just shipped in 1.35.0, so this is next in line, and it still merges cleanly onto master. |
|
Thanks for running it side by side with master; that made each of these easy to reproduce. All four are in a new commit on top (8d6e578), rebased onto 1.35.0, each with its own case in
Codex version. I can't pin down when Codex started drawing on the alt screen. It was seen on 0.157.1 locally and on 0.160 over a remote session, and your 0.147.0 draws inline. Nothing in between has been checked, so the invariants paragraph now says exactly that, without naming a cutoff. Each new case fails without its guard. Typecheck, lint, format, the frontend checks, the catalogue check and the touched test files all pass. It's still a draft only because GitHub won't let my account mark PRs ready; it's ready for review. |
17fb7f8 to
8d6e578
Compare
|
Independent confirmation of the cause on a second install, in case it helps the review. With codex-cli 0.160.1 running under a Codeman session, the pane shows tmux I had a smaller branch that only allowed |
|
@aakhter, sorry this one sat again. All four items from my review are in and I have nothing more on them, but 1.40.0 landed underneath it, so it needs a rebase before I can merge it. It now conflicts in 1. opencode pages too now. #555 (Randalix) added opencode to the hollow check, since it draws on the alternate screen and ignores SGR wheel reports like Codex (master's 2. Tiles page through shared helpers. The tile grid moved the paging math into two pure helpers on 3. The dialog check has to use the pane's own session. GitHub won't let you mark it ready, so I'll do that on my side once the rebase is up. With those three in, I'll merge it, and it closes #508 as well (Codex hybrid sessions losing wheel and touch scrolling), so feel free to add a |
…om the first wheel event Two changes to the last-resort page-key scroll (_maybePageCliTranscript), the path a wheel or touch gesture takes when it is not forwarded to the CLI and the local xterm buffer has no history (normal buffer, baseY 0). Codex now takes that path too. Newer codex draws on tmux's alternate screen, which the full strip hides from xterm, so a codex pane is as hollow as a repaint-mode Claude pane and the wheel did nothing. Codex still ignores SGR wheel reports and is still never forwarded the wheel; this sends plain PageUp/PageDown keys, which codex does page its transcript on (measured on 0.157.1 locally and 0.160 over a remote session). Which modes may page is a new registry capability, capabilities.transcriptPageKeys (claude and codex in stock.ts), published to the page as window.__codemanTranscriptPageKeys, so terminal-ui.js holds no CLI id for it. The first event of a gesture now pages at once. The fallback used to send a key only after half a screen of accumulated travel (19 rows, about 475px on a 38-row pane), so an ordinary trackpad flick sent nothing. The skipped travel is owed back by the rest of the gesture, keeping one page per half screen; a pause of more than 150 ms, a direction change or a tab switch starts a new gesture.
…el notches and dialogs Review follow-up for the hollow-pane PageUp/PageDown fallback (_maybePageCliTranscript): - A mostly horizontal wheel swipe (both deltas present, |deltaX| > |deltaY|) is consumed without paging. The touch path already locks its axis. - A pinch (wheel events with ctrlKey, as Chrome reports one) is consumed without paging. - Only a trackpad-sized opening event (under 2 rows) pages at once. A wheel notch (100 px, 4 rows) accumulates toward half a screen as before, so five slow notches send one PageUp again instead of five. A debt from a pre-paid page still dies with its gesture; plain wheel travel carries across notches. - Nothing pages while the active tab's alert is 'action' (a pending permission_prompt or elicitation_dialog), so a page key never reaches an open dialog's selector. Docs: the invariants paragraph now says which Codex versions were seen drawing on the alt screen (0.157.1, 0.160) and that 0.147.0 still draws inline, without claiming a cutoff.
…opencode Review follow-up after the rebase onto 1.40.0, where tiles began paging a hollow buffer through the shared CodemanTerminalInput helpers and opencode joined the hollow check (Ark0N#555). - opencode declares transcriptPageKeys in stock.ts, so the paging list read by both panes is claude, codex and opencode. Without it, reading the capability instead of the old id check would have turned opencode paging off again. The stock-set and render tests name it. - The gesture rules (first trackpad-sized event pages at once and is owed back, wheel notches accumulate, a pre-paid debt dies with its gesture, pinch and mostly horizontal swipes are consumed without paging) move out of the primary pane into the pure CodemanTerminalInput.pageKeysForGesture. The primary pane and TerminalTile both call it with their own state, so a Codex or opencode tile pages exactly like the main pane. - The dialog check stays per pane: the primary pane reads tabAlerts for the active session, a tile for its own sessionId, so a wheel over a tile never pages into that session's permission prompt while the focused tab is clear, and a tile is not blocked by a dialog in another tab. Tests: pure helper cases in terminal-scroll-routing, tile cases for Codex paging, first-event paging, notch accumulation, pinch and swipe, byte parity with the primary pane over a mixed sequence, and the per-session dialog check in both directions.
8d6e578 to
d7198dd
Compare
|
Thanks for the careful review, and for pointing out exactly what moved underneath it. It's rebased onto 1.40.0 now, with the review fixes in one new commit on top (d7198dd):
The description now has Thanks again! |
Conflicts resolved by keeping both sides: - terminal-ui.js: master's wheelDeltaWholeLines/sgrWheelReports next to this branch's pageKeyRows/pageKeysForGesture. - terminal-tile.js: master's tile SGR wheel forwarding and Shift+wheel local scroll (_shiftScrollPending) kept; tile paging stays on the shared pageKeysForGesture state (_pageKeyGesture) with its per-tile dialog check. - architecture-invariants.md: this branch's hollow-paging paragraph, with master's tile SGR forwarding and Shift+wheel sentences replacing the old "do not forward SGR wheel" note. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks again @aakhter, and thanks for turning both review rounds around so carefully. This PR lets a hollow Codex pane (alternate screen, no local history) page its transcript with PageUp/PageDown from the wheel and touch, moves the paging mode list into the CLI registry as Everything from the earlier rounds is in and correct: opencode keeps paging, tiles use the shared helper on their own state, the dialog check reads each pane's own session, and Codex still never gets SGR wheel reports. Typecheck, lint, format, the frontend checks, the catalogue check and the touched test files all pass here. One regression needs fixing before merge, on the phone path that #508 is about:
Smaller things, ideally in the same push:
I'll re-wrap the one 127-character comment line at With item 1 (plus 3 and 4 if you have a minute) pushed, I'll merge this and it closes #508. |
…cks and wobble Review of Ark0N#527 (Ark0N, 2026-10-11): 1. A slow touch drag paged a full screen per line. touchmove calls the fallback once per whole cell, so a slow drag's calls were further apart than the 150 ms gesture gap and each pre-paid a page (12 lines at 170 ms sent 12 PageUps). The touch paths now tag every call, touchmove and momentum frames alike, with a per-contact touchId (incremented on touchstart), and pageKeysForGesture never splits a contact by time; a new contact is a new gesture. 2. A pre-paid debt now survives up to PAGE_KEY_DEBT_MS (1 s) of quiet when the next event goes the same way, so slow small wheel ticks (40 px every 250 ms, a Firefox 1-line notch) pay it back instead of each pre-paying. A reversal inside the gap (or inside one contact) drops the debt and accumulates without pre-paying, so a +/-3 px wobble no longer pages back and forth. A reversal after the gap still pages at once. Main pane and tiles share the helper, so both get it. 3. A wheel consumed by the dialog check now logs page-keys-dialog-open. 4. The Dashboard wiki names newer Codex beside OpenCode; the invariants paragraph describes the new gesture boundaries. Tests: unit regressions through the real _maybePageCliTranscript, helper cases, tile/main parity for ticks and wobble, and a Chromium test that drives the real initTerminal touch listeners (12 PageUps before, 1 after).
pageKeysForGesture kept `prepaid` set after the travel had fully repaid a
pre-paid page, so the one-second debt lifetime still applied: on a 38-row
pane, 19 lines of -1 at 32 ms left { pending: 0, prepaid: true } and a -1
300 ms later sent nothing. `prepaid` now clears as soon as the pending
travel reaches or crosses zero, so the leftover is plain travel and the
150 ms gap applies again. Touch contacts are unaffected (never split by
time). The mixed parity step's reversal grows from 20 to 25 rows because
the -5 rows left after repayment are now plain travel and cancel against it.
"keeps terminal touch drag available for scrollback with the visible textarea enabled" built a Codex session on a blank terminal. With Codex in transcriptPageKeys that pane is hollow, so the drag is correctly consumed by the page-key fallback and never reaches scrollLines; the fixture no longer described local scrollback. The case now writes 200 lines into xterm (awaiting the write), turns the visible CJK textarea on explicitly, and asserts the scenario before the drag: normal buffer, baseY > 0, viewport at the bottom, not hollow, wheel forwarding off, cjk-input-visible set. A real touch drag back into history must then call scrollLines with negative lines, move the viewport up, and send nothing to the CLI. Hollow Codex paging stays covered by terminal-touch-paging.browser.test.ts.
…cks and wobble Review of Ark0N#527 (Ark0N, 2026-10-11): 1. A slow touch drag paged a full screen per line. touchmove calls the fallback once per whole cell, so a slow drag's calls were further apart than the 150 ms gesture gap and each pre-paid a page (12 lines at 170 ms sent 12 PageUps). The touch paths now tag every call, touchmove and momentum frames alike, with a per-contact touchId (incremented on touchstart), and pageKeysForGesture never splits a contact by time; a new contact is a new gesture. 2. A pre-paid debt now survives up to PAGE_KEY_DEBT_MS (1 s) of quiet when the next event goes the same way, so slow small wheel ticks (40 px every 250 ms, a Firefox 1-line notch) pay it back instead of each pre-paying. A reversal inside the gap (or inside one contact) drops the debt and accumulates without pre-paying, so a +/-3 px wobble no longer pages back and forth. A reversal after the gap still pages at once. Main pane and tiles share the helper, so both get it. 3. A wheel consumed by the dialog check now logs page-keys-dialog-open. 4. The Dashboard wiki names newer Codex beside OpenCode; the invariants paragraph describes the new gesture boundaries. Tests: unit regressions through the real _maybePageCliTranscript, helper cases, tile/main parity for ticks and wobble, and a Chromium test that drives the real initTerminal touch listeners (12 PageUps before, 1 after). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bb52a8d to
dd7774f
Compare
|
Thanks, all four are in (head
I left the 127-character line at Typecheck, lint, format, the frontend, public-asset and browser-exclude checks, and the build all pass. The scroll-routing, tile-scroll and both no-id-branching test files pass (114 tests), and so do the two browser files. |
Fixes #508
This changes the last-resort page-key scroll in
_maybePageCliTranscriptand its tile twinTerminalTile._maybePageCliTranscript. That path runs when a wheel or touch gesture is not forwarded to the CLI and the local xterm buffer holds no history (normal buffer,baseY === 0, or a tile's discountedlocalRows). It sends plain PageUp/PageDown keys so the CLI pages its own transcript.This is not SGR wheel forwarding. Codex and opencode still ignore SGR wheel reports (#227, #555), their
wheelForwardstaysnever, and_shouldForwardWheelToAppis unchanged.Codex can use the page-key fallback, and the paging list is registry data. Newer Codex draws on tmux's alternate screen, and the full strip hides that from xterm, so a Codex pane has no local scrollback, just like a repaint-mode Claude pane or an opencode pane. Scrolling the wheel over it did nothing (Codex 0.159.1 hybrid sessions lose wheel/touch scrolling, leaving mobile without transcript navigation #508).
baseY > 0), so the guard never fires for it.capabilities.transcriptPageKeys(an optional boolean in the schema), set for claude, codex and opencode instock.ts. opencode keeps the paging fix(terminal): opencode — a drag selects text again, and the wheel pages the transcript #555 gave it.window.__codemanTranscriptPageKeys, also in/session/:idwindows, soterminal-ui.jsholds no CLI id for it. Themode !== 'claude' && mode !== 'opencode'check in_localScrollbackIsHollow(target)is gone; thetargetform tiles use is kept.Gesture handling, shared by the main pane and tiles. The rules live in one pure helper,
CodemanTerminalInput.pageKeysForGesture(state, ev, lines, rows, now), next towheelDeltaLinesandpageKeysForTravel. The main pane and everyTerminalTile(grid tiles and the split's Pane B) call it with their own state, so a Codex or opencode tile pages exactly like the main pane.ctrlKeywheel events) and a mostly horizontal swipe (both deltas present,|deltaX| > |deltaY|) are consumed without paging.Nothing pages into an open dialog, checked per pane. While a session's tab alert is
'action'(a pending permission prompt or question), a wheel over its pane is consumed without sending a key. The main pane checks the active session; a tile checks its ownsessionId, so a tile over a session with a pending prompt does not page while the focused tab is clear, and a clear tile still pages while another tab has a dialog. The main pane logs a consumed dialog gesture aspage-keys-dialog-open, so the routing decision remains visible.Tests.
test/terminal-scroll-routing.test.ts: the pure helper (first-event page and repayment, notch accumulation, debt reset, direction change and jitter, pinch and swipe, the batch cap); Codex pages only while hollow; opencode keeps paging; gesture reset; tab isolation; the active session's dialog blocks, another tab's does not; modes come only from the injected map; the main pane's state matches the helper over a mixed sequence.test/terminal-tile-scroll.test.ts: a Codex tile pages; first-event paging, notch accumulation, pinch and swipe in a tile; byte-for-byte parity with the main pane over a mixed gesture sequence; the dialog check reads the tile's session in both directions.test/terminal-touch-paging.browser.test.ts: real Chromium touch listeners and the key coalescer; slow whole-cell movement, momentum retaining the same contact ID, and immediate paging on a new contact. Unit tests also cover contact boundaries, 40-line drags, small pixel/line wheel ticks, debt repayment and expiry, rapid reversals, and dialog logging.test/mobile/keyboard.test.ts: the local-scrollback touch case now writes real xterm history, asserts a visible textarea and a non-hollow normal buffer, then verifies that a real touch drag moves the viewport and sends no keys to the CLI.test/cli-registry-schema.test.ts: the capability's shape, and exactly claude, codex and opencode set in stock.test/render-index-html.test.ts: injection in the main page and the solo window.docs/architecture-invariants.mddescribes the gesture rules, and the Dashboard manual now includes newer Codex alongside OpenCode in its wheel and swipe paging guidance.Validation of the review fixes: typecheck, lint, formatting, lockfile, frontend/assets, browser exclusions, catalogue and build checks pass, as do 259 targeted tests, the three touch/tile browser tests, and the corrected mobile scrollback case. The wider mobile keyboard file still has five failures also reproduced on upstream
aa3730aa; those are not claimed fixed here.One trade-off: small trackpad gestures now send a key where they used to send nothing, for Claude and opencode as well. The dialog check covers permission prompts and questions; a CLI menu with no hook behind it (for example a slash-command picker) could still react to PageUp, which is the caveat this fallback already carried.