Skip to content

fix(tui): preserve detached scrolling across layout changes - #350

Merged
hetaoBackend merged 2 commits into
mainfrom
fix/preserve-scroll-follow-on-resize
Sep 24, 2026
Merged

hetaoBackend merged 2 commits into
mainfrom
fix/preserve-scroll-follow-on-resize

Conversation

@1anZhang

@1anZhang 1anZhang commented Sep 24, 2026

Copy link
Copy Markdown
Collaborator

Change

When a user scrolls up in fullscreen mode, growing the viewport or shrinking the footer/transcript can clamp the scroll position to the current end. Layout then silently restores follow-tail, so subsequent streamed output moves the viewport away from the user's reading position.

Clamp the position without changing follow state. End, explicitly scrolling back to the bottom, and accepted user submissions retain their existing behavior. Regression coverage includes viewport growth, footer shrink, content shrink, temporarily fitting all content, continued streaming, and resuming with End. Engine change records are updated.

Related to #348 and #349, which contain the same report. This fixes the reproduced fullscreen layout-clamping cases. The reported regular-mode and no-layout-change symptoms remain unconfirmed; these issues are not claimed fully resolved.

Validation

  • pnpm verify, full profile, clean commit 857df53, macOS arm64, Node.js 26.4.0: all 15 applicable gates passed, including source/export checks, release tooling, lint, typecheck, build, artifact checks, capabilities (4,588 passed, 14 skipped), status contract, smoke, BYOK, policy and sandbox.
  • Focused scrollbar and native-scrollback suites: 99 tests passed. Restoring the pre-fix ScrollView implementation makes all four layout regressions fail; the fixed implementation passes.
  • Built CLI + local SSE fixture + PTY/xterm replay: scroll upward during streaming, then grow a 60x16 fullscreen viewport to 60x46. On baseline 18e7278, all 88 subsequent samples moved away from the post-resize anchor; on 857df53, none of the 88 samples moved. Each resize run observed 145 streamed chunks.
  • The same CLI replay without resizing preserved the reading position in both regular and fullscreen modes, before and after the fix. Separate real transcript-renderer replays covered streaming prose, code blocks and tables in both modes (915 detached-position checks, no failures). All fixture data was synthetic and the network guard recorded no external requests.
  • Performance: basic; the production change only preserves viewport follow state.
  • NOT RUN: Android/Termux real-device acceptance, native Windows/Linux execution, and live-model calls. PTY/emulator results do not establish native host-terminal acceptance.

Publication and contribution checks

  • I have permission to contribute these changes under the existing licenses applicable to the changed files/packages; no external code was imported and existing notices are preserved.
  • No credentials, account data, real user content, internal source history or private review material is included.
  • No source files or test files were added or removed; existing declared regressions were extended.
  • Engine change records are updated. User documentation is unaffected, and offline results are not described as live-service acceptance.

Maintainer handoff

Publication scope or license changes: none.

Shared-source port: pending.

@1anZhang 1anZhang added bug Something isn't working tui Interactive terminal UI (TUI) cli Standalone mcode: TUI, headless, ACP and source builds/tooling labels Sep 24, 2026
@hetaoBackend hetaoBackend changed the title fix(tui): preserve detached scrolling across resize fix(tui): preserve detached scrolling across layout changes Sep 24, 2026
@hetaoBackend
hetaoBackend merged commit 0dbdc0b into main Sep 24, 2026
13 checks passed
@hetaoBackend
hetaoBackend deleted the fix/preserve-scroll-follow-on-resize branch September 24, 2026 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cli Standalone mcode: TUI, headless, ACP and source builds/tooling tui Interactive terminal UI (TUI)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants