mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat(web): show available shortcuts (#3342)
* feat(web): show available shortcuts * pr feeback * feat: new shortcut for deselect * fix: remove new shortcut * responsive
This commit is contained in:
parent
111372edc1
commit
b83e535010
2 changed files with 88 additions and 0 deletions
|
|
@ -30,6 +30,7 @@
|
|||
import { goto } from '$app/navigation';
|
||||
import { browser } from '$app/environment';
|
||||
import { isSearchEnabled } from '$lib/stores/search.store';
|
||||
import ShowShortcuts from '../shared-components/show-shortcuts.svelte';
|
||||
|
||||
export let user: UserResponseDto | undefined = undefined;
|
||||
export let isAlbumSelectionMode = false;
|
||||
|
|
@ -39,6 +40,7 @@
|
|||
let viewportWidth = 0;
|
||||
let assetGridElement: HTMLElement;
|
||||
let bucketInfo: AssetCountByTimeBucketResponseDto;
|
||||
let showShortcuts = false;
|
||||
|
||||
const onKeyboardPress = (event: KeyboardEvent) => handleKeyboardPress(event);
|
||||
|
||||
|
|
@ -93,6 +95,9 @@
|
|||
|
||||
if (!$isViewingAssetStoreState) {
|
||||
switch (event.key) {
|
||||
case '?':
|
||||
if (event.shiftKey) showShortcuts = !showShortcuts;
|
||||
return;
|
||||
case '/':
|
||||
goto(AppRoute.EXPLORE);
|
||||
return;
|
||||
|
|
@ -290,6 +295,10 @@
|
|||
|
||||
<svelte:window on:keydown={onKeyDown} on:keyup={onKeyUp} on:selectstart={onSelectStart} />
|
||||
|
||||
{#if showShortcuts}
|
||||
<ShowShortcuts on:close={() => (showShortcuts = !showShortcuts)} />
|
||||
{/if}
|
||||
|
||||
{#if bucketInfo && viewportHeight && $assetGridState.timelineHeight > viewportHeight}
|
||||
<Scrollbar
|
||||
scrollbarHeight={viewportHeight}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue