feat(items): clarify column names
This commit is contained in:
@@ -170,6 +170,14 @@
|
||||
bucketAction?: Snippet<[string]>;
|
||||
/** Show the owner column + vignette (list view) and hover tooltip. */
|
||||
showOwner?: boolean;
|
||||
/**
|
||||
* Override the owner column header (and the hover-tooltip prefix). The
|
||||
* default reads "Created by", matching the semantic of `created_by` used
|
||||
* on /files, /favorites, /recent. /shared-with-me overrides to
|
||||
* "Shared by" since the column there actually renders `granted_by`
|
||||
* (the sharer, not the resource author).
|
||||
*/
|
||||
ownerLabel?: string;
|
||||
/** Allow grid/list toggle (shares the app-wide view mode). */
|
||||
showViewToggle?: boolean;
|
||||
/** Show the dotfile-visibility eye toggle in the toolbar AND
|
||||
@@ -362,6 +370,7 @@
|
||||
dateCell,
|
||||
bucketAction,
|
||||
showOwner = false,
|
||||
ownerLabel,
|
||||
showViewToggle = true,
|
||||
showDotfileToggle = false,
|
||||
selectable = false,
|
||||
@@ -865,7 +874,7 @@
|
||||
const owner = ownerId ? (resolveOwnerName?.(ownerId) ?? ownerId) : '';
|
||||
const path = item.path ?? '';
|
||||
return [
|
||||
owner && `${t('files.col_owner', 'Owner')}: ${owner}`,
|
||||
owner && `${ownerLabel ?? t('files.col_created_by', 'Created by')}: ${owner}`,
|
||||
path && `${t('files.col_path', 'Location')}: ${path}`
|
||||
]
|
||||
.filter(Boolean)
|
||||
@@ -1333,13 +1342,15 @@
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
<div>{t('files.col_name', 'Name')}</div>
|
||||
{#if showOwner}<div>{t('files.col_owner', 'Owner')}</div>{/if}
|
||||
{#if showPath}<div>{pathLabel ?? t('files.col_path', 'Location')}</div>{/if}
|
||||
{#if showType}<div>{t('files.col_type', 'Type')}</div>{/if}
|
||||
{#if showSize}<div>{t('files.col_size', 'Size')}</div>{/if}
|
||||
{#if showDate}<div>{dateLabel ?? t('files.col_modified', 'Date')}</div>{/if}
|
||||
{#if hasActionCell}<div></div>{/if}
|
||||
<div class="name-cell">{t('files.col_name', 'Name')}</div>
|
||||
{#if showOwner}<div class="owner-cell">
|
||||
{ownerLabel ?? t('files.col_created_by', 'Created by')}
|
||||
</div>{/if}
|
||||
{#if showPath}<div class="path-cell">{pathLabel ?? t('files.col_path', 'Location')}</div>{/if}
|
||||
{#if showType}<div class="type-cell">{t('files.col_type', 'Type')}</div>{/if}
|
||||
{#if showSize}<div class="size-cell">{t('files.col_size', 'Size')}</div>{/if}
|
||||
{#if showDate}<div class="date-cell">{dateLabel ?? t('files.col_modified', 'Date')}</div>{/if}
|
||||
{#if hasActionCell}<div class="action-cell"></div>{/if}
|
||||
</div>
|
||||
{/snippet}
|
||||
|
||||
|
||||
@@ -266,9 +266,12 @@
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
/* Size column: always nth-child(5) because .owner-cell is always in the DOM
|
||||
(even when hidden via display:none, it still occupies a child slot). */
|
||||
.list-header > div:nth-child(5),
|
||||
/* Column alignment — targets classes on BOTH the header divs AND the value
|
||||
cells, so the header label always matches its column's value alignment
|
||||
regardless of which optional columns (path/type/owner/…) are on. The
|
||||
previous shape keyed off `nth-child(N)` and drifted the moment a
|
||||
ResourceList caller toggled a `show*` prop. */
|
||||
.list-header > .size-cell,
|
||||
.files-list-view .file-item .size-cell {
|
||||
justify-self: end;
|
||||
text-align: right;
|
||||
@@ -325,7 +328,12 @@
|
||||
vignette sized to its content and the cell clipped it flat with
|
||||
no ellipsis. The cell's own `text-overflow` still ellipses
|
||||
plain-text fallback content (cells without a vignette child). */
|
||||
.owner-cell {
|
||||
/* Scoped to `.file-item` so the header div — which also carries the
|
||||
`.owner-cell` class now (so column-alignment CSS keys off classes
|
||||
instead of brittle nth-child indices) — doesn't inherit the muted
|
||||
cell colour / cell font size. Header keeps `.list-header`'s
|
||||
semibold + text colour. */
|
||||
.file-item .owner-cell {
|
||||
color: var(--color-text-secondary);
|
||||
font-size: var(--text-base);
|
||||
display: flex;
|
||||
@@ -427,7 +435,7 @@
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.list-header > div:nth-child(5),
|
||||
.list-header > .date-cell,
|
||||
.files-list-view .file-item .date-cell {
|
||||
justify-self: center;
|
||||
text-align: center;
|
||||
|
||||
@@ -330,6 +330,7 @@
|
||||
onfavorite={unfavorite}
|
||||
showOwner
|
||||
showPath
|
||||
dateLabel={t('files.col_added', 'Added')}
|
||||
selectable
|
||||
{contextActions}
|
||||
menuPrepare={async (item) => {
|
||||
|
||||
@@ -1594,6 +1594,8 @@
|
||||
showOwner
|
||||
showType
|
||||
showDate
|
||||
dateLabel={t('files.col_modified', 'Modified')}
|
||||
showPath={false}
|
||||
showDotfileToggle
|
||||
enableSystemDrop
|
||||
onsystemdrop={onDrop}
|
||||
|
||||
@@ -374,6 +374,7 @@
|
||||
onopen={open}
|
||||
showOwner
|
||||
showPath
|
||||
dateLabel={t('files.col_opened', 'Opened')}
|
||||
showDotfileToggle
|
||||
selectable
|
||||
{contextActions}
|
||||
|
||||
@@ -228,6 +228,8 @@
|
||||
emptyText={t('shared_with_me.empty', 'Nothing has been shared with you yet.')}
|
||||
hasMore={!!cursor}
|
||||
showOwner={true}
|
||||
ownerLabel={t('share.col_shared_by', 'Shared by')}
|
||||
dateLabel={t('share.col_shared', 'Shared')}
|
||||
{groupBys}
|
||||
bind:groupBy
|
||||
bind:reversed
|
||||
|
||||
Reference in New Issue
Block a user