Persist editor drafts for hot exit (#4499)
Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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 ────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user