Skip to content

feat(tui): add auto_scroll config to disable session viewport follow#33248

Open
kailauber wants to merge 1 commit into
anomalyco:devfrom
kailauber:fix/tui-scroll-snap-during-history-read
Open

feat(tui): add auto_scroll config to disable session viewport follow#33248
kailauber wants to merge 1 commit into
anomalyco:devfrom
kailauber:fix/tui-scroll-snap-during-history-read

Conversation

@kailauber

@kailauber kailauber commented Jun 21, 2026

Copy link
Copy Markdown

Issue for this PR

Type of change

  • New feature

What does this PR do?

Adds an auto_scroll flag to tui.json. Default true keeps current behavior. Setting it to false disables sticky-bottom on the session scrollbox so the viewport stays where the user left it while messages stream in.

Useful when reading earlier history during a long response, or for slow local models where the auto-snap is jarring on every token.

Surface area

  • Schema: new optional boolean on TuiConfig.Info
  • Session route: stickyScroll is now driven by the config instead of a hardcoded true
  • Migrator: auto_scroll is picked up from the legacy opencode.json -> tui block and written into the new tui.json alongside the existing scroll_speed / scroll_acceleration / diff_style keys
  • SDK v1 Config type extended with auto_scroll in the legacy tui block
  • Docs entry under packages/web/src/content/docs/tui.mdx

How did you verify your code works?

  • bun turbo typecheck — 23/23 packages green
  • packages/tui/test/config.test.tsx — schema accepts auto_scroll: true|false and rejects non-booleans
  • packages/opencode/test/config/tui.test.ts — migration test asserts auto_scroll: false survives the opencode.json -> tui.json migration
  • Local TUI run with { "auto_scroll": false } in tui.json: scrolling up during a streaming reply no longer jumps back to the bottom
  • Local TUI run without the option set: behavior unchanged (sticky bottom by default)

Note on check-duplicates

The first CI run failed on bun install because GitHub's tarball endpoint for anomalyco/ghostty-web was returning 504 during the run. The endpoint has recovered and the local pre-push hook now passes the same install + typecheck path that the workflow runs. Since the duplicate-check workflow only triggers on opened and not synchronize, the failed status is sticky on this PR; happy to close and re-open it if that helps.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Setting auto_scroll to false stops the conversation pane from snapping
to the bottom when new content arrives. Default stays true, so existing
behavior is unchanged.
@kailauber kailauber force-pushed the fix/tui-scroll-snap-during-history-read branch from ac67f97 to e66d77b Compare June 21, 2026 15:47
@kailauber

Copy link
Copy Markdown
Author

Reopening to retrigger CI after the upstream ghostty-web tarball 504 (now resolved).

@kailauber kailauber closed this Jun 21, 2026
@kailauber kailauber reopened this Jun 21, 2026
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.

tui: auto_scroll has no effect on new messages / long prompts (v1.14.50)

1 participant