Skip to content

refactor(web): move the week card to the Time app - #152

Merged
Bakhomious merged 1 commit into
mainfrom
step/week-card
Oct 29, 2026
Merged

Bakhomious merged 1 commit into
mainfrom
step/week-card

Conversation

@Bakhomious

Copy link
Copy Markdown
Contributor

Goal

The Time page (time-page) will show this week's hours against the target on the same card as the Home's "This week". That card sat inside the Home's ThisWeek, under the section head whose "Day report" link leads to the Time page, and its formatting and the Week type lived in the Home's folder. This step moves the card into a component of its own, WeekCard, and moves it, week.ts and the Week type to the Time app's folder, src/time, so the Time page can show it without importing the Home. Nothing changes on screen or in behaviour. A pure refactor, like shell-section (#85) and todos-draft (#98); the seventh of time-tracking's thirteen steps (decision 183).

Scope

  • src/home/week.ts moves to src/time/week.ts and now declares the Week interface itself; src/home/week.test.ts moves beside it, unchanged.
  • New src/time/WeekCard.svelte: ThisWeek's card markup and CSS, moved as they were.
  • src/home/ThisWeek.svelte: the section head with its "Day report" link, around a WeekCard.
  • src/home/api.ts: the Week interface goes; it imports the type from ../time/week. Home.week is unchanged.
  • Tests: new src/time/WeekCard.test.ts (the hours, the "Logged on Jira" unit, the bar hidden from assistive tech, its width); src/home/ThisWeek.test.ts checks the head, the link and that the card shows.
  • docs/plan.md: the §0 row, §8.2's week-card bullet (thirteen steps), decision 183.

Out of scope

  • The Time page itself, its route and its report (time-page).
  • Any change on screen or in behaviour.

Acceptance criteria

  1. ✅ WeekCard shows a Week as the Home's card did: "30h / 40h", "Logged on Jira", and a bar hidden from assistive tech, filled 75% of the way.
  2. ✅ ThisWeek is the "This week" section head with the "Day report" link to /time, around a WeekCard.
  3. ✅ week.ts, its test and the Week type live in src/time; nothing under src/time imports from src/home.
  4. ✅ The built CSS is the same as main's once Svelte's path-derived class hash is mapped: render-Bv5fr4tV.css is byte-identical, and index-*.css differs only in svelte-ed4ug3 → svelte-mc9jn3, the hash of the card's new file. The JS differs in ThisWeek mounting WeekCard and in minified names; the render chunk only in the index chunk's name.
  5. ✅ mise run check passes, and the PR's CI is green.

QA

  • mise run check: Go build, fmt, lint, tests, coverage (95.9%) and govulncheck; jactionlint and the compose lint; Biome, svelte-check (0 errors, 0 warnings), Vitest (1,083 tests), knip, pnpm audit, and Playwright (319 tests in desktop Chromium and phone WebKit, 7 skipped by design).
  • Mutation run, 9 of 9 mutants killed: ThisWeek without its card, with another link, another link label or another accent; WeekCard without aria-hidden, with half the width, another unit or the raw hours; and api.ts without the Week import, killed by svelte-check.
  • The build comparison in AC4.

Review

No blocking finding. Non-blocking:

  • WeekCard has one user until time-page, the next step, gives it its second; the same order as shell-section before todos-groups.
  • No test checks the card's CSS, as on main; the build comparison shows the move left it as it was.

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

The Time page will show the Home's "This week" card, so the card becomes
a component of its own, WeekCard, and moves with its formatting and the
Week type to src/time. Nothing changes on screen. Decision 183.
@Bakhomious
Bakhomious merged commit adee97e into main Oct 29, 2026
2 checks passed
@Bakhomious
Bakhomious deleted the step/week-card branch October 29, 2026 15:14
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