Repository navigation
Studio: show long thinking in a capped box that scrolls on its own instead of Expand thinking - #16876
Conversation
…stead of Expand thinking
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 27f7a40a76
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| className={cn( | ||
| // A mask paints only inside its box: bleed into the side padding so list markers survive. | ||
| capped && | ||
| "-mx-[calc(1.25rem*var(--ui-space-scale,1))] min-w-0 max-h-[min(22rem,48vh)] overflow-x-hidden overflow-y-auto px-[calc(1.25rem*var(--ui-space-scale,1))]", |
There was a problem hiding this comment.
Connect transcript demand-loading to the inner scroller
When a long trace is opened under Auto and the reader scrolls beyond the initially mounted rows before progressive mounting completes, the new inner scroller can display blank reserve blocks instead of reasoning. ReasoningTranscript still attaches its scroll listener exclusively to .aui-thread-viewport and runs its reserve-demand calculation from that listener; scrolling this nested box does not dispatch a scroll event on the thread viewport. Wire the inner scroller into the transcript's demand-loading logic so newly visible passages mount immediately rather than waiting for background mounting to reach them.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 2f84c79: the transcript now listens for scrolls on the capped box and runs its demand pass on the next frame, so passages the box scrolls to mount right away.
| const onScroll = () => { | ||
| const atBottom = below() < 24; | ||
| if (atBottom || performance.now() - readerAt < 250) following.current = atBottom; |
There was a problem hiding this comment.
Track scrollbar interaction beyond the initial pointer-down
During streaming, a reader who presses the scrollbar thumb, pauses for more than 250 ms, and then drags upward does not disable following: pointerdown is the only pointer event that updates readerAt, so this condition ignores the subsequent scroll. The next content resize immediately snaps the box back to the bottom. Track an active pointer interaction until release, or otherwise recognize continued scrollbar dragging, so the reader can reliably hold a position while reasoning streams.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 2f84c79: a press that starts in the box now counts as reader input for as long as it is held, so a paused scrollbar drag still stops the follow.
… and a stable scrollbar gutter for the thinking box
…pace around the closing rule once scrolled to the end, wider gap between header buttons
… held scrollbar drag from snapping the box back while streaming
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…(Settings scroll) (unslothai#17003) Follow-up to unslothai#16978. Its Glass ceiling of 7x per area was set from too few readings and fails unrelated PRs. ## Problem Staging for unslothai#16876 (which does not touch source cards) failed the long-chat gate: `appearance mode frosted makes area source_card cost 1,111 ms CPU against 159 in the default appearance at 40 turns = 7.0x (limit 7.0x)`. Across 7 local runs of the gate on main, several small, cheap areas read close to or over 7x under Glass on main itself: | Mode | Area | Highest reading on main | |---|---|---| | blurred | api_monitor | 7.8x | | blurred | source_card | 7.0x | | blurred | account_menu | 6.8x | | liquid-3d | run_settings | 6.2x | | blurred | reasoning_toggle | 6.1x | | liquid | tool_toggle | 6.1x | ## Fix The per-area Glass ceiling goes from 7x back to 10x, about 1.3x the highest reading. The Settings scroll ceilings go from 12-15x to 18x: staging for unslothai#16865 (which does not touch Settings or Glass) read `frosted makes area settings_scroll cost 1,903 ms CPU against 141 ... = 13.5x (limit 12.0x)` on a GitHub runner, above the 9.7-12.2x seen locally. A new appearance mode still has no allowance and is held to the plain 4x limit, so a new slow material is still caught. ## Testing - `test_area_matrix.py`: 28 passed.
Long Thinking traces under the Auto setting were clipped to a fixed box with an "Expand thinking" button below it, and reading the rest meant expanding the whole trace into the page (12,229 px for a long trace in testing). The box now scrolls on its own, and an expand button in the header still shows the whole trace in one click.
What changes
min(22rem, 48vh)(wasmin(18rem, 40vh)) and scrolls inside. No border, and the scrollbar is always visible, sits 8 px right of the text, and has a stable gutter so the text width never changes with it. Focusing a link deep in the trace now just scrolls it into view instead of lifting the cap.scrollToptoo, and without that guard the box stopped following on its own partway through a stream.reasoningTailFlexBoxand the flex layout it guarded are removed, since a scroll box does not needjustify-endto show the newest lines.This reverses the earlier choice of a clipped box over an inner scroller. While the box is capped the transcript already skips thread scroll corrections (
bounded), and live testing showed no anchoring problems, but it is worth a look.Performance
Same as main within run-to-run noise (headless Chromium, long seeded trace and live streaming with Gemma 4 E2B):
Verification
npm run typecheck,npm test(14,993 pass),npm run build.reasoning-live-tail.test.tsis rewritten for the scroll box: the cap, always-visible scrollbar and stable gutter, the header expand button, follow and stop rules, the per-edge fades and the scrollbar strip.thinking-fold.test.tsfollows the end rule's new prop.Not tested here
Screenshots
Same scripted 70-step Thinking trace streamed into main (left) and this PR (right), default Auto setting, Chromium 1500x1000. The headless browser hides scrollbars, so the always-visible scrollbar does not show here.
Mid-stream: both follow the newest line. This PR shows the top fade and the expand button in the header.
Finished and reopened: main clips the trace with an "Expand thinking" link under it; this PR scrolls inside the box (352 px shown of 869 px), with a bottom fade and the expand button beside Copy.