Repository navigation
Fix workspace notification ring invalidation blanking active terminal #2892
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
Closed
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
a546827
Add notification presentation regression tests
austinywang 69eca70
Scope workspace notification updates
austinywang 03c8285
Fix workspace notification presentation CI failures
austinywang 6204b10
Fix workspace unread rect test for snapshot API
austinywang 41f52d2
Stabilize file explorer hydration on macOS 26
austinywang f5b5e30
Keep command palette notification state reactive
austinywang c56ef62
Fix stale notification snapshot consumers
austinywang a216a15
Merge remote-tracking branch 'origin/main' into issue-2887-terminal-b…
austinywang 2eff054
Fix notification snapshot indexing and file explorer loads
austinywang 6adc58b
Merge remote-tracking branch 'origin/main' into issue-2887-terminal-b…
austinywang 728447c
Avoid shared store default argument warnings
austinywang c90eeba
Merge remote-tracking branch 'origin/main' into issue-2887-terminal-b…
austinywang fc48431
Merge branch 'main' of https://github.com/manaflow-ai/cmux into issue…
austinywang 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
Large diffs are not rendered by default.
Oops, something went wrong.
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.
Preserve workspace-level indicators in the snapshot.
Line 695 now hard-codes
surfaceId == niltofalse, and Lines 990-991 only record non-nilsurface IDs. The existing store API treats(tabId, nil)as a valid unread key, so this presentation model can no longer represent workspace-scoped notifications at all. Any caller migrated fromhasVisibleNotificationIndicator(forTabId:surfaceId:)to this snapshot will silently lose that indicator.🧩 Proposed fix
struct TerminalNotificationWorkspaceSnapshot: Equatable, Sendable { let tabId: UUID? let unreadCount: Int let hasRead: Bool + let hasVisibleWorkspaceIndicator: Bool let visibleSurfaceIds: Set<UUID> let latestNotification: TerminalNotification? let focusedReadIndicatorSurfaceId: UUID? static let empty = TerminalNotificationWorkspaceSnapshot( tabId: nil, unreadCount: 0, hasRead: false, + hasVisibleWorkspaceIndicator: false, visibleSurfaceIds: [], latestNotification: nil, focusedReadIndicatorSurfaceId: nil ) @@ func hasVisibleNotificationIndicator(surfaceId: UUID?) -> Bool { - guard let surfaceId else { return false } + guard let surfaceId else { return hasVisibleWorkspaceIndicator } return visibleSurfaceIds.contains(surfaceId) } } @@ func workspaceSnapshot(forTabId tabId: UUID) -> TerminalNotificationWorkspaceSnapshot { var hasRead = false + var hasVisibleWorkspaceIndicator = false var visibleSurfaceIds = Set<UUID>() let focusedReadIndicatorSurfaceId = focusedReadIndicatorByTabId[tabId] for notification in notifications where notification.tabId == tabId { if notification.isRead { hasRead = true } else if let surfaceId = notification.surfaceId { visibleSurfaceIds.insert(surfaceId) + } else { + hasVisibleWorkspaceIndicator = true } } @@ return TerminalNotificationWorkspaceSnapshot( tabId: tabId, unreadCount: unreadCount(forTabId: tabId), hasRead: hasRead, + hasVisibleWorkspaceIndicator: hasVisibleWorkspaceIndicator, visibleSurfaceIds: visibleSurfaceIds, latestNotification: latestNotification(forTabId: tabId), focusedReadIndicatorSurfaceId: focusedReadIndicatorSurfaceId ) }Also applies to: 987-997
🤖 Prompt for AI Agents