web(review): scope date suggestion to EXIF Stripped tab + 'a' shortcut

- Gate the sidebar's "Suggested from path" row on /review?tab=stripped_exif
  instead of a per-photo TakenSrc heuristic — PhotoPrism stores a guessed
  TakenAt for stripped-EXIF photos too, so the heuristic was hiding the
  row even when a path-derived date was available.
- Same gate on the BulkActionBar's "Accept date & Keep" button.
- Extract acceptDateAndKeep() + cachedPhoto() into photoActions so the
  bar button and a new bare-'a' shortcut in gridKeyNav share one path.
- Show an 'A' kbd hint on the bar button.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-20 11:31:04 +02:00
parent d1ddc48f81
commit 97f51a05c4
4 changed files with 123 additions and 78 deletions

View File

@@ -10,6 +10,7 @@ import {
removeFromHeap,
type PpAlbum
} from '$lib/services/photoprism';
import { acceptDateAndKeep } from '$lib/services/photoActions';
import { queryClient } from '$lib/queryClient';
import { filters } from '$lib/stores/filters.svelte';
import {
@@ -498,6 +499,30 @@ export function gridKeyNav(node: HTMLElement, params: GridKeyNavParams = {}) {
if (meta) {
e.preventDefault();
for (const id of selection.order) selection.ids.add(id);
return;
}
if (shift) return;
// Bare `a` on the EXIF Stripped review tab fires the same
// "Accept date & Keep" flow the bar button uses. Scoped to
// that tab so the key stays free everywhere else (where a
// path-derived date wouldn't make sense as a one-shot
// shortcut). Reads location directly because actions sit
// outside the component tree where `$app/state` is
// idiomatic — same approach used by `filters.section`
// elsewhere in this file.
if (
filters.section === 'review' &&
new URL(window.location.href).searchParams.get('tab') === 'stripped_exif'
) {
e.preventDefault();
const ids = cullTargets();
if (ids.length === 0) {
toast.message('Nothing to keep', {
description: 'Click a photo or select some first'
});
return;
}
void acceptDateAndKeep(ids);
}
return;
case 'x':