diff --git a/frontend/src/lib/components/ResourceList.svelte b/frontend/src/lib/components/ResourceList.svelte index 496bf8a2..62007e6a 100644 --- a/frontend/src/lib/components/ResourceList.svelte +++ b/frontend/src/lib/components/ResourceList.svelte @@ -540,6 +540,25 @@ onselectionchange?.(selected); } } + + // Ctrl+A (Linux / Windows) / ⌘+A (macOS) selects every visible row. + // Handled here rather than in each page's own `svelte:window` so all + // consumers get the shortcut for free — /files, /trash, /favorites, + // /recent, /shared-with-me — with identical semantics. Only fires + // when `selectable` is on, and only when the focused element isn't + // a text input (typing inside a search box shouldn't hijack it). + function onSelectAllShortcut(e: KeyboardEvent) { + if (!selectable) return; + if (!(e.ctrlKey || e.metaKey)) return; + if (e.key.toLowerCase() !== 'a') return; + const tag = (e.target as HTMLElement | null)?.tagName; + if (tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT') return; + // Also skip when the focus is inside a contentEditable region + // (rich-text popups, name inline-edit if ever added). + if ((e.target as HTMLElement | null)?.isContentEditable) return; + e.preventDefault(); + toggleSelectAll(); + } // `selectedItems` and the reap-stale effect below stay on the RAW // items — selection persists across a display-filter toggle, and // stale-selection cleanup only fires when items truly leave the @@ -779,9 +798,16 @@ }} /> {/if} + + {#if rowBadge} + + {/if} {item.name} - {#if rowBadge}{@render rowBadge(item, ctx)}{/if} {#if showOwner}