From 29f4212901fc8cbeb21215c8cc5d0c2092110ce8 Mon Sep 17 00:00:00 2001 From: b0txec Date: Sun, 23 Aug 2026 09:33:45 +0300 Subject: [PATCH] =?UTF-8?q?Document=20draggable=20per-warning=20symbol=20p?= =?UTF-8?q?lacement=20in=20Br=C4=ABdin=C4=81jumi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/ARCHITECTURE.md | 2 ++ docs/PRODUCT_WORKFLOWS.md | 5 +++-- docs/UPDATE_ROADMAP.md | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index a37b888..29109fe 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -91,6 +91,8 @@ The canvas renders every operator-checked warning at once, composited onto one o The backend returns warning polygons as raw latitude/longitude points; the frontend projects them to pixel space with a per-resolution affine transform (`x = a·lon + b·lat + c`, `y = d·lon + e·lat + f`). Each transform is a least-squares fit of well-spread Latvian cities' real-world coordinates against the pixel positions already validated for these same map backgrounds by Kartes/Faktiskā (`cityCoords.ts` + `mapConsts.ts`), rather than an independently eyeballed calibration. An earlier 4-corner bounding-box version of this projection could not represent the source artwork's rotation/shear and drifted up to ~200px on the 3840 canvas; the affine fit lands within ~35px. +Each checked warning can additionally carry one editorial weather-symbol placement (`IconPlacement`: symbol code plus `x`/`y`/`size` as fractions of the canvas), reusing the same normalized symbol set and image-loading cache (`components/weatherIcons/weatherIconAssets.ts`) that Faktiskā already uses, rather than a separate asset pipeline. The map canvas itself is the position/size control: pointer-event handlers on the `` hit-test against each placement's bounding box and a small corner handle to distinguish a move-drag from a resize-drag, converting screen coordinates through the canvas's internal-vs-displayed size ratio. This is the app's first direct-manipulation canvas control — everywhere else uses plain form inputs. The interactive dashed box and resize handle are drawn as a separate pass (`drawInteractionHandles`, in `Warnings.tsx`) layered on top of the plain export render; `downloadPng` re-runs the plain render immediately before calling `canvas.toBlob`, captures the blob, then restores the interactive overlay, so the handles never reach the exported PNG despite both preview and export sharing the same canvas element. + ## What the repository does not provide by itself - Authorized provider accounts and credentials. diff --git a/docs/PRODUCT_WORKFLOWS.md b/docs/PRODUCT_WORKFLOWS.md index ffdaa21..ec85080 100644 --- a/docs/PRODUCT_WORKFLOWS.md +++ b/docs/PRODUCT_WORKFLOWS.md @@ -119,9 +119,10 @@ Operator flow: 3. Optionally narrow the warning list by day and phenomenon. 4. Each warning card has its own checkbox and is independently clickable. The checkbox adds or removes that warning from the map (any number can be checked at once; at least one is auto-checked so the map is never empty). Clicking the card itself opens that warning's full detail — intensity, regions, validity period, description, and risk text — in a popup dialog above a dimmed, blurred background, without changing the map selection. Closing the popup (✕, backdrop click, or Escape) leaves the selection untouched. 5. The title field is pre-filled as "Brīdinājums: {phenomenon}" (e.g. "Brīdinājums: vējš") from the first checked warning and remains manually editable — useful since a combined-severity selection needs one title regardless of how many checkboxes are on; the LVĢMC source mark stays fixed. -6. Preview and download the native-resolution PNG. +6. For each checked warning, pick a weather symbol from the shared palette (the same symbol set used across Faktiskā and, historically, the Photoshop workflow) and assign it to that warning. On the map preview, drag the symbol to reposition it and drag its corner handle to resize it — placement and size are editorial judgment calls that reflect where and how intense a given warning is, the same way the newsroom has always hand-placed a symbol over the colored area in Photoshop. +7. Preview and download the native-resolution PNG. -The two exports use separate geographic-to-pixel calibration and layout values. Neither output is produced by resizing the other. Upstream times are interpreted in the `Europe/Riga` timezone. Empty warning data is a valid state and produces an uncolored base map. There is no on-canvas severity-color legend. Each warning card is a compact chip showing only its phenomenon icon, name, and severity color (left border); the full text lives in the detail popup so it stays readable regardless of length. +The two exports use separate geographic-to-pixel calibration and layout values. Neither output is produced by resizing the other. Upstream times are interpreted in the `Europe/Riga` timezone. Empty warning data is a valid state and produces an uncolored base map. There is no on-canvas severity-color legend. Each warning card is a compact chip showing only its phenomenon icon, name, and severity color (left border); the full text lives in the detail popup so it stays readable regardless of length. Symbol placement and size are stored per warning as fractions of the canvas, so the same relative placement holds at both export resolutions; the drag/resize handles are a preview-only aid and are never present in the downloaded PNG. ## Apskats diff --git a/docs/UPDATE_ROADMAP.md b/docs/UPDATE_ROADMAP.md index 3342fcf..dca0022 100644 --- a/docs/UPDATE_ROADMAP.md +++ b/docs/UPDATE_ROADMAP.md @@ -139,6 +139,7 @@ Status: pending - [x] Give Brīdinājumi chips a hover state where the severity-colored icon capsule expands to fill the chip, adapted from a reviewed external Uiverse.io reference component. - [x] Split Brīdinājumi's warning selection (checkbox, drives the map) from viewing a warning's detail (clicking the chip, opens the popup) so choosing a map warning no longer forces the popup open; widen the detail popup for readability. - [x] Replace single-warning selection with multi-select checkboxes so combined-severity newsroom maps (e.g. yellow + orange wind together) can be produced; re-add severity-ordered compositing of every checked warning's polygons. Restyle chips as narrower, fully severity-colored, white-icon/white-text buttons, and port a reviewed Uiverse.io checkbox component for the selection control. +- [x] Add per-warning editorial weather-symbol placement to Brīdinājumi, reusing Faktiskā's existing symbol set: drag to move, drag a corner handle to resize, stored as canvas-fraction coordinates so placement holds across both export resolutions; the drag/resize affordance is preview-only and never reaches the exported PNG. This is the app's first direct-manipulation canvas control (everywhere else is plain form inputs). - [ ] Decide whether Brīdinājumi should actively prevent checking warnings of different phenomena together, or continue leaving that as an operator responsibility. - [ ] Tune Brīdinājumi feather-blur bleed at sharp coastline curves (e.g. the Gulf of Rīga indentation). - [ ] Test target resolutions and real workplace display conditions. @@ -219,3 +220,4 @@ Record completed work here by date and commit after the Git workflow is establis | 2026-08-22 | `6fbf672` | Split Brīdinājumi warning selection (checkbox) from viewing detail (chip click) and widen the detail popup | Yes — Rocky typecheck, build, and headless-browser verification that checkbox clicks change the map selection without opening the popup and chip clicks open the correct warning's detail without changing the selection; deployed to VPS in release `b5150ab` on 2026-08-22 | | 2026-08-22 | `56b8716` | Replace single-warning Brīdinājumi selection with multi-select checkboxes and severity-ordered polygon compositing, and restyle chips as narrower, fully severity-colored, white-icon/white-text buttons with a ported Uiverse.io checkbox component | Yes — Rocky typecheck, build, and headless-browser screenshot verification of multiple simultaneous checked warnings compositing correctly on the map; deployed to VPS in release `b5150ab` on 2026-08-22 | | 2026-08-22 | `6185dbf` | Harden `WarningService` against partial upstream failures: bounded outage retry, per-warning fetch isolation, a live-API-verified CKAN polygon filter, and visible logging for a previously-silent vertex-order default | Yes — Scala tests, Rocky full-stack rebuild verified against real live LVĢMC data (including a genuinely severe 52,345-point wind-warning polygon rendering correctly); deployed to VPS in release `6185dbf` on 2026-08-22, verified against live data on the VPS itself | +| 2026-08-23 | `c97875d` | Add draggable, resizable per-warning weather-symbol placement to Brīdinājumi, reusing Faktiskā's symbol set and image cache | Yes — Rocky typecheck, build, and headless-browser mouse-drag/resize verification against fixture warning data (the live LVĢMC feed had zero active warnings at test time); confirmed the exported PNG excludes the preview-only drag/resize handles; VPS deployment pending |