fix(calendar): all-day off-by-one (exclusive DTEND) + member color too close to shared rose

All-day: a single-day all-day event displayed across two days. iCal all-day
DTEND is EXCLUSIVE (1-day event = DTSTART:24/DTEND:25) and the server occurrence
carries that exclusive end, but Schedule-X treats all-day end as INCLUSIVE.
hydrateEvents now subtracts one day (clamped to >= start) so a 1-day event shows
on one day and an N-day event spans N days. Write path was already correct
(verified against stored VEVENTs). +regression test.

Color: a member's coral (#E8734A) was mistaken for the shared-family rose
(#F25C7A). Reorder COLOR_PALETTE so warm near-rose hues (amber, coral) are
assigned LAST; early members get cool, clearly-distinct colors (blue/green/teal).
This commit is contained in:
Lucas Berger
2026-06-07 18:37:56 -04:00
parent 29b8c02715
commit d4d5327fc4
3 changed files with 42 additions and 7 deletions
+10 -5
View File
@@ -13,17 +13,22 @@ import { db } from '../db/client.js'
import { users } from '../db/schema.js'
/**
* Accessible, visually-distinct palette for per-member color assignment.
* Assigned round-robin by join order (COUNT of existing users at insert time).
* Accessible, visually-distinct palette for per-member member-color assignment.
* A new member is given the first entry not already in use (see upsertUser).
*
* Ordering matters: the SHARED-family calendar is reserved rose (#F25C7A, D-06),
* so the warm near-rose hues (coral, amber) are placed LAST. Early members get
* cool colors (blue, green, teal) that read clearly distinct from the shared
* lane — otherwise a member's coral was mistaken for the shared rose.
* Values are Claude's choice per D-06.
*/
export const COLOR_PALETTE: string[] = [
'#4A90D9', // calm blue
'#E8734A', // warm coral
'#5BA85A', // forest green
'#9B6DC5', // soft purple
'#E8A840', // warm amber
'#3AAFA9', // teal
'#9B6DC5', // soft purple
'#E8A840', // warm amber (near shared rose — assigned only after cool colors)
'#E8734A', // warm coral (closest to shared rose — assigned last)
]
/** Coerce an OIDC claim to a trimmed non-empty string, else undefined. */