-
Notifications
You must be signed in to change notification settings - Fork 121
UX changes for notch presentation and DynamicNotchKit pin update #265
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
Changes from all commits
c11b9de
1e6b000
bd1040b
44bf09a
8d9973c
b3cca70
0a58e5c
ae3fd38
cdb0906
9ff3a44
395472e
8d66139
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,10 @@ final class CommandModeService: ObservableObject { | |
| self.loadCurrentChatFromStore() | ||
| } | ||
|
|
||
| private var shouldSyncCommandNotchState: Bool { | ||
| self.enableNotchOutput && NotchOverlayManager.shared.shouldSyncCommandConversationToNotch | ||
| } | ||
|
|
||
| private func loadCurrentChatFromStore() { | ||
| if let session = chatStore.currentSession { | ||
| self.currentChatID = session.id | ||
|
|
@@ -278,6 +282,10 @@ final class CommandModeService: ObservableObject { | |
|
|
||
| /// Sync conversation history to NotchContentState | ||
| private func syncToNotchState() { | ||
| guard self.shouldSyncCommandNotchState else { | ||
| return | ||
| } | ||
|
|
||
| NotchContentState.shared.clearCommandOutput() | ||
|
|
||
| for msg in self.conversationHistory { | ||
|
|
@@ -308,7 +316,7 @@ final class CommandModeService: ObservableObject { | |
| self.saveCurrentChat() | ||
|
|
||
| // Push to notch | ||
| if self.enableNotchOutput { | ||
| if self.shouldSyncCommandNotchState { | ||
| NotchContentState.shared.addCommandMessage(role: .user, content: text) | ||
| NotchContentState.shared.setCommandProcessing(true) | ||
| } | ||
|
|
@@ -322,14 +330,18 @@ final class CommandModeService: ObservableObject { | |
|
|
||
| // Add to both histories | ||
| self.conversationHistory.append(Message(role: .user, content: text)) | ||
| NotchContentState.shared.addCommandMessage(role: .user, content: text) | ||
| if self.shouldSyncCommandNotchState { | ||
| NotchContentState.shared.addCommandMessage(role: .user, content: text) | ||
| } | ||
|
|
||
| // Auto-save after adding user message | ||
| self.saveCurrentChat() | ||
|
|
||
| self.isProcessing = true | ||
| self.didRequireConfirmationThisRun = false | ||
| NotchContentState.shared.setCommandProcessing(true) | ||
| if self.shouldSyncCommandNotchState { | ||
| NotchContentState.shared.setCommandProcessing(true) | ||
| } | ||
|
|
||
| await self.processNextTurn() | ||
| } | ||
|
|
@@ -374,7 +386,7 @@ final class CommandModeService: ObservableObject { | |
| self.captureCommandRunCompleted(success: false) | ||
|
|
||
| // Push to notch | ||
| if self.enableNotchOutput { | ||
| if self.shouldSyncCommandNotchState { | ||
| NotchContentState.shared.addCommandMessage(role: .assistant, content: errorMsg) | ||
| NotchContentState.shared.setCommandProcessing(false) | ||
| self.showExpandedNotchIfNeeded() | ||
|
|
@@ -386,7 +398,7 @@ final class CommandModeService: ObservableObject { | |
| self.currentStep = .thinking("Analyzing...") | ||
|
|
||
| // Push status to notch | ||
| if self.enableNotchOutput { | ||
| if self.shouldSyncCommandNotchState { | ||
| NotchContentState.shared.addCommandMessage(role: .status, content: "Thinking...") | ||
| } | ||
|
|
||
|
|
@@ -414,7 +426,7 @@ final class CommandModeService: ObservableObject { | |
| )) | ||
|
|
||
| // Push step to notch | ||
| if self.enableNotchOutput { | ||
| if self.shouldSyncCommandNotchState { | ||
| let statusText = tc.purpose ?? self.stepDescription(for: stepType) | ||
| NotchContentState.shared.addCommandMessage(role: .status, content: statusText) | ||
| } | ||
|
|
@@ -432,7 +444,7 @@ final class CommandModeService: ObservableObject { | |
| self.currentStep = nil | ||
|
|
||
| // Push confirmation needed to notch | ||
| if self.enableNotchOutput { | ||
| if self.shouldSyncCommandNotchState { | ||
| NotchContentState.shared.addCommandMessage(role: .status, content: "⚠️ Confirmation needed in Command Mode window") | ||
| NotchContentState.shared.setCommandProcessing(false) | ||
| } | ||
|
|
@@ -464,7 +476,7 @@ final class CommandModeService: ObservableObject { | |
| self.captureCommandRunCompleted(success: isFinal) | ||
|
|
||
| // Push final response to notch and show expanded view | ||
| if self.enableNotchOutput { | ||
| if self.shouldSyncCommandNotchState { | ||
| NotchContentState.shared.updateCommandStreamingText("") // Clear streaming | ||
| NotchContentState.shared.addCommandMessage(role: .assistant, content: response.content) | ||
| NotchContentState.shared.setCommandProcessing(false) | ||
|
|
@@ -488,7 +500,7 @@ final class CommandModeService: ObservableObject { | |
| self.captureCommandRunCompleted(success: false) | ||
|
|
||
| // Push error to notch | ||
| if self.enableNotchOutput { | ||
| if self.shouldSyncCommandNotchState { | ||
| NotchContentState.shared.addCommandMessage(role: .assistant, content: errorMsg) | ||
| NotchContentState.shared.setCommandProcessing(false) | ||
| self.showExpandedNotchIfNeeded() | ||
|
|
@@ -530,7 +542,8 @@ final class CommandModeService: ObservableObject { | |
|
|
||
| /// Show expanded notch output if there's content to display | ||
| private func showExpandedNotchIfNeeded() { | ||
| guard self.enableNotchOutput else { return } | ||
| guard self.shouldSyncCommandNotchState else { return } | ||
| guard NotchOverlayManager.shared.canShowExpandedCommandOutput else { return } | ||
|
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.
Fresh evidence in this revision is the new Useful? React with 👍 / 👎. |
||
| guard !NotchContentState.shared.commandConversationHistory.isEmpty else { return } | ||
|
|
||
| // Show the expanded notch | ||
|
|
@@ -913,7 +926,7 @@ final class CommandModeService: ObservableObject { | |
| self.streamingText = fullContent | ||
|
|
||
| // Push to notch for real-time display | ||
| if self.enableNotchOutput { | ||
| if self.shouldSyncCommandNotchState { | ||
| NotchContentState.shared.updateCommandStreamingText(fullContent) | ||
| } | ||
| } | ||
|
|
@@ -929,7 +942,7 @@ final class CommandModeService: ObservableObject { | |
| let fullContent = self.streamingBuffer.joined() | ||
| if !fullContent.isEmpty { | ||
| self.streamingText = fullContent | ||
| if self.enableNotchOutput { | ||
| if self.shouldSyncCommandNotchState { | ||
| NotchContentState.shared.updateCommandStreamingText(fullContent) | ||
| } | ||
| } | ||
|
|
@@ -946,7 +959,7 @@ final class CommandModeService: ObservableObject { | |
| self.thinkingBuffer = [] // Clear thinking buffer | ||
|
|
||
| // Clear notch streaming text as well | ||
| if self.enableNotchOutput { | ||
| if self.shouldSyncCommandNotchState { | ||
| NotchContentState.shared.updateCommandStreamingText("") | ||
| } | ||
|
|
||
|
|
||
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.
When sync is disabled by presentation policy, this branch clears all notch command output state. If the user later re-enables standard notch mode, there is no automatic settings-change resync path, so expanded command output remains empty (and cannot open from existing history) until a new message or chat reload occurs. This makes mode toggling appear to lose the current conversation in notch UI.
Useful? React with 👍 / 👎.