fix(web): humanize decisions table situation labels and timestamps#85
Conversation
Two P2 fixes from #53. Situation labels: the "What happened" column was rendering raw enum strings (email_triage, calendar_conflict, generic). Mapped each SituationType to a readable label via situationLabel(). Unknown types fall back to title-cased snake_case rather than the raw enum. Timestamps: previously every recent row showed time-only (HH:MM), which made identical-second seed data look indistinguishable ("9:44 PM" on every row, no date anywhere). New formatter: - < 1 min: "just now" - < 1h: "Xm ago" - < 24h: "Xh ago" - older: "Apr 7, 9:44 PM" (year added if not current year) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR improves the readability of the Web “Decision History” table by replacing raw situation type enums with human-friendly labels and by making timestamps more informative (relative for recent events, date+time for older ones), addressing UX issues noted in #53.
Changes:
- Map
situationTypevalues to user-friendly “What happened” labels viasituationLabel()with a readable fallback for unknown types. - Update decision timestamp formatting to show relative time for recent entries and include date+time (with year when needed) for older entries.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const timePart = d.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }); | ||
| return `${datePart}, ${timePart}`; |
There was a problem hiding this comment.
formatTime() uses toLocaleTimeString(..., { hour: '2-digit', minute: '2-digit' }), which will render a leading zero in some locales (e.g. 09:44 PM) and doesn’t match the PR description example (Apr 7, 9:44 PM). Consider using hour: 'numeric' (keeping minute: '2-digit') to avoid leading zeros while preserving the intended format.
…h work (#87) Captures eight PRs (#77, #78, #79, #81, #82, #83, #84, #85, #86) under an [Unreleased] section. No code changes — pure documentation. Bumping VERSION + cutting a tag is left as a separate decision so the release moment stays explicit. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Summary
Two P2 fixes from #53.
Situation labels. The "What happened" column was rendering raw enum strings (`email_triage`, `calendar_conflict`, `generic`). Now mapped to readable labels via `situationLabel()`. Unknown types fall back to title-cased snake_case rather than the raw enum.
Timestamps. Previously every recent row showed time-only (`HH:MM`), which made identical-second seed data look indistinguishable ("9:44 PM" on every row, no date anywhere). New formatter:
Test plan
Refs #53 (P2)
🤖 Generated with Claude Code