Skip to content

Commit df6cd79

Browse files
committed
Onboarding: push failed listings to nav history; cleaner restricted-folder icons
- `FilePane.svelte` now pushes the path to navigation history on listing error too, not only on `listing-complete`. Without this, navigating to a TCC-restricted folder showed the `ErrorPane` but left the path missing from history — Cmd+[ then jumped back two visual steps instead of one. `pushPath` deduplicates same-path retries, so hammering "Try again" doesn't bloat the stack. - `VolumeBreadcrumb.svelte` falls back to the generic Aqua folder icon (the cached `dir` icon) for sidebar entries whose path is in the TCC-restricted set, both in the closed breadcrumb and dropdown rows. `NSWorkspace.iconForFile:` on a TCC-denied path returns a confusing "no access" placeholder; preferring the generic folder icon keeps the favorites visually consistent with the rest of the sidebar.
1 parent 6581f5a commit df6cd79

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

apps/desktop/src/lib/file-explorer/navigation/VolumeBreadcrumb.svelte

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,11 @@
483483
<!-- svelte-ignore a11y_click_events_have_key_events -->
484484
<!-- svelte-ignore a11y_no_static_element_interactions -->
485485
<span class="volume-name" class:is-open={isOpen} onclick={handleToggle}>
486-
{#if currentVolumeIcon}
486+
{#if currentVolume && isRestricted(currentVolume.path) && dirIconFallback}
487+
<!-- TCC-denied paths: `NSWorkspace.iconForFile` returns a confusing "no
488+
access" placeholder. Use the generic Aqua folder icon instead. -->
489+
<img class="icon" src={dirIconFallback} alt="" />
490+
{:else if currentVolumeIcon}
487491
<img class="icon" src={currentVolumeIcon} alt="" />
488492
{:else if volumeId === 'network'}
489493
<span class="icon-emoji">🌐</span>
@@ -579,6 +583,10 @@
579583
<img class="volume-icon" src="/icons/mobile-device.svg" alt="" />
580584
{:else if volume.category === 'network'}
581585
<span class="volume-icon-placeholder">🌐</span>
586+
{:else if isRestricted(volume.path) && dirIconFallback}
587+
<!-- TCC-denied paths: `NSWorkspace.iconForFile` returns a confusing "no
588+
access" placeholder. Use the generic Aqua folder icon instead. -->
589+
<img class="volume-icon" src={dirIconFallback} alt="" />
582590
{:else if volume.icon}
583591
<img class="volume-icon" src={volume.icon} alt="" />
584592
{:else if dirIconFallback}

apps/desktop/src/lib/file-explorer/pane/FilePane.svelte

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,6 +1030,12 @@
10301030
} else {
10311031
// Path exists, or we couldn't tell — show the original listing error
10321032
resetLoadingState(event.payload.message, false, event.payload.friendly)
1033+
// Record the failed path in history so Cmd+[ goes back one step,
1034+
// not two. The success path pushes via the `onPathChange` call in
1035+
// `handleListingComplete`; without this call, an error pane would
1036+
// be visually displayed but absent from history, so Back would
1037+
// skip over it. `pushPath` deduplicates same-path retries.
1038+
onPathChange?.(loadPath)
10331039
}
10341040
})
10351041
}

0 commit comments

Comments
 (0)