Persist editor drafts for hot exit (#4499)

Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
Jinwoo Hong
2026-06-02 18:49:13 -07:00
committed by GitHub
co-authored by Orca
parent def3374e76
commit c0b573abda
27 changed files with 614 additions and 54 deletions
+3
View File
@@ -1,7 +1,10 @@
export const ORCA_EDITOR_SAVE_DIRTY_FILES_EVENT = 'orca:editor-save-dirty-files'
export const ORCA_EDITOR_PREPARE_HOT_EXIT_EVENT = 'orca:editor-prepare-hot-exit'
export type EditorSaveDirtyFilesDetail = {
claim: () => void
resolve: () => void
reject: (message: string) => void
}
export type EditorPrepareHotExitDetail = EditorSaveDirtyFilesDetail
+2
View File
@@ -656,6 +656,8 @@ export type PersistedOpenFile = {
language: string
isPreview?: boolean
runtimeEnvironmentId?: string | null
/** Unsaved editor buffer captured for hot exit; presence restores the tab dirty. */
dirtyDraftContent?: string
}
export type WorkspaceSessionState = {
+2 -1
View File
@@ -135,7 +135,8 @@ const persistedOpenFileSchema = z.object({
worktreeId: z.string(),
language: z.string(),
isPreview: z.boolean().optional(),
runtimeEnvironmentId: z.string().nullable().optional()
runtimeEnvironmentId: z.string().nullable().optional(),
dirtyDraftContent: z.string().optional()
})
// ─── Browser ────────────────────────────────────────────────────────