Skip to content

fix(web): humanize decisions table situation labels and timestamps#85

Merged
jayzalowitz merged 1 commit into
mainfrom
jayzalowitz/decisions-table-polish
Apr 26, 2026
Merged

fix(web): humanize decisions table situation labels and timestamps#85
jayzalowitz merged 1 commit into
mainfrom
jayzalowitz/decisions-table-polish

Conversation

@jayzalowitz

Copy link
Copy Markdown
Owner

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:

  • `< 1 min`: "just now"
  • `< 1h`: "Xm ago"
  • `< 24h`: "Xh ago"
  • older: "Apr 7, 9:44 PM" (year added if not current year)

Test plan

  • `node --check apps/web/public/js/pages/decisions.js` — clean
  • `pnpm test` — 38/38 turbo tasks
  • `pnpm lint` — 30/30 turbo tasks

Refs #53 (P2)

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings April 26, 2026 23:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 situationType values to user-friendly “What happened” labels via situationLabel() 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.

Comment on lines +209 to +210
const timePart = d.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
return `${datePart}, ${timePart}`;

Copilot AI Apr 26, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@jayzalowitz jayzalowitz merged commit 5fea593 into main Apr 26, 2026
12 checks passed
@jayzalowitz jayzalowitz deleted the jayzalowitz/decisions-table-polish branch April 26, 2026 23:39
jayzalowitz added a commit that referenced this pull request Apr 27, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants