Repository navigation
feat(mobile): natural touch scrolling + explicit keyboard/cursor modes (FW6-TOUCH) - #95
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…cursor modes (owner-locked) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Frame-coalesced scroll messages are often 1-2 lines; stateless count/3 dropped them all, leaving slow drags inert in mouse-aware alt-screen panes (codex). Residue accumulates signed per bridge under the manager lock and resets on window/pane selection. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Typing raced the terminal WS handshake under parallel load (2 gate failures today). Wait for the writable Connected label before typing; 10x repeat green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThis change adds bounded ChangesTerminal scroll protocol and tmux execution
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant TerminalView
participant TouchScroll
participant ControlPlane
participant Agentd
participant TmuxViewer
User->>TerminalView: drag or momentum gesture
TerminalView->>TouchScroll: provide touch deltas and tmux session key
TouchScroll->>ControlPlane: send coalesced terminal.navigate scroll
ControlPlane->>Agentd: relay bounded scroll request
Agentd->>TmuxViewer: execute pane-aware navigation
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
tests/journeys/fw6-focus.journey.spec.ts (1)
69-93: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAssert exclusive navigation routing and scroll direction.
The test accepts either sign and excludes only one input encoding. Snapshot terminal input before the drag, assert it remains unchanged, and verify the new scroll frames have the intended sign; add the reverse drag for the opposite direction.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/journeys/fw6-focus.journey.spec.ts` around lines 69 - 93, Update the test around dragTerminal to snapshot terminal input and scroll-frame counts before the gesture, then assert the drag produces only new scroll frames with the intended sign and leaves terminal input unchanged. Add a reverse-direction drag assertion to verify the opposite scroll sign, while retaining the existing frame validity checks.agents/agentd/internal/tmux/terminal_scroll_test.go (1)
5-29: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd a manager-level residue regression test.
This verifies the helper only; it still passes if
navigateScrollLockeddrops residue between requests. Send threeLines: -1navigation calls and assert exactly one wheel event after the third call.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agents/agentd/internal/tmux/terminal_scroll_test.go` around lines 5 - 29, Add a manager-level regression test around navigateScrollLocked that sends three navigation requests with Lines: -1, preserving the manager’s residue across calls and asserting exactly one wheel event is emitted on the third request. Verify the first two requests emit none, so the test covers request-to-request accumulation rather than only accumulateWheelEvents.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@agents/agentd/internal/tmux/terminal_scroll_test.go`:
- Around line 5-29: Add a manager-level regression test around
navigateScrollLocked that sends three navigation requests with Lines: -1,
preserving the manager’s residue across calls and asserting exactly one wheel
event is emitted on the third request. Verify the first two requests emit none,
so the test covers request-to-request accumulation rather than only
accumulateWheelEvents.
In `@tests/journeys/fw6-focus.journey.spec.ts`:
- Around line 69-93: Update the test around dragTerminal to snapshot terminal
input and scroll-frame counts before the gesture, then assert the drag produces
only new scroll frames with the intended sign and leaves terminal input
unchanged. Add a reverse-direction drag assertion to verify the opposite scroll
sign, while retaining the existing frame validity checks.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 56c9cad2-fe5e-411a-85ec-3404a022a666
📒 Files selected for processing (33)
agents/agentd/cmd/agentd/main.goagents/agentd/cmd/agentd/main_terminal_test.goagents/agentd/internal/protocol/terminal.goagents/agentd/internal/tmux/pty_bridge_test.goagents/agentd/internal/tmux/terminal.goagents/agentd/internal/tmux/terminal_scroll_test.goagents/agentd/internal/tmux/viewer_pty.goapps/dashboard/src/components/TerminalView.tsxapps/dashboard/src/components/mobile/TerminalContextMenu.tsxapps/dashboard/src/components/mobile/TerminalKeyRail.tsxapps/dashboard/src/components/mobile/terminalRailConfig.test.tsapps/dashboard/src/components/mobile/terminalRailConfig.tsapps/dashboard/src/components/terminal/PersistentTerminalHost.tsxapps/dashboard/src/components/terminal/TerminalSurface.tsxapps/dashboard/src/components/terminal/terminalHostStore.test.tsapps/dashboard/src/components/terminal/types.tsapps/dashboard/src/components/tmux/TmuxMobileShell.tsxapps/dashboard/src/components/tmux/TmuxTerminalWorkspace.tsxapps/dashboard/src/components/tmux/accessibilityContracts.test.tsapps/dashboard/src/hooks/useTerminalTouchScroll.test.tsapps/dashboard/src/hooks/useTerminalTouchScroll.tspackages/ac-schema/src/message.tspackages/ac-schema/src/terminal.tspackages/ac-schema/tests/protocol-fixtures.test.tspackages/ac-schema/tests/terminal.test.tsservices/control-plane/tests/terminalRoute.test.tstasks/2026-07-21-fw6-touch-brief.mdtasks/frontend-ux-handoffs/fw6-touch.mdtasks/frontend-ux-log.mdtests/fixtures/protocol/terminal-navigate-scroll.jsontests/journeys/command-center.journey.spec.tstests/journeys/controlPlaneMock.tstests/journeys/fw6-focus.journey.spec.ts
💤 Files with no reviewable changes (1)
- apps/dashboard/src/components/mobile/TerminalContextMenu.tsx
Summary
Owner-locked redesign of the mobile touch model after "scrolling barely works":
terminal.navigateprotocol ({op: scroll, lines}, clamped ±120). agentd reads the viewer pane's state in one call and dispatches natively: copy-modescroll-up/down N(in-mode or entering with-eso bottom auto-exits), literal SGR wheel delivery to mouse-aware alt-screen apps (codex scrolls its own transcript; sub-event residue accumulates per bridge so slow drags work), arrow-key parity for mouse-less alt-screen apps, and no-op scrolling down at live. Replaces the quantized 5-lines-per-wheel emulation for tmux terminals (which remains only as the non-tmux alternate-buffer fallback).inputMode=none— taps never summon the Android keyboard (no more mid-read PTY resizes). A new rail Keyboard key toggles typing mode; detach/leave/disconnect resets it. Desktop unchanged.Review chain
Deploy notes
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Tests