Files
mule-image/web/src/lib/queryClient.ts
dtoro 0f65bfb94a feat(web): native favorites, lightbox zoom, EXIF jump links + perf fix
- Favorites use PhotoPrism's own like/unlike endpoint (not a mule-only
  mark) so they sync to third-party gallery apps, with heart controls
  in the tile, sidebar, and an `f` shortcut.
- Lightbox: wheel-zoom around cursor, double-click to 2.5x, drag-to-pan,
  auto-upgrades to the fit_2048 tile past 1.25x zoom.
- Sidebar: copy-EXIF button, clickable Camera/Lens values that jump to
  a filtered timeline (camera:/lens: DSL), matching the existing
  Country link.
- Fix filtersToQ() quoting the entire search string whenever it
  contained a colon, which silently turned any raw DSL operator
  (camera:, taken:2024, etc.) into a literal phrase search — discovered
  while verifying the new jump-links against production.
- Disable TanStack Query's refetchOnWindowFocus: the indexer WebSocket
  already invalidates photo queries on real changes, so the focus
  refetch was just a redundant full-timeline re-render on tab-switch.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-03 21:56:49 +02:00

21 lines
692 B
TypeScript

import { QueryClient } from '@tanstack/svelte-query';
/**
* App-wide QueryClient singleton. `+layout.svelte` wires it into the
* provider; non-component code (Svelte actions, keyboard handlers) imports
* it directly to read cached photo state and invalidate after mutations.
*/
export const queryClient = new QueryClient({
defaultOptions: {
queries: {
staleTime: 30_000,
retry: 1,
// The indexer WebSocket (stores/indexer.svelte.ts) already
// invalidates ['photos'] and friends on live changes, so a
// window-focus refetch only adds a redundant full-timeline
// re-render (visible flash) every time the tab regains focus.
refetchOnWindowFocus: false
}
}
});