🤖 fix: collapse settled operation bundles in hyper density#3418
Merged
Conversation
Settled operational bundles now default collapsed while active bundles remain expanded, with projection and UI regressions covering the hyper-density render path.
---
_Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `346486{MUX_COSTS_USD:-unknown}`_
<!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=10.61 -->
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! ℹ️ 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". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Collapse completed hyper-density operational bundles by default while keeping active/running operational bundles expanded for live progress visibility.
Background
Hyper transcript density already groups low-signal reasoning/tool details behind operation summaries. Completed summaries could still start expanded at the active turn tail, which let settled details consume viewport space before the user chose to inspect them.
Implementation
state === "active".Validation
bun test src/browser/utils/messages/transcriptRenderProjection.test.tsbun test src/browser/features/Messages/OperationalBundleMessage.test.tsxmake versionbun x jest tests/ui/chat/transcriptDensity.test.ts -t "expands work bundles and nested operational bundles through the app render path"make typecheckmake static-checkApp/Chat/Transcript Density / HyperCollapsedBundleswith screenshots and a WebM recording verifying collapsed, expanded, and re-collapsed states.Risks
Low. The change only affects the default expansion flag for operational bundle summaries; manual expand/collapse state and active/running visibility are preserved.
📋 Implementation Plan
Plan: collapse hyper-density operation summaries by default
Goal
When transcript density is
hyper, grouped operation summaries likeRan 59 operations · ...should start collapsed so completed tool/reasoning details do not consume the viewport. Manual expand/collapse should continue to work.Evidence gathered
ChatPaneContentinsrc/browser/components/ChatPane/ChatPane.tsxonly computes/renders operational bundles whentranscriptDensity === "hyper".computeOperationalBundleInfos()insrc/browser/utils/messages/transcriptRenderProjection.ts.state === "active" || (options.isTurnActive && !hasSubsequentVisibleEvent).OperationalBundleMessageinsrc/browser/features/Messages/OperationalBundleMessage.tsxalready supports collapsed rendering viaexpanded/onToggle.src/browser/utils/messages/transcriptRenderProjection.test.tssrc/browser/features/Messages/OperationalBundleMessage.test.tsxtests/ui/chat/transcriptDensity.test.tssrc/browser/features/Messages/TranscriptDensity.stories.tsxRecommended approach
Approach A — simplify operational bundle default expansion
Product code net LoC estimate: -8 to -12 LoC
src/browser/utils/messages/transcriptRenderProjection.tsso completed operational bundles default collapsed:defaultExpanded: state === "active";isTurnActive && !hasSubsequentVisibleEvent;hasVisibleEventAfter()helper if no other local use remains.ChatPaneContentmanual override behavior:operationalBundleOverride ?? operationalBundle.defaultExpandedremains the expansion source;src/browser/utils/messages/transcriptRenderProjection.test.ts:tests/ui/chat/transcriptDensity.test.tsif needed so the full app hyper-density path proves theoperational-bundlebutton starts witharia-expanded="false"and hides details until clicked.Why this is preferred: the
Ran N operationsbundle only renders in hyper density today, so making settled operational bundles collapsed in the projection is the smallest change and avoids adding a new density option or duplicated expansion logic.Alternative considered
Approach B — density-aware override in
ChatPaneContentProduct code net LoC estimate: +3 to +12 LoC
Add a hyper-density override near
isOperationalBundleExpanded, leavingcomputeOperationalBundleInfos()unchanged. This is more explicit about density but adds a second policy layer and makes projection tests less representative of actual default behavior. I would only use this if another caller needs the old settled-tail expansion semantics.Acceptance criteria
Ran N operationsbundle starts collapsed by default.Quality gates and validation
bun x jest tests/ui/chat/transcriptDensity.test.ts -t "expands work bundles and nested operational bundles through the app render path"Dogfooding plan
agent-browserto open the transcript density Storybook story that displays hyper-density operation bundles, preferablyTranscriptDensity.stories.tsx/HyperExpandedBundle.Ran N operationsrow visible witharia-expanded="false"by default;MUX_E2E=1 make dev-desktop-sandbox DEV_DESKTOP_SANDBOX_ARGS="--clean-projects"Implementation notes
Generated with
mux• Model:openai:gpt-5.5• Thinking:xhigh• Cost:$10.61