diff --git a/frontend/src/lib/components/ResourceList.svelte b/frontend/src/lib/components/ResourceList.svelte index 47d37647..8be57b8a 100644 --- a/frontend/src/lib/components/ResourceList.svelte +++ b/frontend/src/lib/components/ResourceList.svelte @@ -163,6 +163,17 @@ * the action is meaningful for and returns nothing otherwise. */ bucketAction?: Snippet<[string]>; + /** + * Optional custom renderer for the swimlane header label. Receives + * the bucket key + the default label string (from `labelOf`, or + * the key itself if no `labelOf`). Pages that want rich header + * content (e.g. `/shared-with-me` prefixing the "Shared by X" + * header with the sharer's avatar) use this; pages happy with + * a plain text label leave it undefined and ResourceList renders + * `{section.label}` as before. The default label is passed too + * so pages don't have to re-invoke `labelOf` themselves. + */ + bucketLabel?: Snippet<[string, string]>; /** Show the owner column + vignette (list view) and hover tooltip. */ showOwner?: boolean; /** @@ -248,6 +259,20 @@ * don't have to piggyback on the bar. */ itemActions?: Snippet<[FileItem | FolderItem]>; + /** + * Free-form overlay rendered inside `.file-item` (as a sibling of + * `.action-cell`), so the page can absolute-position content + * anywhere on the card. Used by `/shared-with-me` to anchor the + * sharer avatar at the bottom-right of the card — the pre-fix + * `rowBadge` slot rendered inside `.file-icon` (a positioned + * ancestor), which couldn't align with `.action-cell`'s + * `.file-item`-scoped coordinates. The page provides its own + * absolute-positioning CSS via a scoped style block. + * + * Fires in grid view only — list view has explicit columns + * (owner cell, etc.) for the same information. + */ + cardOverlay?: Snippet<[FileItem | FolderItem, ItemContext | undefined]>; /** * Action-bar left cluster — always-visible page action buttons * (Upload / New folder / Empty trash / Clear recent / …). Swaps @@ -385,6 +410,7 @@ dateLabel, dateCell, bucketAction, + bucketLabel, showOwner = false, ownerLabel, showViewToggle = true, @@ -402,6 +428,7 @@ oncontextmenu: onContextMenuOverride, menuPrepare, itemActions, + cardOverlay, actions, batchActions, rowBadge, @@ -1240,6 +1267,17 @@ {/if} {/if} + + {#if cardOverlay && filesStore.viewMode === 'grid'} + {@render cardOverlay(item, ctx)} + {/if} {/snippet} @@ -1370,7 +1408,13 @@ {#each sections as section (section.key)} {#if section.label}