diff --git a/i18n/en.json b/i18n/en.json index e2957372a1..2abc586c23 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -760,6 +760,7 @@ "getting_started": "Getting Started", "go_back": "Go back", "go_to_search": "Go to search", + "go_to_folder": "Go to folder", "group_albums_by": "Group albums by...", "group_no": "No grouping", "group_owner": "Group by owner", @@ -1343,4 +1344,4 @@ "yes": "Yes", "you_dont_have_any_shared_links": "You don't have any shared links", "zoom_image": "Zoom Image" -} +} \ No newline at end of file diff --git a/web/src/lib/components/asset-viewer/detail-panel.svelte b/web/src/lib/components/asset-viewer/detail-panel.svelte index 9908630233..3b38734897 100644 --- a/web/src/lib/components/asset-viewer/detail-panel.svelte +++ b/web/src/lib/components/asset-viewer/detail-panel.svelte @@ -132,6 +132,14 @@ showEditFaces = false; }; + const getAssetFolderHref = (asset: AssetResponseDto) => { + const folderUrl = new URL(AppRoute.FOLDERS, globalThis.location.href); + // Remove the last part of the path to get the parent path + const assetParentPath = asset.originalPath.split('/').slice(0, -1).join('/'); + folderUrl.searchParams.set(QueryParameter.PATH, assetParentPath); + return folderUrl.href; + }; + const toggleAssetPath = () => (showAssetPath = !showAssetPath); let isShowChangeDate = $state(false); @@ -369,9 +377,14 @@ {/if}

{#if showAssetPath} -

- {asset.originalPath} -

+ +

+ {asset.originalPath} +

+
{/if} {#if (asset.exifInfo?.exifImageHeight && asset.exifInfo?.exifImageWidth) || asset.exifInfo?.fileSizeInByte}
diff --git a/web/src/lib/stores/folders.svelte.ts b/web/src/lib/stores/folders.svelte.ts index cff7aea455..f3b237f8a2 100644 --- a/web/src/lib/stores/folders.svelte.ts +++ b/web/src/lib/stores/folders.svelte.ts @@ -27,6 +27,17 @@ class FoldersStore { this.uniquePaths.sort(); } + bustAssetCache() { + this.assets = {}; + } + + async refreshAssetsByPath(path: string | null) { + if (!path) { + return; + } + this.assets[path] = await getAssetsByOriginalPath({ path }); + } + async fetchAssetsByPath(path: string) { if (this.assets[path]) { return; diff --git a/web/src/routes/(user)/folders/[[photos=photos]]/[[assetId=id]]/+page.svelte b/web/src/routes/(user)/folders/[[photos=photos]]/[[assetId=id]]/+page.svelte index 5f830e03fc..900c0a753d 100644 --- a/web/src/routes/(user)/folders/[[photos=photos]]/[[assetId=id]]/+page.svelte +++ b/web/src/routes/(user)/folders/[[photos=photos]]/[[assetId=id]]/+page.svelte @@ -1,5 +1,5 @@ +{#if assetInteraction.selectionActive} +
+ cancelMultiselect(assetInteraction)} + > + + + + + + + + + + + + + + {#if $preferences.tags.enabled && assetInteraction.isAllUserOwned} + + {/if} + +
+ +
+
+
+{/if} + {#snippet sidebar()} @@ -78,13 +138,7 @@ {#if data.pathAssets && data.pathAssets.length > 0}
- +
{/if} diff --git a/web/src/routes/(user)/folders/[[photos=photos]]/[[assetId=id]]/+page.ts b/web/src/routes/(user)/folders/[[photos=photos]]/[[assetId=id]]/+page.ts index d6fc683c08..0d23ba32df 100644 --- a/web/src/routes/(user)/folders/[[photos=photos]]/[[assetId=id]]/+page.ts +++ b/web/src/routes/(user)/folders/[[photos=photos]]/[[assetId=id]]/+page.ts @@ -19,6 +19,10 @@ export const load = (async ({ params, url }) => { if (path) { await foldersStore.fetchAssetsByPath(path); pathAssets = foldersStore.assets[path] || null; + } else { + // If no path is provided, we we're at the root level + // We should bust the asset cache of the folder store, to make sure we don't show stale data + foldersStore.bustAssetCache(); } let tree = buildTree(foldersStore.uniquePaths);