Menu

#5 Feat/UI redesign 2.0

closed
nobody
released (243)
2026-06-01
2026-05-12
Anonymous
No

Originally created by: adityaharishch

Related

Tickets: #298
Tickets: #345
Tickets: #346

Discussion

  • Anonymous

    Anonymous - 2026-05-12

    Originally posted by: adityaharishch

    Response to review

    Thanks for the thorough pass. Addressing everything below.

    Blocking issues — fixed

    #1 File size (TodayView.tsx 512 lines)
    Extracted buildStoryui/lib/story.ts and the today-specific timeline component → ui/components/views/TodayTimeline.tsx (a separate name from the existing ui/components/DayTimeline.tsx used by the sessions page). TodayView.tsx is now 349 lines.

    #2 Shadow-copy tests
    Created ui/lib/fmt.ts as a pure, no-React module containing fmtDur, fmtDurDecimal, fmtClock, hexA, and CATS. atoms.tsx now imports and re-exports from there; theme-context.tsx imports hexA from there. redesign.test.ts now imports from the canonical sources instead of re-implementing inline. Added ui/__tests__/story.test.ts with 10 tests covering buildStory.

    Should-fixes — all addressed

    #3 Timezone bug in week/route.ts — Agreed, fixed. Replaced the naive localDayRange with localDayBounds from @/lib/date-utils, same as every other route.

    #4 cats in hours vs seconds — Agreed, fixed. Route now accumulates seconds; WeekView's DayBar tooltip and CategoryBars divide by 3600 for display.

    #5 QueueView dismiss no persistence — Agreed the current behavior is misleading. Wiring a full PATCH /api/queue-review endpoint is out of scope for this PR (needs a new DB column + tagger changes). Added a "resets on refresh" note in the header so users know. Will track the persistence work separately.

    #6 Dead buttons in TodayView + TasksView — Fixed. Added disabled + opacity-50 cursor-not-allowed to Skip/Log/Edit draft/Assign buttons.

    #7 Dead export { AppGlyph } in TasksView — Removed.

    #8 Record<string, unknown> DB row types — Partially addressed. week/route.ts now has typed query results. On the other three routes (today, tasks, queue-review): they already cast all fields explicitly at the mapping stage and produce fully-typed output interfaces (TodaySession, TaskSummary, QueueItem). The Record<string, unknown> is only the intermediate DB row — not a typed output boundary. Adding a DbRow interface here would just alias the same Record<string, unknown> with named fields. Happy to add it if you feel strongly, but I don't think it buys safety beyond what the explicit casts already provide.

    #9 eslint-disable in TasksView — Fixed. Split into two effects: one for fetch (no deps), one for setting the default selection (deps [data, selected]).

    #10 Sidebar ActiveInfo type mismatch — Respectfully pushing back on "doesn't match": ActiveInfo's four fields (app_name, started_at, elapsed_s, category) are all present and correctly typed in the actual ActiveSessionRow response. TypeScript's structural typing means this wasn't a runtime bug. That said, the hand-rolled interface is still a drift risk, so I've narrowed it to Pick<ActiveSessionRow, 'app_name' | 'elapsed_s'> (only the two fields actually rendered in ActiveSessionPill).

    #11 Hardcoded DAY_START/DAY_END — Fixed. The extracted TodayTimeline component derives the window from actual min/max timestamps in the day's data (±1 hour padding), falling back to 7–19 when there's no data.

    Nits

    • Separator comments (// ── Foo ──) removed from TodayView, redesign.test.ts — per CLAUDE.md convention.
    • IIFE in JSX replaced with const story = buildStory(data) hoisted above return.
    • pushToBucket moved to module level (no longer recreated on every render).
    • Google Fonts CDN: acknowledged — next/font/google self-hosts at build time and is the right long-term fix, but swapping fonts requires verifying the rendered weight/style matches. I'll open a follow-up issue rather than risk a visual regression here.
    • CommandBar arrow-key navigation: noted, will track.
    • Card catch-all props: noted, will track.

    All 89 UI tests pass. bun test output: 89 pass, 0 fail.

     
  • Anonymous

    Anonymous - 2026-05-12

    Ticket changed by: Akarsh-Hegde

    • status: open --> closed
     
  • Anonymous

    Anonymous - 2026-06-01

    Originally posted by: adityaharishch

    🎉 This PR is included in version 1.0.0 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

     

Log in to post a comment.