diff --git a/frontend/editor/src/core/services/fileStorage.ts b/frontend/editor/src/core/services/fileStorage.ts index 7bca9f404f..739739809d 100644 --- a/frontend/editor/src/core/services/fileStorage.ts +++ b/frontend/editor/src/core/services/fileStorage.ts @@ -40,8 +40,8 @@ export interface StoredStirlingFileRecord extends BaseFileMetadata { // detectable without hashing. Only meaningful alongside localFilePath. diskSyncedSize?: number; diskSyncedModifiedMs?: number; - // Path this file used to be backed by, once its original is gone. Persisted so - // the "not on disk" state survives a reload instead of dying with the toast. + // Disk path whose original is gone. Persisted so the "not on disk" state + // survives a reload instead of dying with the toast. orphanedFilePath?: string; // Epoch ms of an unresolved disk-vs-unsaved-edits divergence. diskConflictAt?: number; diff --git a/frontend/editor/src/core/services/pruneMissingRecentFiles.ts b/frontend/editor/src/core/services/pruneMissingRecentFiles.ts index 670fb6f927..f5c4eefbc8 100644 --- a/frontend/editor/src/core/services/pruneMissingRecentFiles.ts +++ b/frontend/editor/src/core/services/pruneMissingRecentFiles.ts @@ -29,7 +29,7 @@ export function isPristineLocalPassthrough(stub: StirlingFileStub): boolean { export interface DetachedOpenFile { id: FileId; name: string; - /** Where it used to live, so the caller can record it as the orphaned path. */ + /** The now-dead disk path, so the caller can record it as the orphaned path. */ path: string; } diff --git a/frontend/editor/src/core/tests/stubbed/disk-link-capture.spec.ts b/frontend/editor/src/core/tests/stubbed/disk-link-capture.spec.ts index 93db5be676..0e5886009e 100644 --- a/frontend/editor/src/core/tests/stubbed/disk-link-capture.spec.ts +++ b/frontend/editor/src/core/tests/stubbed/disk-link-capture.spec.ts @@ -358,26 +358,26 @@ for (const theme of ["light", "dark"] as const) { await page.emulateMedia({ colorScheme: theme }); await installTauri(page); - // ---- 1. everything in sync ------------------------------------------- + // 1. Everything in sync await gotoFiles(page); await stage(page, ALL_PRESENT, THREE_FILES); await shoot(page, "01_in_sync", theme); - // ---- 3. deleted while the app was closed ------------------------------ + // 3. Deleted while the app was closed // (before 2, because 2 leaves the workbench populated) const withoutArchived = { ...ALL_PRESENT }; delete withoutArchived[P.archived]; await stage(page, withoutArchived, THREE_FILES); await shoot(page, "03_pruned_after_delete", theme); - // ---- 2. edited in another app ---------------------------------------- + // 2. Edited in another app await stage(page, ALL_PRESENT, THREE_FILES); await editOnDisk(page, P.report, PDF_LARGE); await openCard(page, "quarterly-report.pdf"); await page.waitForTimeout(2500); await shoot(page, "02_external_edit_picked_up", theme); - // ---- 4. deleted between listing and clicking -------------------------- + // 4. Deleted between listing and clicking await stage(page, ALL_PRESENT, THREE_FILES); // The list-time check has already passed; now it goes. await deleteOnDisk(page, P.notes); @@ -385,7 +385,7 @@ for (const theme of ["light", "dark"] as const) { await page.waitForTimeout(2000); await shoot(page, "04_vanished_on_open", theme); - // ---- 5. deleted while open, caught live by the watcher ---------------- + // 5. Deleted while open, caught live by the watcher await stage(page, ALL_PRESENT, THREE_FILES); await openCard(page, "archived.pdf"); await page.waitForTimeout(1500); @@ -399,7 +399,7 @@ for (const theme of ["light", "dark"] as const) { await page.waitForTimeout(2000); await shoot(page, "05b_orphaned_badge", theme); - // ---- 6. disk moved on while unsaved edits were held ------------------- + // 6. Disk moved on while unsaved edits were held await stage(page, ALL_PRESENT, [ { ...THREE_FILES[0], isDirty: true }, THREE_FILES[1], diff --git a/frontend/editor/src/core/types/fileContext.ts b/frontend/editor/src/core/types/fileContext.ts index 99b734a1a3..dafb5bc5cc 100644 --- a/frontend/editor/src/core/types/fileContext.ts +++ b/frontend/editor/src/core/types/fileContext.ts @@ -54,8 +54,8 @@ export interface StirlingFileStub extends BaseFileMetadata { // one of them, which is how a stale stored copy is spotted without hashing. diskSyncedSize?: number; diskSyncedModifiedMs?: number; - // Path this file used to be backed by, kept when the original is deleted so - // the badge keeps saying "not on disk" long after the toast has gone. + // Disk path whose original is deleted, kept so the badge keeps saying "not on + // disk" long after the toast has gone. orphanedFilePath?: string; // Epoch ms of an unresolved divergence: disk moved on while we held unsaved // edits, so two real versions exist and the user has not picked one yet. diff --git a/frontend/editor/src/desktop/components/fileEditor/FileEditorStatusDot.tsx b/frontend/editor/src/desktop/components/fileEditor/FileEditorStatusDot.tsx index 1fcff2a0b2..14e98aacf0 100644 --- a/frontend/editor/src/desktop/components/fileEditor/FileEditorStatusDot.tsx +++ b/frontend/editor/src/desktop/components/fileEditor/FileEditorStatusDot.tsx @@ -11,7 +11,7 @@ interface FileEditorStatusDotProps { export function FileEditorStatusDot({ file }: FileEditorStatusDotProps) { const { t } = useTranslation(); - // Orphaned needs its own case: it used to read "not saved to disk", making a + // Orphaned needs its own case: sharing "not saved to disk" would make a // deleted original indistinguishable from a file never saved. const { label, color } = (() => { switch (diskLinkState(file)) {