1
0
mirror of https://github.com/immich-app/immich.git synced 2025-06-27 05:11:11 +02:00

feat(web): assets now have a permanent URL (#8532)

* Remove asest redirect pages

* Rename route paths to handle optional assetId

* Update old references to new routes

* Load and display asset from all routes that can show assetId

* Add <main> in base layout, update portals to target it

* Wire up updating navigation in response to open/close/prev/next

* Replace events with navigation functions

* Add types to param matcher

* misc cleanup

* Fix reload on /search pages

* Avoid loading bar between photos nav. Delay loading bar by 200ms for all navigations

* Update url for maps routes. Note: on page reload, next/prev is not available

* Dynamically load asset-viewer on map page

* When reloading a url with assetUrl, hide background page to prevent flash during load

* Mostly style, review comments

* Load buckets for assets on demand

* Forgot this update call

* typo

* fix test

* Fix carelessness

* Review comment

* merge main

* remove assets

* fix submodule

---------

Co-authored-by: Alex <alex.tran1502@gmail.com>
Co-authored-by: Daniel Dietzler <mail@ddietzler.dev>
This commit is contained in:
Min Idzelis
2024-04-24 15:24:19 -04:00
committed by GitHub
parent 1e004611e4
commit a78260296c
48 changed files with 289 additions and 190 deletions

View File

@ -51,6 +51,7 @@
import PhotoViewer from './photo-viewer.svelte';
import SlideshowBar from './slideshow-bar.svelte';
import VideoViewer from './video-wrapper-viewer.svelte';
import { navigate } from '$lib/utils/navigation';
export let assetStore: AssetStore | null = null;
export let asset: AssetResponseDto;
@ -191,6 +192,7 @@
}
onMount(async () => {
await navigate({ targetRoute: 'current', assetId: asset.id });
slideshowStateUnsubscribe = slideshowState.subscribe((value) => {
if (value === SlideshowState.PlaySlideshow) {
slideshowHistory.reset();
@ -263,11 +265,14 @@
$isShowDetail = !$isShowDetail;
};
const handleCloseViewer = () => {
closeViewer();
const handleCloseViewer = async () => {
await closeViewer();
};
const closeViewer = () => dispatch('close');
const closeViewer = async () => {
dispatch('close');
await navigate({ targetRoute: 'current', assetId: null });
};
const navigateAssetRandom = async () => {
if (!assetStore) {
@ -300,7 +305,7 @@
if ($slideshowState === SlideshowState.PlaySlideshow && assetStore) {
const hasNext =
order === 'previous' ? await assetStore.getPreviousAsset(asset.id) : await assetStore.getNextAsset(asset.id);
order === 'previous' ? await assetStore.getPreviousAsset(asset) : await assetStore.getNextAsset(asset);
if (hasNext) {
$restartSlideshowProgress = true;
} else {