refactor(slideshow): watermark look lives only in global settings (+ size)

The watermark look (logo / position / opacity / style) was configurable in three
places — the global Settings tab, the per-event-type preset, and the per-event
card. Consolidate it to ONE: the global Settings -> Slideshow tab. Per-event and
per-event-type now carry only the watermark MODE (inherit / on / off) — the
override structure — and render with the global look.

- New global "Size (% of screen)" control (slideshow_watermark_size, vmin-based)
  so the logo can be scaled; resolved server-side into the watermark payload and
  applied to the kiosk <img>.
- Backend slideshowSettings resolves the whole look from app_settings always;
  per-event show_watermark only toggles enabled. adminEvents PATCH + type-preset
  seeding no longer accept/seed per-event look fields; unused enums removed.
- Frontend SlideshowStyle drops the look fields (mode only); SlideshowStyleFields
  watermark section is a single mode select with a "configured under Settings"
  hint; SlideshowSettingsCard + Event type cleaned up.
- en/de: watermarkSizeLabel + watermarkModeHint.

(events.show_watermark_{source,position,opacity,style} columns from migration
138 are left in place but inert — the look is global now.)
This commit is contained in:
Luca
2026-06-20 10:46:27 +02:00
parent 69367b45be
commit 0166dc9658
13 changed files with 61 additions and 145 deletions
-4
View File
@@ -157,10 +157,6 @@ export const eventsService = {
show_transition?: string;
show_transition_ms?: number;
show_watermark?: boolean | null;
show_watermark_source?: string;
show_watermark_position?: string;
show_watermark_opacity?: number;
show_watermark_style?: string;
show_colorfilter?: string;
}
): Promise<Record<string, unknown>> {
+10 -10
View File
@@ -23,15 +23,15 @@ export const SLIDESHOW_WATERMARK_POSITIONS: SlideshowWatermarkPosition[] = ['top
// Canonical editable style shape, shared by the per-event card and the
// per-event-type preset editor. The per-event-type `slideshow_preset` JSON
// uses exactly these keys; the per-event API maps them to `show_*` columns.
//
// NOTE: the watermark LOOK (logo/position/opacity/style/size) lives ONLY in the
// global Settings → Slideshow tab — it is not duplicated here. Per-event/type
// carry just the `watermark` MODE (inherit/on/off), i.e. the override structure.
export interface SlideshowStyle {
interval_ms: number;
transition: SlideshowTransition;
transition_ms: number;
watermark: SlideshowWatermarkMode;
watermark_source: SlideshowWatermarkSource;
watermark_position: SlideshowWatermarkPosition;
watermark_opacity: number;
watermark_style: SlideshowWatermarkStyle;
colorfilter: SlideshowColorFilter;
}
@@ -40,21 +40,20 @@ export const DEFAULT_SLIDESHOW_STYLE: SlideshowStyle = {
transition: 'crossfade',
transition_ms: 800,
watermark: 'inherit',
watermark_source: 'logo',
watermark_position: 'bottom-right',
watermark_opacity: 60,
watermark_style: 'white',
colorfilter: 'none',
};
// Global slideshow defaults (admin Settings → Slideshow). The per-event
// watermark mode 'inherit' falls back to these.
// Global slideshow defaults (admin Settings → Slideshow). The single source of
// truth for the watermark look; the per-event watermark mode 'inherit'/'on'
// renders with exactly these.
export interface SlideshowGlobalDefaults {
slideshow_watermark_enabled: boolean;
slideshow_watermark_source: SlideshowWatermarkSource;
slideshow_watermark_position: SlideshowWatermarkPosition;
slideshow_watermark_opacity: number;
slideshow_watermark_style: SlideshowWatermarkStyle;
// Logo size as a % of the viewport's shorter side.
slideshow_watermark_size: number;
}
// Resolved watermark the kiosk renders (logo URL already resolved server-side).
@@ -63,6 +62,7 @@ export interface SlideshowWatermark {
position: SlideshowWatermarkPosition;
opacity: number;
style: SlideshowWatermarkStyle;
size: number;
}
export interface SlideshowSettings {