mirror of
https://github.com/immich-app/immich.git
synced 2025-12-16 09:13:13 +03:00
chore(web): minor UX improvements of "view asset owners" feature (#24319)
* feat: toggle in options modal
* feat(i18n): add labels to display who uploaded each asset and show asset owners
* feat: migrate asset owner settings to TimelineManager and update AlbumOptionsModal
* Revert "feat(i18n): add labels to display who uploaded each asset and show asset owners"
This reverts commit cf8f4eb135.
* fix: simplify AlbumOptionsModal invocation and update aria-label for asset owners
* feat(i18n): add label for viewing asset owners in the interface
* feat: add tests for showAssetOwners functionality in TimelineManager
* chore: move asset owner visibility toggle to kebabu menu
This commit is contained in:
@@ -692,4 +692,42 @@ describe('TimelineManager', () => {
|
||||
expect(discoveredAssets.size).toBe(assetCount);
|
||||
});
|
||||
});
|
||||
|
||||
describe('showAssetOwners', () => {
|
||||
const LS_KEY = 'album-show-asset-owners';
|
||||
|
||||
beforeEach(() => {
|
||||
// ensure clean state
|
||||
globalThis.localStorage?.removeItem(LS_KEY);
|
||||
});
|
||||
|
||||
it('defaults to false', () => {
|
||||
const timelineManager = new TimelineManager();
|
||||
expect(timelineManager.showAssetOwners).toBe(false);
|
||||
});
|
||||
|
||||
it('setShowAssetOwners updates value', () => {
|
||||
const timelineManager = new TimelineManager();
|
||||
timelineManager.setShowAssetOwners(true);
|
||||
expect(timelineManager.showAssetOwners).toBe(true);
|
||||
timelineManager.setShowAssetOwners(false);
|
||||
expect(timelineManager.showAssetOwners).toBe(false);
|
||||
});
|
||||
|
||||
it('toggleShowAssetOwners flips value', () => {
|
||||
const timelineManager = new TimelineManager();
|
||||
expect(timelineManager.showAssetOwners).toBe(false);
|
||||
timelineManager.toggleShowAssetOwners();
|
||||
expect(timelineManager.showAssetOwners).toBe(true);
|
||||
timelineManager.toggleShowAssetOwners();
|
||||
expect(timelineManager.showAssetOwners).toBe(false);
|
||||
});
|
||||
|
||||
it('persists across instances via localStorage', () => {
|
||||
const a = new TimelineManager();
|
||||
a.setShowAssetOwners(true);
|
||||
const b = new TimelineManager();
|
||||
expect(b.showAssetOwners).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user