From b33cb5fe3fe5c0c882a862aae2eabadb88afb7ce Mon Sep 17 00:00:00 2001 From: Sam Holton Date: Mon, 11 Mar 2024 12:45:01 -0400 Subject: [PATCH] feat(web): add preference for thumbnail playback on hover (#7831) * feat(web): add preference for thumbnail playback on hover * pr feedback, add user settings behavior setting * user settings consistency * rename appearance to app settings * collapse single trash setting into app settings --- .../assets/thumbnail/thumbnail.svelte | 4 +++- ...ce-settings.svelte => app-settings.svelte} | 18 ++++++++++++++- .../user-settings-page/trash-settings.svelte | 23 ------------------- .../user-settings-list.svelte | 13 ++++------- web/src/lib/stores/preferences.store.ts | 2 ++ 5 files changed, 26 insertions(+), 34 deletions(-) rename web/src/lib/components/user-settings-page/{appearance-settings.svelte => app-settings.svelte} (84%) delete mode 100644 web/src/lib/components/user-settings-page/trash-settings.svelte diff --git a/web/src/lib/components/assets/thumbnail/thumbnail.svelte b/web/src/lib/components/assets/thumbnail/thumbnail.svelte index 18bef1c627..796be13be7 100644 --- a/web/src/lib/components/assets/thumbnail/thumbnail.svelte +++ b/web/src/lib/components/assets/thumbnail/thumbnail.svelte @@ -6,6 +6,7 @@ import { getAltText } from '$lib/utils/thumbnail-util'; import { timeToSeconds } from '$lib/utils/date-time'; import { AssetTypeEnum, ThumbnailFormat, type AssetResponseDto } from '@immich/sdk'; + import { playVideoThumbnailOnHover } from '$lib/stores/preferences.store'; import { mdiArchiveArrowDownOutline, mdiCameraBurst, @@ -194,9 +195,10 @@
{/if} diff --git a/web/src/lib/components/user-settings-page/appearance-settings.svelte b/web/src/lib/components/user-settings-page/app-settings.svelte similarity index 84% rename from web/src/lib/components/user-settings-page/appearance-settings.svelte rename to web/src/lib/components/user-settings-page/app-settings.svelte index 0326cab415..1d14e5776c 100644 --- a/web/src/lib/components/user-settings-page/appearance-settings.svelte +++ b/web/src/lib/components/user-settings-page/app-settings.svelte @@ -4,7 +4,7 @@ import SettingSwitch from '$lib/components/shared-components/settings/setting-switch.svelte'; import { fallbackLocale, locales } from '$lib/constants'; import { sidebarSettings } from '$lib/stores/preferences.store'; - import { alwaysLoadOriginalFile } from '$lib/stores/preferences.store'; + import { alwaysLoadOriginalFile, playVideoThumbnailOnHover, showDeleteModal } from '$lib/stores/preferences.store'; import { colorTheme, locale } from '$lib/stores/preferences.store'; import { findLocale } from '$lib/utils'; import { onMount } from 'svelte'; @@ -104,6 +104,22 @@ on:toggle={() => ($alwaysLoadOriginalFile = !$alwaysLoadOriginalFile)} /> +
+ ($playVideoThumbnailOnHover = !$playVideoThumbnailOnHover)} + /> +
+ +
+ +
- import { showDeleteModal } from '$lib/stores/preferences.store'; - import { fade } from 'svelte/transition'; - import SettingSwitch from '$lib/components/shared-components/settings/setting-switch.svelte'; - - -
-
-
-
-
- -
-
-
-
-
- -
diff --git a/web/src/lib/components/user-settings-page/user-settings-list.svelte b/web/src/lib/components/user-settings-page/user-settings-list.svelte index b46768c3e7..a0eaa8cb47 100644 --- a/web/src/lib/components/user-settings-page/user-settings-list.svelte +++ b/web/src/lib/components/user-settings-page/user-settings-list.svelte @@ -6,13 +6,12 @@ import { oauth } from '$lib/utils'; import { type ApiKeyResponseDto, type AuthDeviceResponseDto } from '@immich/sdk'; import SettingAccordion from '../shared-components/settings/setting-accordion.svelte'; - import AppearanceSettings from './appearance-settings.svelte'; + import AppSettings from './app-settings.svelte'; import ChangePasswordSettings from './change-password-settings.svelte'; import DeviceList from './device-list.svelte'; import MemoriesSettings from './memories-settings.svelte'; import OAuthSettings from './oauth-settings.svelte'; import PartnerSettings from './partner-settings.svelte'; - import TrashSettings from './trash-settings.svelte'; import UserAPIKeyList from './user-api-key-list.svelte'; import UserProfileSettings from './user-profile-settings.svelte'; import SettingAccordionState from '../shared-components/settings/setting-accordion-state.svelte'; @@ -26,8 +25,8 @@ - - + + @@ -42,7 +41,7 @@ - + @@ -59,8 +58,4 @@ - - - - diff --git a/web/src/lib/stores/preferences.store.ts b/web/src/lib/stores/preferences.store.ts index 49b836b8a8..ff158722e4 100644 --- a/web/src/lib/stores/preferences.store.ts +++ b/web/src/lib/stores/preferences.store.ts @@ -96,3 +96,5 @@ export const albumViewSettings = persisted('album-view-settin export const showDeleteModal = persisted('delete-confirm-dialog', true, {}); export const alwaysLoadOriginalFile = persisted('always-load-original-file', false, {}); + +export const playVideoThumbnailOnHover = persisted('play-video-thumbnail-on-hover', true, {});