From 936713b18cf337830800b29d6183cfe876727c7a Mon Sep 17 00:00:00 2001 From: mAi Date: Wed, 6 May 2026 14:28:34 +0200 Subject: [PATCH] =?UTF-8?q?mAi:=20date=5Franked=5Fchoice=20results=20?= =?UTF-8?q?=E2=80=94=20calendar=20heatmap=20+=20cleaner=20bars?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit m's complaint: "current mode just ranked looks bad". Replace the per-option "5 horizontal bar rows" mini-chart with two complementary views the user toggles between, calendar default. Calendar (default when ≥2 options): - Horizontal day strip from min(start) to max(start), one cell per day. - Spans > 30 days suppress empty days; otherwise contiguous (incl. blanks). - Each day cell stacks one coloured slot per option starting that day — multiple options on the same day stack vertically inside the cell. - Slot colour = mean rating on a red→amber→green gradient (1 → 3 → 5). Linear interp between #ef4444, #f59e0b, #16a34a; empty days fall back to --color-bg-secondary. Slot shows time range, mean, and rating count. - Hover (`title`) gives the full date, label, mean, and count for the day. Bars (toggle, also the only view for single-option questions): - One row per option, sorted by aggregator (mean desc → 5-count → 4-count → total → id). Per row: rank chip, date+label, large coloured avg, single horizontal stacked bar with one segment per non-zero rating bucket (segment colour matches the bucket's rating on the same r→a→g scale), total count. - Empty rows say "Keine Bewertung" instead of an empty bar. Bundled fix: `summarizeAnswer()` on the admin Responses tab now renders date_ranked_choice answers as e.g. "3.5 avg (4 rated)" instead of the default `[object Object]` String() fall-through. bun check 0 errors, bun test 25 pass, bun build OK. --- src/lib/components/Results.svelte | 253 +++++++++++++++++--- src/lib/styles/feedback.css | 230 +++++++++++++++--- src/routes/admin/feedback/[id]/+page.svelte | 10 + 3 files changed, 426 insertions(+), 67 deletions(-) diff --git a/src/lib/components/Results.svelte b/src/lib/components/Results.svelte index 52aaf56..eab57c5 100644 --- a/src/lib/components/Results.svelte +++ b/src/lib/components/Results.svelte @@ -1,8 +1,17 @@