Repository navigation
Sidebar hover preview: count and name each agent's running subagents; History drops inbox notices #30439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Sidebar hover preview: count and name each agent's running subagents; History drops inbox notices #30439
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
9678ef0
Sidebar hover preview: count each agent's running subagents, name the…
teamleaderleo 8003d60
acpmux: mask subagent task labels and end foreground subagents with t…
teamleaderleo 10ea2a9
Merge remote-tracking branch 'origin/feat-cmux-next' into lane/ux-hov…
teamleaderleo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,7 +39,7 @@ public struct WorkspaceTimelineReader { | |
| case .failed: .failed | ||
| } | ||
| return SidebarTimelineEntry(kind: kind, date: Date(timeIntervalSince1970: TimeInterval(event.atMs) / 1000), | ||
| text: event.text, agent: agent.map(displayName)) | ||
| text: event.text, agent: agent.map(displayName), isNotice: event.isNotice) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: The reader applies its event limit before the hover card removes Prompt for AI agents |
||
| } | ||
|
|
||
| /// "Claude Code" for "claude"; the id itself for an agent cmux does not list. | ||
|
|
||
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
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
63 changes: 63 additions & 0 deletions
63
Packages/macOS/CmuxNext/Sources/CmuxNextSidebar/Logic/WorkspaceHoverCardWork.swift
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| import CmuxNextDesign | ||
| import CmuxNextIcons | ||
| import Foundation | ||
|
|
||
| /// What a workspace's agents run below their turns, as the hover card says it (Leo 2026-11-01: | ||
| /// "e.g. this hover preview being able to see the # of associated subagents and whatnot would be | ||
| /// a lot more useful / like the details aren't even very useful"). acpmux counts them | ||
| /// (`subagentsRunning`, `subagentNames`, `commandsRunning` on each chat's summary); the card only | ||
| /// words them. Pure. | ||
| enum WorkspaceHoverCardWork { | ||
| /// How the expanded card shows the running work. The gallery shows all three | ||
| /// (`WorkspaceHoverCardGallery`); `shipped` is the one the app draws. | ||
| enum Style: String, CaseIterable, Sendable { | ||
| /// A count line, then one line per running subagent, named (the shipped one). | ||
| case list | ||
| /// The count line alone. | ||
| case summary | ||
| /// One line: the count, then the names after it, wrapped to two lines. | ||
| case inline | ||
| } | ||
|
|
||
| /// The style the card draws: each subagent named on its own line, so the person sees what | ||
| /// runs, not only how much; a count alone says little more than the spinner. | ||
| static let shipped = Style.list | ||
|
|
||
| /// The fact kind of the count line and of a subagent's line. | ||
| static let countKind = "runningWork" | ||
| static let subagentKind = "runningSubagent" | ||
|
|
||
| /// "3 subagents · 1 command"; nil when nothing runs. | ||
| static func counts(subagents: Int, commands: Int) -> String? { | ||
| let parts = [subagents > 0 ? Strings.subagentsRunning(subagents) : nil, | ||
| commands > 0 ? Strings.commandsRunning(commands) : nil].compactMap { $0 } | ||
| return parts.isEmpty ? nil : parts.joined(separator: WorkspaceRowContent.separator) | ||
| } | ||
|
|
||
| /// A tab row's second line: its chat's counts first (they never cut), then its folder. | ||
| static func tabCaption(_ tab: SidebarTab) -> String? { | ||
| let folder = tab.folder.flatMap { $0.isEmpty ? nil : $0 } | ||
| let parts = [counts(subagents: tab.subagentsRunning, commands: tab.commandsRunning), folder].compactMap { $0 } | ||
| return parts.isEmpty ? nil : parts.joined(separator: WorkspaceRowContent.separator) | ||
| } | ||
|
|
||
| /// The expanded card's lines for `detail`'s running work in `style`; none when nothing runs. | ||
| static func facts(_ detail: SidebarWorkspaceDetail, style: Style = shipped) -> [WorkspaceHoverCardContent.Fact] { | ||
| typealias Fact = WorkspaceHoverCardContent.Fact | ||
| guard let count = counts(subagents: detail.subagentsRunning, commands: detail.commandsRunning) else { return [] } | ||
| // Each name once, in acpmux's order (oldest first); a nameless subagent only counts. | ||
| var seen = Set<String>() | ||
| let names = detail.subagentNames.filter { !$0.isEmpty && seen.insert($0).inserted } | ||
| let head = Fact(icon: .appSampleRunningagents, text: count, kind: countKind) | ||
| switch style { | ||
| case .summary: | ||
| return [head] | ||
| case .inline: | ||
| guard !names.isEmpty else { return [head] } | ||
| return [Fact(icon: .appSampleRunningagents, text: count + ": " + names.joined(separator: ", "), lines: 2, kind: countKind)] | ||
| case .list: | ||
| // The list's own header names the kind, so each line is the name alone, by its icon. | ||
| return [head] + names.map { Fact(icon: .agentActivity, text: $0, kind: subagentKind) } | ||
| } | ||
| } | ||
| } |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P3: The workspace-level
subagentNamesconcatenates each chat's five-name list without a cap, so a workspace with several agent chats shows far more than five subagent lines in the hover card. Cap the combined list at five to match the per-chat limit.Prompt for AI agents