- add toggle to show/hide asset owner names

This commit is contained in:
CJPeckover 2025-08-25 19:55:25 -04:00
parent 55a196bfa0
commit 6e0005acfd
4 changed files with 26 additions and 8 deletions

View file

@ -273,7 +273,7 @@
{#if !!assetOwner} {#if !!assetOwner}
<div class="absolute bottom-0 end-1"> <div class="absolute bottom-0 end-1">
<span class="text-white font-light">{assetOwner.name}</span> <span class="text-white font-light text-sm">{assetOwner.name}</span>
</div> </div>
{/if} {/if}

View file

@ -27,7 +27,6 @@
timelineManager: TimelineManager; timelineManager: TimelineManager;
assetInteraction: AssetInteraction; assetInteraction: AssetInteraction;
albumUsers?: UserResponseDto[]; albumUsers?: UserResponseDto[];
onSelect: ({ title, assets }: { title: string; assets: TimelineAsset[] }) => void; onSelect: ({ title, assets }: { title: string; assets: TimelineAsset[] }) => void;
onSelectAssets: (asset: TimelineAsset) => void; onSelectAssets: (asset: TimelineAsset) => void;
onSelectAssetCandidates: (asset: TimelineAsset | null) => void; onSelectAssetCandidates: (asset: TimelineAsset | null) => void;

View file

@ -31,11 +31,11 @@
import { navigate } from '$lib/utils/navigation'; import { navigate } from '$lib/utils/navigation';
import { getTimes, toTimelineAsset, type ScrubberListener, type TimelineYearMonth } from '$lib/utils/timeline-util'; import { getTimes, toTimelineAsset, type ScrubberListener, type TimelineYearMonth } from '$lib/utils/timeline-util';
import { import {
AlbumUserRole,
AssetVisibility, AssetVisibility,
getAssetInfo, getAssetInfo,
type AlbumResponseDto, type AlbumResponseDto,
type PersonResponseDto, type PersonResponseDto,
type UserResponseDto,
} from '@immich/sdk'; } from '@immich/sdk';
import { modalManager } from '@immich/ui'; import { modalManager } from '@immich/ui';
import { DateTime } from 'luxon'; import { DateTime } from 'luxon';
@ -65,6 +65,7 @@
showArchiveIcon?: boolean; showArchiveIcon?: boolean;
isShared?: boolean; isShared?: boolean;
album?: AlbumResponseDto | null; album?: AlbumResponseDto | null;
albumUsers?: UserResponseDto[];
person?: PersonResponseDto | null; person?: PersonResponseDto | null;
isShowDeleteConfirmation?: boolean; isShowDeleteConfirmation?: boolean;
onSelect?: (asset: TimelineAsset) => void; onSelect?: (asset: TimelineAsset) => void;
@ -84,6 +85,7 @@
showArchiveIcon = false, showArchiveIcon = false,
isShared = false, isShared = false,
album = null, album = null,
albumUsers = [],
person = null, person = null,
isShowDeleteConfirmation = $bindable(false), isShowDeleteConfirmation = $bindable(false),
onSelect = () => {}, onSelect = () => {},
@ -94,11 +96,11 @@
let { isViewing: showAssetViewer, asset: viewingAsset, preloadAssets, gridScrollTarget, mutex } = assetViewingStore; let { isViewing: showAssetViewer, asset: viewingAsset, preloadAssets, gridScrollTarget, mutex } = assetViewingStore;
const albumUsers = $derived( // const albumUsers = $derived(
album?.shared && album.albumUsers.some(({ role }) => role === AlbumUserRole.Editor) // album?.shared && album.albumUsers.some(({ role }) => role === AlbumUserRole.Editor)
? [album.owner, ...album.albumUsers.map(({ user }) => user)] // ? [album.owner, ...album.albumUsers.map(({ user }) => user)]
: [], // : [],
); // );
let element: HTMLElement | undefined = $state(); let element: HTMLElement | undefined = $state();

View file

@ -71,6 +71,7 @@
} from '@immich/sdk'; } from '@immich/sdk';
import { Button, IconButton, modalManager } from '@immich/ui'; import { Button, IconButton, modalManager } from '@immich/ui';
import { import {
mdiAccountEyeOutline,
mdiArrowLeft, mdiArrowLeft,
mdiCogOutline, mdiCogOutline,
mdiDeleteOutline, mdiDeleteOutline,
@ -104,6 +105,7 @@
let isCreatingSharedAlbum = $state(false); let isCreatingSharedAlbum = $state(false);
let isShowActivity = $state(false); let isShowActivity = $state(false);
let albumOrder: AssetOrder | undefined = $state(data.album.order); let albumOrder: AssetOrder | undefined = $state(data.album.order);
let showAlbumUsers = $state(false);
const assetInteraction = new AssetInteraction(); const assetInteraction = new AssetInteraction();
const timelineInteraction = new AssetInteraction(); const timelineInteraction = new AssetInteraction();
@ -321,6 +323,11 @@
let album = $derived(data.album); let album = $derived(data.album);
let albumId = $derived(album.id); let albumId = $derived(album.id);
const albumUsers = $derived(
showAlbumUsers && album?.shared && album.albumUsers.some(({ role }) => role === AlbumUserRole.Editor)
? [album.owner, ...album.albumUsers.map(({ user }) => user)]
: [],
);
$effect(() => { $effect(() => {
if (!album.isActivityEnabled && activityManager.commentCount === 0) { if (!album.isActivityEnabled && activityManager.commentCount === 0) {
@ -445,6 +452,7 @@
<AssetGrid <AssetGrid
enableRouting={viewMode === AlbumPageViewMode.SELECT_ASSETS ? false : true} enableRouting={viewMode === AlbumPageViewMode.SELECT_ASSETS ? false : true}
{album} {album}
{albumUsers}
{timelineManager} {timelineManager}
assetInteraction={currentAssetIntersection} assetInteraction={currentAssetIntersection}
{isShared} {isShared}
@ -615,6 +623,15 @@
{#snippet trailing()} {#snippet trailing()}
<CastButton /> <CastButton />
<IconButton
variant="ghost"
shape="round"
color="secondary"
aria-label="view asset owners"
icon={mdiAccountEyeOutline}
onclick={() => (showAlbumUsers = !showAlbumUsers)}
/>
{#if isEditor} {#if isEditor}
<IconButton <IconButton
variant="ghost" variant="ghost"