Repository navigation
Show every background command's duration and fold them from the row you clicked - #6007
Closed
alexandre-vl wants to merge 3 commits into
Closed
alexandre-vl wants to merge 3 commits into
alexandre-vl wants to merge 3 commits into
Conversation
…ou clicked Each background command is one row with its live duration. With two or more, the newest row is the toggle: older commands open above it, oldest first, and the same row folds them back, so it never moves under the pointer in the bottom-anchored prompt stack. The expanded state is per thread and folds back below two commands.
Older rows tick only while unfolded and are dropped once fewer than two commands run. The card is keyed by thread and its open state resets on a thread switch. The list reveals from its bottom edge, the toggle's label keeps a background agent's model, and keyboard focus draws an inset ring inside the card.
2 tasks done
# Conflicts: # apps/app/src/components/promptbox/banner/AnimatedBody.test.tsx # apps/app/src/components/promptbox/banner/ThreadBackgroundCommandsCard.test.tsx # apps/app/src/components/promptbox/banner/ThreadBackgroundCommandsCard.tsx # apps/app/src/views/thread-detail/ThreadDetailPromptArea.test.tsx
Contributor
|
This is an automated message. We have closed this pull request because it has been open for more than two weeks. |
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.
Human comments
What was wrong
The background-commands card above the composer hid the two things people look at it for: how long the command has been running, and whether there are more commands. On main (
b143a2286),apps/app/src/components/promptbox/banner/ThreadBackgroundCommandsCard.tsxrenders the newest command withshowDuration={false}(:241), and the unfolded list holds only the other commands (:193), so the newest command's duration never shows. When the card is narrower than 34 rem, the header becomes "Running 3 background commands", with no description at all. A count pill is the only mark that the card opens (:242). The chevron appears on hover only and is hidden on touch screens (packages/shared-ui/src/components/ui/prompt-stack-disclosure.tsx:105,[@media(hover:none)]:hidden). The prompt stack is anchored to the composer, so opening the card grows it upward: the header you clicked jumps 78 px, and the separate close row (#4890) lands under the pointer. Unfolded rows wrap mid-word (line-clamp-2 break-all,:296), giving "check run pro / gress". The open state (apps/app/src/views/thread-detail/ThreadDetailPromptArea.tsx:683) was never reset. After the commands dropped to one, the next second command opened the card already unfolded.What changed
A source dev instance with a Claude Code thread running three
sleep 7200background commands. Chromium at 2x: 1280×800, then a 390×844 touch viewport. Each GIF opens and closes the card once, with the pointer drawn in.Dark theme
3 ⌃) ends the row, visible without hover and on touch. The chip shows the total, as other banner badges do (Show total counts in banner badges #5457).ResizeObserver. The icon marks the row as a command, which leaves room for the description and duration.prefers-reduced-motionturns the transitions off.buttonwitharia-expandedandaria-controlspointing at the list. Its label is "Background commands (3): ", plus "· Model haiku" for a background agent. The folded list isinert, and focus stays on the toggle.Files:
apps/app/src/components/promptbox/banner/ThreadBackgroundCommandsCard.tsx: the card, rewritten.apps/app/src/views/thread-detail/ThreadDetailPromptArea.tsx: the per-thread open state.apps/app/src/components/promptbox/banner/ThreadBackgroundCommandsCard.test.tsx: tests for the new behavior.apps/app/src/views/thread-detail/ThreadDetailPromptArea.test.tsx,apps/app/src/test/thread-detail-prompt-area-harness.tsx: the harness renders a stand-in card, so the prompt area's open state can be tested.apps/app/src/components/promptbox/banner/AnimatedBody.test.tsx: the lazy-mount check now expects the newest row's ticker.apps/app/src/components/promptbox/banner/ThreadBackgroundCommandsCard.stories.tsx: fixtures ordered newest first, bottom-anchored like the real stack.Follow-up: #6009 applies the same model to the active child threads card. It is stacked on this PR.
How you verified
pnpm exec turbo run typecheck lint test --filter=@bb/app: passes. 6241 tests pass (4 skipped) across 647 files, and lint reports 0 errors.Four of the five new tests fail against main's card and prompt area and pass here: the newest command's duration while folded, unfolding above from the same row, the mixed-activity label, and folding again below two commands. The single-command test passes on both.
An independent review (a separate agent thread) found four problems:
The second commit fixes them. It adds two tests and extends two others, and all four fail against the first commit (
28cb77cc3).Screenshots: a source dev instance (
pnpm dev) with a fresh data directory, where a Claude Code thread (Haiku 5.5) started threesleep 7200background commands. Chromium was driven through dev-browser, in light and dark. The GIFs come from a CDP screencast, rendered at 25 fps. The "After" GIF was recorded on the final commit, after the fixture had been restarted, so its newest command and durations differ from the stills.Geometry, measured in Chromium:
Not checked: Safari/WebKit, the iOS app, a screen reader.