Skip to content

fix(session-ui): keep the reasoning header visible while it scrolls - #65246

Open
jtaraque wants to merge 1 commit into
anomalyco:devfrom
jtaraque:sticky-reasoning-header
Open

jtaraque wants to merge 1 commit into
anomalyco:devfrom
jtaraque:sticky-reasoning-header

Conversation

@jtaraque

@jtaraque jtaraque commented Nov 20, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #60009
Opened after commenting on #60009; no maintainer reply yet. Happy to close this and revisit if the behavior isn't wanted.

Type of change

  • Bug fix

What does this PR do?

An open reasoning block can only be collapsed by scrolling back to its header. Edit and patch cards already pin their header while you scroll; this gives reasoning the same behavior. One CSS rule on the existing collapsible trigger.

How did you verify your code works?

  • New component test scrolls a long reasoning block 900px and asserts the trigger stays 48px below the top. It fails without the rule (Expected 48, Received -852) and passes with it.
  • bun --cwd packages/session-ui test:components -- reasoning-sticky.spec.ts --repeat-each=3 -> 3 passed.
  • bun typecheck in packages/session-ui, bun run lint:changed HEAD^1.
  • Story current-reasoning-part--sticky-header, checked in both timeline presets and inside an open tool group.

Screenshots / recordings

sticky-before.webm
sticky-after.webm

Checklist

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

Added by the opencode bot (AI-generated).

Related: #63228, #63900

@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.

With this change, an open reasoning header stays pinned while its text scrolls. I checked this with the new component test: it passes with the rule, and with the base message-part.css it fails with Expected 48, Received -852. Screenshots of the same scrolled story on the base and with this pull request are attached. tsc -b passes for packages/session-ui.

The rule matches the reasoning markup in both reasoning views (message-content.tsx and timeline-next/tools/thought.tsx). It uses the same offset variable, z-index and background as the other sticky headers in session-ui, so inside an open tool group the reasoning header stacks just below the group header.

The public API is unchanged (styling, a story and a test only).

No blocking concerns.

Related: #63228, #63900

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.

[FEATURE]: CloseThinking with a tap/click in any area of it

1 participant