diff --git a/.impeccable/surfaces/cool.md b/.impeccable/surfaces/cool.md new file mode 100644 index 0000000..13ec5e5 --- /dev/null +++ b/.impeccable/surfaces/cool.md @@ -0,0 +1,42 @@ +--- +version: 1 +slug: "cool" +primary_target: "cool" +related_targets: ["/cool/stage", "/cool/city", "/plan"] +--- + +# Surface brief — Cool City decision demo + +## Scope + +Primary: `/cool` (public, person-first route decision). Related: `/cool/stage` (projector keynote), `/cool/city` (cooling-gap module), `/plan` (retail module, linked only). + +## Audience and job + +Ruth, 78, lives alone — a composite, not a real person. She needs bread from Marktplatz on a hot day. The phone answers which way now; the stage tells the room the same story. The audience votes; the model recommends **Accessible for Ruth**. + +## Success + +- `/cool` is minimal: Ruth card, time slider, three route cards with shade and direct-sun minutes, vote buttons. No map dashboard, sensor table, weather card or methodology paragraphs. +- `/cool?vote=1` is only the question and three buttons. No map, no PII. +- `/cool/stage` is a keynote: Ruth card → Cool places → Data honesty → Find routes → 10:00→16:00 → Start vote → Lock vote → City view → Retail module → close. Quiet presenter controls, exact labels. +- The key insight is visible: the shaded route is 732 m / 9.8 min, 50.0% shade but 4.9 direct-sun min versus the shortest 359 m / 4.8 min, 43.8% shade, 2.7 min, with a 15% ramp. The accessible route is 438 m / 5.8 min, 43.8% shade, 3.3 min, no ramp, water and benches. +- Real route/city JSON only; missing values are hidden or TBD. + +## Constraints + +Real data: `public/cool-city/route.json` (normalised from `shade.json`, `routes.geojson`, `places.json`) and `public/cool-city/city-gap.json`. No retail numbers on Cool City. Onyx stays, themed with the system UI stack. Shared time/phase state is in-memory Nitro; vote per round. No PII. Keep SSR, accessibility, reduced motion, build/tests. + +## Direction contract + +THESIS: A live demo, not a dashboard. One decision: which way should Ruth go now? Apple-like clarity — less information, more confidence — with the map as stage content and a minimal phone flow. + +OWN-WORLD: Warm off-white `#F6F3EE`, near-black `#121212`, heat `#E4572E`, shade/water `#2F6FED`, system UI stack, tabular numerals, 28 px translucent surfaces, soft shadows, generous 8-point space, subtle state motion. Stage inverts to `#0B1114` with bright heat and shade. + +STORY: Ruth card. The city has cool places but no route. Three routes; at 10:00 the shortest is fine; at 16:00 shade % and direct-sun minutes disagree. The shaded route takes twice as long for 4.9 sun minutes; the shortest has a 15% ramp; the accessible route is one minute longer with no ramp, water and benches. The room votes; the model recommends **Accessible for Ruth**. Close: "The pulse is not the people. But the city still has to protect them." + +FIRST VIEWPORT: `/cool` — Ruth card, time slider, route cards with accessible first. `/cool/stage` — Ruth card first; then the dark route board at `Find routes`, with the exact labels and presenter strip. + +FORM: Pinned by `COOL_CITY_DESIGN.md` and `presentation/cool-city-demo-script.md`; no roll. `seed: none (pinned)` — "The frontend is a live demo, not a dashboard. Less information, more confidence. ... Apple-like clarity, not an Apple skin. ... full-bleed map ... floating bottom sheet ... one typeface, one accent, subtle motion, immaculate finish." + +FINISH: unreviewed and undocumented is unfinished; this build ends with the finish review, the verdict, DESIGN.md, and every shipping raster carrying its provenance. diff --git a/.impeccable/surfaces/plan.md b/.impeccable/surfaces/plan.md new file mode 100644 index 0000000..3aff8cd --- /dev/null +++ b/.impeccable/surfaces/plan.md @@ -0,0 +1,42 @@ +--- +version: 1 +slug: "plan" +primary_target: "plan" +related_targets: ["/", "/live", "/stage"] +--- + +# Surface brief — decision, stage, phone + +## Scope + +Primary: `/plan` (Operate). Related: `/` (Persuade), `/live` and `/stage` (Experience), with supporting `/forecast`, `/simulate`, `/about`, `/control` to follow in the finish pass. + +## Audience and job + +A Heilbronn duty manager needs the coming week's staffing decision: who works, when, what it costs, and what the trade-off is. A hackathon audience needs the same decision at ten metres on a projector, then in their hand on a phone. The presenter needs to change one scenario and have every surface follow honestly. + +## Success + +- `/plan` answers what to do above the fold: peak shift, staff count, staff-hours, cost vs flat, coverage. +- `/live` answers on a 390×844 phone above the fold: shift, staff count, one-line reason, freshness. +- `/stage` is readable at 10 m without app chrome. +- `/` sets up the story in one screen with the live plan as proof. +- Measured, modelled and assumed stay visibly distinct; the real 14–20 Nov window is labelled. + +## Constraints + +Live API data only; no fabricated numbers. Preserve routes, API contracts, Onyx components, SSR, accessibility, reduced motion and the existing build/tests. The paper brief's 210 h / €3,360 is stale; the demo baseline is the live sunny-saturday-market plan (5 peak, 172 staff-hours, €2,752 vs €5,600 flat, 100% coverage). + +## Direction contract + +THESIS: A shift board, not a dashboard. The week's footfall becomes a physical timetable with an orange peak block; the category's metric-card hero and admin shell are refused. + +OWN-WORLD: Cool paper `#F4EFE6`, ink `#16130F`, signal orange `#E84100` for the peak (text `#B63A00` on paper), board green `#2E6B4F` for coverage. Archivo variable: condensed 78% display, tabular numerals, heavy rules, zero radius, no shadows. `/stage` and `/live` invert to ink `#0E100E` with paper type and bright orange. + +STORY: The manager reads "Five on Saturday, 10:00–14:00", sees the week board, and understands 172 staff-hours cost €2,752 against €5,600 flat with 100% coverage. They approve or export. The judge sees the same plan on stage and phone; a scenario change redraws the pulse and the blocks. + +FIRST VIEWPORT: `/plan` — h1 "Five on Saturday." with shift time and a receipt of staff-hours/cost/coverage on the left, a full-width seven-day shift board with the orange peak on the right/below, and Approve/Export actions. `/` — headline "Saturday needs five." beside the live board. `/live` — giant 5, Saturday 14 Nov, 10:00–14:00, one-line peak-forecast reason, freshness. `/stage` — full-bleed dark board: 5 staff, day/time, week board, cost line, QR. + +FORM: Shift board / timetable. The user pinned the world and its first-surface experience; no roll was needed. `seed: none (pinned)` — "A — Shift board. Full replacement. Paper/ink ground, signal orange for the peak, heavy timetable rules, tabular numerals, physical time blocks. /stage inverts to a dark board." + +FINISH: unreviewed and undocumented is unfinished; this build ends with the finish review, the verdict, DESIGN.md, and every shipping raster carrying its provenance. diff --git a/PRODUCT.md b/PRODUCT.md new file mode 100644 index 0000000..0b6da25 --- /dev/null +++ b/PRODUCT.md @@ -0,0 +1,69 @@ +# Product + + + +## Platform + +web + +## Users + +**Primary public user:** Ruth, 78, lives alone in Heilbronn. She is a clearly labelled composite persona, not a real person: the stand-in for an older resident who needs bread, a bench, water and shade on a hot day. The product must work on her phone, one-handed, in bright light. + +**Secondary audiences:** the hackathon room watching a projector; a city climate-adaptation team looking for where shade, water and benches are missing; the retailer who pays for the staffing module. + +## Product Purpose + +Cool City is Heilbronn's public heat-safe route. It tells a person how to reach the places they need — cooler, quieter, step-free — at a given hour, and shows the city where shade, water and benches are missing. The retail staffing plan remains a separate commercial module, not the hero. + +## Positioning + +The city publishes almost 60 cool places on a map and an address list. It does not turn them into a time-aware, person-level route. Cool City connects the public cool-place map, modelled shade, OSM access features and the existing footfall/weather stack into three route choices a person can act on: shortest, shaded, accessible. It shows the room's vote next to the model's recommendation. A private dashboard cannot truthfully copy the public framing or the person-level route. + +## Operating Context + +- Heilbronn inner city. Origin Stadtgalerie, destination Marktplatz. Verify route geometry and place names against OSM and the final route bundle before the demo. +- Three options: shortest; shaded via the Deutschhof passage / Kiliansplatz; accessible with water, benches and step-free access. +- Time stops: 10:00, 12:00, 14:00, 16:00. The recommendation may change with the sun. +- Shade is modelled from solar position and building/tree geometry, not measured. Never claim a temperature difference. +- Sensors are eight inner-city PAX counters: a relative device index, not people. No city-wide heatmap claim. +- Public vote: one vote per random session ID in localStorage; aggregate tally only; no PII, no accounts, no location upload. +- The route/shade bundle lives in `cool-city-data/route/`; the cooling-gap bundle in `cool-city-data/city/`. Final JSON is copied to `public/cool-city/`. If a bundle is missing, label TBD and do not invent values. +- Do not generalise the commissioned FITNAH PET range to every inner-city street. + +## Capabilities and Constraints + +- Nuxt 4 SSR + Onyx + MapLibre available. Routes: `/cool`, `/cool/stage`, `/cool/city`, plus the existing retail routes. +- `/cool` is mobile-first and must also read clearly on a projector. `/cool/stage` is a dark, full-bleed projection surface. +- `/cool/city` ranks eight sensor catchments with a relative cooling-gap index and shows the weights and assumptions. No measured temperature map. +- Vote backend: in-memory Nitro route, aggregate counts, one vote per random session ID, stage polls every 2 s. No database, no Go change. +- Keep `/plan`, `/forecast`, `/simulate`, `/about` working. The retail module is linked, not merged into the Cool City hero. +- Preserve SSR, keyboard access, contrast, reduced motion, responsive behaviour, build and tests. + +## Brand Commitments + +- Name: **Cool City** (public product). Built on the PulseCast stack; the retail plan remains PulseCast's staffing module. +- Visual world pinned by `COOL_CITY_DESIGN.md`: **a live demo, not a dashboard**. Apple-like clarity: warm off-white ground, near-black ink, heat orange, shade/water blue, one system typeface, generous space, 28 px translucent surfaces and soft shadows, subtle motion. `/cool` is a minimal phone/desktop card flow; `/cool/stage` is a full-bleed dark route board with huge type and quiet presenter controls. The retail module keeps the shift-board identity. +- Voice: public, direct, protective, not promotional. Never present Ruth as a real person without consent. + +## Evidence on Hand + +- `COOL_CITY.md` product brief and `Paper/research/cool-city-sources.md` source-checked claims. +- RKI estimate: ~16,000 heat-related deaths in Germany in 2026 through KW37 (95% PI 14,400–17,600). Say estimated, not a count; not Heilbronn. +- FITNAH-3D commissioned model: citywide PET 16.1–44.5 °C; unshaded sealed street space can exceed 41 °C PET. Do not generalise. +- City: almost 60 cool places; map + address list, not a routing or time-aware service. 2021 climate-adaptation concept adopted 2023 with 31 measures; 2025 spatial concept; 2023 heat-health action package. Do not say no heat action plan. +- City tree cadastre Jan 2026 (dl-de/by-2.0); OSM (ODbL); Open-Meteo (CC BY 4.0); population by planning district aggregate. +- The route/shade and city bundles are pending. Use a clearly labelled TBD placeholder; no fake numbers. + +## Product Principles + +1. Public first. The hero is a person trying to reach a place safely, not a retailer's dashboard. +2. The hour matters. A route is not cool in the abstract; it is cool at 14:00 or 16:00. +3. Modelled is not measured. Shade coverage and direct-sun minutes are model outputs; say so. +4. The room is part of the product. The vote is aggregate, anonymous and shown next to the model. +5. The city only sees what the person reveals. The cooling-gap module is a relative planning aid, not a temperature map. +6. Keep the retail proof separate. The staffing module is the commercial layer, not the public story. + +## Accessibility & Inclusion + +WCAG 2.2 AA. Keyboard and visible focus for the time control, route cards and vote; 4.5:1 body text and 3:1 large text; no colour-only meaning; reduced-motion alternatives; 44 px touch targets; stage text legible at 10 m; phone-first reading order with no horizontal page scroll. diff --git a/README.md b/README.md index a9fecb7..6b91238 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # PulseCast web Nuxt 4 SSR frontend for **PulseCast**, a staffing copilot that turns inner-city -footfall into a next-week shift plan for a Heilbronn retailer. `/plan` is the +footfall into a weekly shift plan for a Heilbronn retailer. `/plan` is the decision surface; `/stage` and `/live` present that plan. The map, weather and forecast are supporting evidence. @@ -167,18 +167,35 @@ deployed path are the real API. | Route | Purpose | | --- | --- | -| `/` | Now: replay reading, 8-sensor schematic, weather, holiday, data versions | +| `/cool` | **Cool City public hero.** Ruth card, time, three real route options, vote buttons; `/cool?vote=1` is the minimal audience vote page | +| `/cool/stage` | **Cool City projector.** Ruth card, cool places, data honesty, route board with exact labels, live vote, city view, retail link | +| `/cool/city` | Cooling-gap module: eight ranked catchments, one-line reasons, top block and “What would help” | +| `/` | Landing: the live shift board, peak shift, cost vs flat, coverage and the measured/modelled/assumed chain | | `/forecast` | 7-day daily forecast, uncertainty band, weather strip | -| `/plan` | **Hero.** Peak decision, shift blocks, coverage, cost, why, assumptions | +| `/plan` | **Hero.** Peak decision, weekly shift board, coverage, cost vs flat, settings, hourly detail | | `/simulate` | Base vs scenario plan, both read from Go `/api/staffing` | -| `/stage` | Big-screen decision: headline, peak staff, cost, coverage, QR to `/live` | -| `/live` | Phone view: current recommendation, peak shift, scenario, last update | +| `/stage` | Dark projector board: peak shift, weekly board, cost, coverage, QR to `/live` | +| `/live` | Phone answer: peak shift, staff count, reason, freshness, scenario and transport | | `/control` | Presenter preset buttons; authenticated POST through Nitro | | `/about` | Method, metrics, limits, privacy, train form | The layout targets **390 px** (single column, mobile Onyx nav, day cards) and **1440 px** (Onyx horizontal nav, two-column plan with tables). +### Cool City demo data and state + +- `/cool` reads `public/cool-city/route.json`, normalised from + `cool-city-data/route/shade.json`, `routes.geojson` and `places.json`. + `/cool/city` reads `public/cool-city/city-gap.json`. +- Vote and demo state are in-memory Nitro routes: `GET/POST /api/cool/state`, + `GET/POST /api/cool/vote`, `POST /api/cool/reset`. `round` is + `preselection` or `final`; votes never mix. The stage and phones poll every + 2 seconds. No database and no PII. +- Stage labels: `Cool places`, `Data honesty`, `Find routes`, `Shortest`, + `Shaded`, `Accessible`, `Start vote`, `Lock vote`, `City view`, + `Retail module`, `Reset round`. The model recommendation is + **“Accessible for Ruth”**. + ## Plan logic `shared/staffing.ts` is the single implementation of the contract heuristic: diff --git a/app/app.vue b/app/app.vue index bd056fa..e362870 100644 --- a/app/app.vue +++ b/app/app.vue @@ -5,17 +5,22 @@ import { iconCircleInformation, iconFlash, iconHome, - iconMobileSignal, - iconPresentionBoard, } from '@sit-onyx/icons' const route = useRoute() const config = useRuntimeConfig() -const usingMock = computed( - () => - config.public.useMock === true || - config.public.useMock === '1' || - config.public.useMock === 'true', +const usingMock = computed(() => { + const value = config.public.useMock + return value === true || value === '1' || value === 'true' +}) + +const isCool = computed(() => route.path.startsWith('/cool')) +const isDarkPresentation = computed( + () => route.path === '/stage' || route.path === '/live' || route.path === '/cool/stage', +) +const isStandalone = computed(() => isCool.value || isDarkPresentation.value) +const bodyClass = computed(() => + isDarkPresentation.value ? 'pc-presentation' : isCool.value ? 'pc-cool-presentation' : '', ) const navigation = [ @@ -23,8 +28,6 @@ const navigation = [ { to: '/forecast', label: 'Forecast', icon: iconChart }, { to: '/plan', label: 'Plan', icon: iconCalendar }, { to: '/simulate', label: 'Simulate', icon: iconFlash }, - { to: '/stage', label: 'Stage', icon: iconPresentionBoard }, - { to: '/live', label: 'Live', icon: iconMobileSignal }, { to: '/about', label: 'About', icon: iconCircleInformation }, ] @@ -32,10 +35,32 @@ const hiddenPageLabels: Record = { '/control': 'Control' } const activeLabel = computed( () => navigation.find((item) => item.to === route.path)?.label ?? hiddenPageLabels[route.path] ?? 'PulseCast', ) + +useHead(() => ({ + bodyAttrs: { class: bodyClass.value }, +})) + +// Onyx renders its overflow navigation as a `menubar` whose direct child is a +// div, which fails the required-children rule. The list is site navigation, +// not an application menu, so remove the menu role rather than fake menuitems. +let navRoleObserver: MutationObserver | undefined +function fixNavAria() { + for (const list of document.querySelectorAll('.onyx-more-list[role="menubar"]')) { + list.setAttribute('role', 'none') + } +} +onMounted(() => { + fixNavAria() + navRoleObserver = new MutationObserver(fixNavAria) + navRoleObserver.observe(document.body, { childList: true, subtree: true }) +}) +onBeforeUnmount(() => navRoleObserver?.disconnect())