From 9ae8422527810f1141367823542458746a8a0886 Mon Sep 17 00:00:00 2001 From: Jonathan Hvid Date: Tue, 12 May 2026 10:46:39 +0200 Subject: [PATCH] feat(db): roadmap_items gains 'considering' + 'in_beta' rename, --on-ink tokens MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Migration 0006 (the spec said 0005 but that number was already taken by polls_on_dispatches from the previous session): rebuilds the roadmap_items CHECK to ('shipping','in_beta','exploring','considering') and renames any existing 'beta' rows to 'in_beta' in-place. FKs from roadmap_attributions are preserved across the DROP/RENAME by toggling PRAGMA foreign_keys off around the rebuild — attribution count unchanged after migrate (verified 4 rows survive on the demo DB). Tokens (src/styles/tokens.css): adds --on-ink, --on-ink-body, --on-ink-muted, --ink-divider. The bleached #fffcf7 cream replaces the warm #e8e0d0 --ink-text wherever it sits on indigo. Legacy --ink-text / --ink-muted stay in tokens.css for now — if any later commit references them they remain defined; the migration of existing call sites is covered here. Migrated to the new tokens in this pass: - src/components/MembershipCard.astro (members/:slug card) - src/pages/events.astro (hero invitation card) Both render with cleaner whites on indigo as a side effect. Code updates for the new status enum: - db.ts: RoadmapStatus = shipping | in_beta | exploring | considering - admin/RoadmapTab.astro: Status select gains Considering + In beta; grouped section iteration covers all four - admin/index.astro: validation list updated - scripts/seed-roadmap.js: 'In progress' markdown bucket → 'in_beta' - pulse.astro: roadmapStatusDot + roadmapStatusBlurb temporarily widened (full rewrite of that section lands in step 7) Co-Authored-By: Claude Opus 4.7 (1M context) --- migrations/0006_roadmap_considering.sql | 40 +++++++++++++++++++++++++ scripts/seed-roadmap.js | 2 +- src/components/MembershipCard.astro | 16 +++++----- src/components/admin/RoadmapTab.astro | 25 ++++++++++------ src/lib/db.ts | 2 +- src/pages/admin/index.astro | 2 +- src/pages/events.astro | 30 +++++++++---------- src/pages/pulse.astro | 18 ++++++----- src/styles/tokens.css | 10 +++++-- 9 files changed, 100 insertions(+), 45 deletions(-) create mode 100644 migrations/0006_roadmap_considering.sql diff --git a/migrations/0006_roadmap_considering.sql b/migrations/0006_roadmap_considering.sql new file mode 100644 index 0000000..d3428e3 --- /dev/null +++ b/migrations/0006_roadmap_considering.sql @@ -0,0 +1,40 @@ +-- Roadmap status enum gains a fourth value `considering` for items that are +-- under discussion but not yet committed to. Same migration also renames +-- the existing `beta` value to `in_beta` so the canonical names line up +-- with the v4 spec (no second display label layer needed). +-- +-- SQLite can't widen a CHECK constraint in place, so this is a full table +-- rebuild. roadmap_attributions has an ON DELETE CASCADE FK to +-- roadmap_items(id), so foreign keys are toggled off around the rebuild to +-- preserve attribution rows across the DROP/RENAME. + +PRAGMA foreign_keys = OFF; + +CREATE TABLE roadmap_items_new ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + title TEXT NOT NULL, + description TEXT NOT NULL DEFAULT '', + status TEXT NOT NULL DEFAULT 'exploring' + CHECK(status IN ('shipping','in_beta','exploring','considering')), + target TEXT, + display_order INTEGER NOT NULL DEFAULT 0, + shipped_at TEXT, + created_at TEXT NOT NULL DEFAULT (datetime('now')), + updated_at TEXT NOT NULL DEFAULT (datetime('now')) +); + +INSERT INTO roadmap_items_new + (id, title, description, status, target, display_order, shipped_at, created_at, updated_at) +SELECT + id, title, description, + CASE status WHEN 'beta' THEN 'in_beta' ELSE status END, + target, display_order, shipped_at, created_at, updated_at +FROM roadmap_items; + +DROP TABLE roadmap_items; +ALTER TABLE roadmap_items_new RENAME TO roadmap_items; + +CREATE INDEX idx_roadmap_status ON roadmap_items(status, display_order); +CREATE INDEX idx_roadmap_shipped ON roadmap_items(shipped_at); + +PRAGMA foreign_keys = ON; diff --git a/scripts/seed-roadmap.js b/scripts/seed-roadmap.js index 06abe6f..27879c2 100644 --- a/scripts/seed-roadmap.js +++ b/scripts/seed-roadmap.js @@ -30,7 +30,7 @@ const md = readFileSync(mdPath, 'utf8'); // schema's three statuses. In-progress items are actively being built and // tested with pilots → beta. Next/Later are roadmap intent, not started → exploring. const SECTION_STATUS = { - 'In progress': { status: 'beta', target: null }, + 'In progress': { status: 'in_beta', target: null }, 'Next': { status: 'exploring', target: 'Next quarter' }, 'Later': { status: 'exploring', target: 'Later this year' }, }; diff --git a/src/components/MembershipCard.astro b/src/components/MembershipCard.astro index 3e018e3..fdaee04 100644 --- a/src/components/MembershipCard.astro +++ b/src/components/MembershipCard.astro @@ -51,7 +51,7 @@ const tags = readFocusTags(member.focus_tags);