Skip to content

refactor(tui): make Static the only history renderer; drop virtual-viewport machinery (stage 2 of #1529)#1534

Merged
esengine merged 1 commit into
mainfrom
feat/static-history-stage2
May 22, 2026
Merged

refactor(tui): make Static the only history renderer; drop virtual-viewport machinery (stage 2 of #1529)#1534
esengine merged 1 commit into
mainfrom
feat/static-history-stage2

Conversation

@esengine

Copy link
Copy Markdown
Owner

Summary

Stage 2 of #1529. StaticCardStream landed in Stage 1 (#1530) behind REASONIX_STATIC_HISTORY=1 and held up under real use. This PR promotes it to the only path and deletes the machinery whose entire job was fighting the terminal for scrollback.

Deleted

  • src/cli/ui/layout/CardStream.tsx — virtual viewport, height measurement, monotonic-shrink lock, scroll indicator
  • src/cli/ui/state/chat-scroll-store.ts + chat-scroll-provider.tsx — scroll state + context
  • src/cli/ui/copy-mode/ — application-level vim/tmux copy mode + OSC 52 snapshot helper
  • src/cli/ui/layout/InputAreaWithHistoryHint.tsx — unused dead leaf (no JSX caller)
  • tests/card-stream-items.test.ts, tests/chat-scroll-wheel.test.ts, tests/copy-mode-snapshot.test.ts, tests/input-area-history-hint.test.tsx, tests/modal-scroll-reset.test.ts
  • /copy slash command + openCopyMode slash result + the qq-channel terminal-only notice + the copyMode i18n block

Trimmed

  • App.tsx drops STATIC_HISTORY flag, HistoryTypingCapture leaf, ChatScrollProvider wrapper, useChatScrollActions/State subscriptions, pendingCopyMode state, the keystroke scroll handler (PgUp/PgDn/End/wheel/arrows), and the conditional outer Box height — terminal owns scrolling now (-114 lines net).
  • ComposerArea.tsx no longer wraps the input area in the "scrolled-up reading history" hint branch — pinning isn't a concept we track anymore.
  • PromptInput.tsx drops the absolute IME cursor write — its math required the persistent UI to be anchored at terminal bottom, and the Static frame floats.
  • mouse-mode.ts defaults to off everywhere (terminal owns the wheel). REASONIX_MOUSE_MODE=sgr|alternate-scroll remains as an escape hatch. On startup we emit disables for every common mouse-capture mode so stale state from a prior crashed TUI in the same terminal can't keep eating wheel events.

Net diff: 1545 deletions, 48 insertions across 26 files.

Test plan

  • npm run typecheck
  • npm run lint (no new errors; 2 pre-existing biome suggestions remain)
  • npm run build
  • npm run test — all 3566 tests pass (5 obsolete tests deleted, 3 updated for new defaults)
  • Manual smoke on Windows Terminal: type, send, watch streaming, scroll history with the mouse wheel — terminal scrollback handles it, no ghosts, composer stays put

Part of #1529.

…virtual-viewport machinery

Stage 2 of #1529. StaticCardStream landed behind a flag in Stage 1 and
worked end-to-end; this stage promotes it to the only path and deletes
the parts of the codebase whose job description was "fight the terminal
for scrollback":

- Remove the REASONIX_STATIC_HISTORY gate; Static is unconditional.
- Delete CardStream (virtual viewport + height measurement + scroll
  delta math), chat-scroll-store, chat-scroll-provider, the unused
  InputAreaWithHistoryHint, and the application-level copy-mode along
  with its OSC52 snapshot helper and `/copy` slash command.
- Drop the keystroke handler that routed PgUp/PgDn/End/wheel/arrows
  through chat-scroll; the terminal owns these now.
- Drop the absolute IME cursor write in PromptInput (its math required
  the persistent UI to be anchored at terminal bottom).
- mouse-mode defaults to "off" everywhere; REASONIX_MOUSE_MODE override
  stays as an escape hatch.
- ComposerArea no longer wraps its input area in the "scrolled-up
  history hint" branch — pinning is no longer a concept we track.

Net: 1545 deletions, 48 insertions across 26 files.
@esengine esengine merged commit 8a8d765 into main May 22, 2026
4 checks passed
@esengine esengine deleted the feat/static-history-stage2 branch May 22, 2026 08:36
esengine pushed a commit that referenced this pull request May 22, 2026
…, theme) (#1524)

Localizes the remaining hardcoded CLI output strings — `reasonix mcp list / search / install` flow, `sessions` listing, `prune-sessions`, and the `/theme` slash handler — so zh-CN users see translated text instead of mixed EN/CN output.

31 new keys across `sessions` / `mcpCli` / `app` namespaces with full EN ↔ zh-CN parity. Mechanical migration — `t()` calls replace each string with the same parameters; no behavior change.

Verified clean rebase on top of the stage-1-through-4 refactor (#1530 / #1534 / #1536 / #1537) plus the path-approval bridge (#1540): typecheck + lint + 3528 tests all pass.
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