Skip to content

fix(tui): clear stale jump prompt after collapsing - #66812

Open
Qwara-chan wants to merge 1 commit into
anomalyco:devfrom
Qwara-chan:collapse-scroll-state
Open

Qwara-chan wants to merge 1 commit into
anomalyco:devfrom
Qwara-chan:collapse-scroll-state

Conversation

@Qwara-chan

Copy link
Copy Markdown

Issue for this PR

Closes #66799

Type of change

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

What does this PR do?

Recomputes the away-from-bottom state after an activity group is expanded or collapsed and laid out. When collapsing makes the whole transcript fit, the stale Jump to latest pill now disappears. The existing scroll-anchor save still runs through updateAwayFromBottom.

Adds a regression test that expands the only activity group, scrolls away from the bottom, then collapses it and checks that the prompt is gone.

How did you verify your code works?

  • cd packages/tui && bun test --timeout 30000 test/session-activity-anchor.test.tsx --rerun-each 10: 50 passed.
  • cd packages/tui && bun test --timeout 30000: 1774 passed, 2 skipped.
  • bun run check: passed.

The new regression test fails without the one-line runtime change.

Screenshots / recordings

No manual recording; the before/after behavior is covered by the renderer regression test.

Checklist

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

@opencodejr opencodejr 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 change looks good. I reproduced the stale Jump to latest ↓ pill on the base with the script from #66799 (simulated model; expand the activity group and outputs, scroll down then up, collapse). With this PR the pill is gone once the transcript fits. The anchor tests pass, and the new test fails on the base without the runtime change.

The swap keeps the anchor saving: updateAwayFromBottom still ends in saveScrollAnchor(), just one tick later. The stickyScroll/hiddenRows reset it does at the bottom matches what scrolling to the bottom already does.

The public API is unchanged.

No concerns.

Before

After

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: "Jump to latest" pill stays visible after collapsing tool calls

1 participant