Cursor: Apply local changes for cloud agent

This commit is contained in:
Rocky
2026-08-27 18:01:46 +08:00
parent 39002336c0
commit 42e6252f01
148 changed files with 120105 additions and 8122 deletions
@@ -192,6 +192,7 @@ public final class KeyboardViewController: UIInputViewController {
recordMemory("KVC.viewDidLoad.afterInstallSwiftUI")
OSGDiag.log("KVC.viewDidLoad after installSwiftUI \(OSGDiag.memoryTag())", category: "boot")
let configLoadResult = configSync.loadPersistedConfig()
refreshMultipleReplyVariantsSetting()
recordMemory(
"KVC.viewDidLoad.afterConfigLoad",
details: "result=\(configLoadResult)"
@@ -279,6 +280,7 @@ public final class KeyboardViewController: UIInputViewController {
flowCoordinator.startSessionMonitor()
configSync.syncOnboardingStateFromAppGroup()
configSync.refreshConfigFromAppGroup()
refreshMultipleReplyVariantsSetting()
clipboardCapture.refreshFlagsFromStore()
// Settings may have changed while the extension stayed alive.
applyPreferredSurfaceOnOpen()
@@ -456,6 +458,7 @@ public final class KeyboardViewController: UIInputViewController {
// error; never force-create one just to retry.
self?.typingSessionStorage?.reloadPersonalDictionaryTerms()
self?.typingSessionStorage?.retryPrepareAfterResourceDeployment()
self?.refreshMultipleReplyVariantsSetting()
}
)
@@ -594,6 +597,9 @@ public final class KeyboardViewController: UIInputViewController {
state.confirmPendingAIAnswer = { [weak self] in
self?.aiKeyboardCoordinator.confirmPendingAnswer()
}
state.selectAIReplyVariant = { [weak self] id in
self?.aiKeyboardCoordinator.selectReplyVariant(id: id)
}
state.discardPendingAIAnswer = { [weak self] in
self?.aiKeyboardCoordinator.discardPendingAnswer()
}
@@ -635,6 +641,7 @@ public final class KeyboardViewController: UIInputViewController {
}
state.clearClipboardHistory = { [weak self] in
self?.clipboardCapture.clearHistory()
ClipboardReplyFeedbackStore.shared.clear()
}
state.deleteClipboardHistoryEntry = { [weak self] id in
self?.clipboardCapture.deleteEntry(id: id)
@@ -694,6 +701,12 @@ public final class KeyboardViewController: UIInputViewController {
.store(in: &cancellables)
}
/// This App Group property is supplied by the parallel settings module.
/// Reading it here keeps the shared state independent from persistence.
private func refreshMultipleReplyVariantsSetting() {
state.multipleReplyVariantsEnabled = AppGroupStore().multipleReplyVariantsEnabled
}
private func applySurface(_ requestedSurface: State.Surface) {
// `.ai` is retained only to decode preferences written by older builds.
// The product now has one unified assistant surface.