Repository navigation
fix(logs): NaN hours, off-brand list UI, missing work-log API endpoints - #403
Merged
Merged
Conversation
…386) Logs feature hardening pass: - #380: Total Hours NaN — strict HH:MM parsing in calculateTotalHours (empty/partial input no longer poisons the sum via undefined minutes), default time entry now actually pre-fills 08:00–16:30, helper exported with unit tests; WorkLogDetailScreen.computeEntryHours reuses it. - #386: Logs list restyle at 375×812 — brand-primary CTAs, single ResponsiveSelect sort control (was Dropdown-in-pill), horizontally scrollable full-label status Chips (was truncating SegmentedControl), header copy stacks above the CTA on non-desktop via useResponsive. - API: add GET /v1/work-logs/overview (feeds the Quick summary banner), GET /{id}/conversation and POST /{id}/comments (detail-screen thread), sharing an extracted resolveAccessibleWorkLog access helper. - API: fix list pagination — SDK/UI paginate 0-based but the route computed a 1-based offset, so page 0 queried range(-20,-1) and the org Logs list always rendered empty. Co-Authored-By: Claude Fable 5 <[email protected]>
Contributor
📊 Performance Benchmark Results |
Contributor
Test Results0 tests 0 ✅ 0s ⏱️ Results for commit 20831eb. |
This was referenced Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Logs feature hardening — fixes the two browser-verifiable bugs from the 2026-07-16 mobile smoke test and wires up the missing work-log API endpoints the UI actually calls (from the "Wire up missing public-API endpoints" dogfood idea task).
Fixes #380
Fixes #386
#380 — "Total Hours: NaN"
{start: "", end: ""}(the 08:00/16:30 were placeholders)."".split(":")yields one element, so the minute part isundefined— which slips pastNumber.isNaNand poisons the sum into NaN.calculateTotalHoursnow parses strictly (HH:MMregex); partial input while typing contributes 0, never NaN.WorkLogDetailScreen.computeEntryHourshad the same latent leak and now reuses it.#386 — off-brand Logs list at 375×812
color="primary"(teal) instead of default gray/black.ResponsiveSelect(sheet on mobile) replaces the Dropdown-in-a-pill that read as 2–3 controls.Chips with full labels ("Pending", "Disputed") replace the truncatingSegmentedControl.useResponsive.API (packages/supabase/functions/api/routes/work-logs.ts)
GET /v1/work-logs/overview— status summary + totals + recent activity; feeds the Quick summary banner (previously 404 on every list load). All four status keys always emitted (banner dereferences them unguarded).GET /{id}/conversation+POST /{id}/comments— detail-screen thread, enriched withuser {display_name, username}. Access via extractedresolveAccessibleWorkLog(RLS first, org-member fallback — same semantics as getById, now shared).parentCommentIdaccepted-and-ignored (no DB column yet).range(-20,-1)and the org Logs list always rendered empty (totalCount: 40, workLogs: []).Verification
calculateTotalHourspass; scf-core typecheck clean.GET /overview200 with real aggregates; conversation GET/POST round-trip verified (comment appears in UI thread); worker without access gets 404 on conversation read + comment post; own overview still 200.🤖 Generated with Claude Code