Skip to content

fix(tui): keep side answers open while paging - #59624

Open
Aafimalek wants to merge 1 commit into
anomalyco:devfrom
Aafimalek:btw-page-scroll
Open

Aafimalek wants to merge 1 commit into
anomalyco:devfrom
Aafimalek:btw-page-scroll

Conversation

@Aafimalek

@Aafimalek Aafimalek commented Oct 27, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #59612

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Page Up and Page Down currently dismiss the /btw answer because the session's paging commands run while the dialog is open. Register the paging commands in the dialog's modal layer so they scroll the answer instead. Configured shortcuts continue to work, and the physical page keys still scroll when those shortcuts are remapped.

How did you verify your code works?

  • bun test --timeout 30000 test/btw-scroll.test.tsx --rerun-each 10 in packages/tui: 20 passes on Windows. Covers default and custom keys, physical Page Down after remapping, and paging the transcript after the dialog closes.
  • bun typecheck and bun run typecheck:tsc in packages/tui: passed.
  • bun run check: passed on Windows after temporarily substituting the contents of the tracked custom-elements.d.ts symlink, which Git had checked out as a plain text file.

Visual

<svg xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72">
  <rect x="36" y="8" width="168" height="56" rx="6" fill="none" stroke="currentColor" opacity=".7"/>
  <path d="M51 20h75 M51 28h110 M51 36h90 M51 44h104" fill="none" stroke="currentColor" stroke-linecap="round" opacity=".65">
    <animateTransform attributeName="transform" type="translate" values="0 3;0 -3;0 3" dur="2s" repeatCount="indefinite"/>
  </path>
  <path d="M184 19v30m-4-5 4 5 4-5" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

Screenshots / recordings

Before: recording from the issue. After: character-frame rendering from the TUI regression test after Page Down:

Test renderer frame showing the answer still open after Page Down

Checklist

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

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Oct 27, 2026

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix works. I reproduced the bug on the base and confirmed it's gone with this change by running the #59612 reproduction from source with the simulated model.

  • On the base, PageDown, PageUp and ctrl+alt+f close the /btw answer.
  • With this change, they scroll the answer by exactly one page and the dialog stays open. The dialog's raw key handler doesn't scroll a second time, and Esc still closes the dialog.
  • test/btw-scroll.test.tsx passes here. Run against the base it fails, so it catches the regression. typecheck:tsc passes.

Public API: unchanged. The change only adds dialog-layer commands that reuse the existing session.page.up/session.page.down ids and their configured keybinds.

No blocking concerns.

Related: #50879, #58946

Before

After

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Oct 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@Aafimalek

Copy link
Copy Markdown
Author

Hi, following up on this fix for Page Up and Page Down dismissing the /btw answer. The regression test and typechecks pass, and the automated review verified the reproduction. Is there anything else needed to help review this PR? Thanks!

This branch has not been deployed

No deployments
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: PageUp/PageDown dismiss the /btw answer dialog instead of scrolling

1 participant