feat(web): persist state of file path information in details panel (#27770)

feat(enhancement): persist state of file path info in details panel
This commit is contained in:
Andreas Heinz
2026-04-13 19:18:34 +02:00
committed by GitHub
parent 95e57a24cb
commit bfcf34d8b5
2 changed files with 15 additions and 5 deletions
@@ -9,6 +9,7 @@ import type { ZoomImageWheelState } from '@zoom-image/core';
import { cubicOut } from 'svelte/easing';
const isShowDetailPanel = new PersistedLocalStorage<boolean>('asset-viewer-state', false);
const isShowAssetPath = new PersistedLocalStorage<boolean>('asset-viewer-show-path', false);
const createDefaultZoomState = (): ZoomImageWheelState => ({
currentRotation: 0,
@@ -63,6 +64,10 @@ class AssetViewerManager extends BaseEventManager<Events> {
return isShowDetailPanel.current;
}
get isShowAssetPath() {
return isShowAssetPath.current;
}
get isFaceEditMode() {
return this.#isFaceEditMode;
}
@@ -101,6 +106,10 @@ class AssetViewerManager extends BaseEventManager<Events> {
isShowDetailPanel.current = value;
}
private set isShowAssetPath(value: boolean) {
isShowAssetPath.current = value;
}
onZoomChange(state: ZoomImageWheelState) {
// bypass event emitter to avoid loop
this.#zoomState = state;
@@ -147,6 +156,10 @@ class AssetViewerManager extends BaseEventManager<Events> {
this.isShowActivityPanel = false;
}
toggleAssetPath() {
this.isShowAssetPath = !this.isShowAssetPath;
}
toggleDetailPanel() {
this.closeActivityPanel();
this.isShowDetailPanel = !this.isShowDetailPanel;