Rewrite disk-link comments to satisfy comment-lint

This commit is contained in:
Anthony Stirling
2026-08-30 11:34:59 +01:00
parent b1ae80186d
commit bb1bad1b5f
5 changed files with 12 additions and 12 deletions
@@ -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;
@@ -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;
}
@@ -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],
@@ -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.
@@ -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)) {