Skip to content

feat(web): show the time report on the Time page - #153

Merged
Bakhomious merged 1 commit into
mainfrom
step/time-page
Oct 29, 2026
Merged

Bakhomious merged 1 commit into
mainfrom
step/time-page

Conversation

@Bakhomious

@Bakhomious Bakhomious commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Goal

The time service's report reaches the app as GET /api/time/report (#150, #151), but nothing shows it yet: the Time tab still opens the placeholder page. This step builds the Time page. It shows this week's hours on the Home's week card, then the last 7 days, one row each, with the weekdays that have no hours marked. The eighth of time-tracking's thirteen steps (decision 184).

Scope

  • src/time/report.ts: the Report and Day types, and loadReport() through the shell's snapshot loader (decision 147).
  • src/time/days.ts: dayRows (the date as "15 Oct", the weekday or "Today", the hours, logged or not, missing or not) and missingNote ("1 day missing", "3 days missing", none).
  • src/time/DayList.svelte (the days' card) and src/time/TimePage.svelte (the page, its two sections and its failure lines).
  • src/time/week.ts exports formatHours, so the rows write hours as the card does.
  • src/shell/page.ts gains the time kind: /time and the paths under it show the page, titled "Time · Bakhyard". App.svelte mounts it.
  • Tests: days.test.ts, TimePage.test.ts, the new App.pages.test.ts, e2e/time.spec.ts, and e2e/demo.ts gains a report. App.test.ts had 199 of Biome's 200 lines, so its tests of the pages the app opens on moved to App.pages.test.ts.
  • Docs: plan §0 (the row and the card-copy idea), §7 (the Time bullet), §8.2, decision 184; docs/setup.md; the README's feature list.

Out of scope

  • The week from the time service on the Home (home-week); a week view (time-week); the Home's attention items (time-attention).
  • Adding a worklog or filling a missing day (worklog-add, fill-day). The rows aren't links yet.
  • Any change to the services or the gateway.

Acceptance criteria

  1. ✅ /time and the paths under it show the Time page, titled "Time · Bakhyard". The header marks Time, and on a phone the tab bar marks More.
  2. ✅ The page loads the report each time it shows, and shows nothing under its head while it loads.
  3. ✅ "This week" shows the week's hours on the Home's week card ("15h 45m / 40h", "Logged on Jira", the bar), without a link.
  4. ✅ "Last 7 days" lists the report's days, the earliest first. Each row has the date as its mono label ("15 Oct"), the weekday as its title ("Thursday") or "Today" for the last day, and the hours at its end ("7h 30m", "0h"). Logged hours show in --ink; a day without hours stays muted like its date. A missing day has a filled Missing chip, like the Home's Late chip. The section's note counts the missing days and is left out when none is.
  5. ✅ A day reads as the same day in every time zone. The unit test also runs in a zone behind UTC.
  6. ✅ When the last search failed, one muted line says why. When there are days from an earlier search, it adds "These hours are from 21 October at 09:38." and leaves 30 px (24 px on a phone) above the first section. Without days, the line stands alone.
  7. ✅ A 404 says "Jira isn't set up." and any other failure says "Couldn't load the time report.", with no section.
  8. ✅ The page matches the app. The section heads, labels and titles equal the PRs page's. The week card equals the Home's in styles, box and text. From 320 px up there's no horizontal scroll, and on a phone the label and the hours share a line with the title below.
  9. ✅ mise run check passes, and the PR's CI is green.

QA

  • mise run check passed:
    • Go: build, fmt, lint (0 issues), tests, coverage 95.9%, govulncheck (none), gen:check.
    • jactionlint and the compose lint.
    • Web: Biome; svelte-check (0 errors, 0 warnings); Vitest, 1,102 tests with 99.81% of statements and 98.38% of branches covered; knip; pnpm audit.
    • Playwright: 337 passed and 7 skipped by design, in desktop Chromium and phone WebKit.
    • src/time is fully covered by statements.
  • Mutation run: 37 of 38 mutants killed. The one survivor, {#if days && searched} → {#if searched}, is equivalent under the contract: a successful poll sets the days and searched together. The PRs and Jira sections use the same guard.
  • Style checks, 34 of 34 passed:
    • Logged and unlogged hours, in both themes.
    • The Missing chip against the Home's Late chip.
    • The week card against the Home's.
    • The label, title and section gap against the PRs page.
    • A width sweep at 320, 375, 700, 701, 1024 and 1280 px: no horizontal scroll, every row's end inside its row, and the phone layout.
  • Screenshots below, with the demo data in Tokyo time.

Review

No blocking finding. Non-blocking:

  • About 150 lines of code, a third of them CSS: at the guideline.
  • DayList copies the card's style, as twelve other components do (§0's idea to share it).
  • logged reads the raw hours, so a worklog of under 30 seconds would show "0h" in --ink. Jira logs a minute at least.
  • "Today" is the time service's today, as the report's contract has it (decision 181). The device's zone doesn't move it.

Decision 184 is for the user's end review.

Merged under the user's standing OK (2026-10-26) to merge green PRs; the user reviews it with the rest at the end.

Screenshots

The Time page on a desktop, light theme

The Time page on a desktop, dark theme

The Time page on a phone, light theme

The Time page on a phone, dark theme

A failed last search on a desktop, with the hours from an earlier one

A failed last search on a phone

The Time page 320 px wide in Chromium

The Time page 320 px wide on a phone

The time service's report reaches the app through the gateway as
GET /api/time/report, but nothing showed it: the Time tab still opened
the placeholder page. The Time page now shows this week's hours on the
Home's week card and the last 7 days, a row each, with the weekdays
that miss their hours marked, so a missing day stands out before the
week ends. Decision 184 records the choices.
@Bakhomious
Bakhomious merged commit 446be84 into main Oct 29, 2026
2 checks passed
@Bakhomious
Bakhomious deleted the step/time-page branch October 29, 2026 15:45
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.

1 participant