-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Honor iMessage workspace ordering and previews #4062
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
8434fec
d3f2245
d52b580
48845e5
705d7ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4580,7 +4580,7 @@ class TerminalController { | |
| iMessageModeEnabled: iMessageModeEnabled | ||
| ) | ||
| if iMessageModeEnabled { | ||
| preview = tabManager.tabs.first(where: { $0.id == workspaceId })?.latestSubmittedMessage | ||
| preview = tabManager.tabs.first(where: { $0.id == workspaceId })?.latestConversationMessage | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -8413,7 +8413,7 @@ class TerminalController { | |
| } | ||
|
|
||
| CmuxEventBus.shared.publishWorkstreamEvent(event, phase: "received") | ||
| v2ApplyPromptSubmitSideEffects(for: event) | ||
| v2ApplyIMessageModeSideEffects(for: event) | ||
|
|
||
| let result = FeedCoordinator.shared.ingestBlocking( | ||
| event: event, | ||
|
|
@@ -8427,21 +8427,38 @@ class TerminalController { | |
| return .ok(FeedSocketEncoding.payload(for: result)) | ||
| } | ||
|
|
||
| private nonisolated func v2ApplyPromptSubmitSideEffects(for event: WorkstreamEvent) { | ||
| guard event.hookEventName == .userPromptSubmit, | ||
| private nonisolated func v2ApplyIMessageModeSideEffects(for event: WorkstreamEvent) { | ||
| guard event.hookEventName == .userPromptSubmit || event.hookEventName == .stop || event.hookEventName == .subagentStop, | ||
| let rawWorkspaceId = event.workspaceId?.trimmingCharacters(in: .whitespacesAndNewlines), | ||
| !rawWorkspaceId.isEmpty | ||
| else { return } | ||
|
|
||
| let iMessageModeEnabled = IMessageModeSettings.isEnabled() | ||
| v2MainSync { | ||
| guard let workspaceId = v2UUIDAny(rawWorkspaceId) else { return } | ||
| guard let tabManager = AppDelegate.shared?.tabManagerFor(tabId: workspaceId) else { return } | ||
| _ = tabManager.handlePromptSubmit( | ||
| workspaceId: workspaceId, | ||
| message: event.submittedPromptMessage, | ||
| iMessageModeEnabled: iMessageModeEnabled | ||
| ) | ||
| switch event.hookEventName { | ||
| case .userPromptSubmit: | ||
| v2MainSync { | ||
| guard let workspaceId = v2UUIDAny(rawWorkspaceId) else { return } | ||
| guard let tabManager = AppDelegate.shared?.tabManagerFor(tabId: workspaceId) else { return } | ||
| _ = tabManager.handlePromptSubmit( | ||
| workspaceId: workspaceId, | ||
| message: event.submittedPromptMessage, | ||
| iMessageModeEnabled: iMessageModeEnabled | ||
| ) | ||
| } | ||
| case .stop, .subagentStop: | ||
| let assistantFinalMessage = event.assistantFinalMessage | ||
| Task { @MainActor [weak self, rawWorkspaceId, assistantFinalMessage, iMessageModeEnabled] in | ||
| guard let self, | ||
| let workspaceId = self.v2UUIDAny(rawWorkspaceId) else { return } | ||
| guard let tabManager = AppDelegate.shared?.tabManagerFor(tabId: workspaceId) else { return } | ||
| _ = tabManager.handleAssistantFinalMessage( | ||
| workspaceId: workspaceId, | ||
| message: assistantFinalMessage, | ||
| iMessageModeEnabled: iMessageModeEnabled | ||
| ) | ||
| } | ||
|
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. Async stop handling races with synchronous prompt handlingLow Severity The Additional Locations (1)Reviewed by Cursor Bugbot for commit 705d7ec. Configure here. |
||
| default: | ||
| break | ||
| } | ||
| } | ||
|
|
||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.