Skip to content

feat(home): say when the week's hours are unavailable - #156

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

Bakhomious merged 1 commit into
mainfrom
step/week-unavailable

Conversation

@Bakhomious

Copy link
Copy Markdown
Contributor

Brief

Goal. When home couldn't get the week from the time service, the Home's "This week" says so, rather than leaving the section out as if Jira weren't set up. Since #155, home's answer carries weekState, ok or unavailable, beside week (decision 186); the app now reads it (decision 187).

Scope.

  • home/api.ts: the Home type gains weekState, of the sources' state type, now named.
  • HomePage: "This week" shows with a week, as before, or when weekState is unavailable.
  • ThisWeek and WeekCard: the week becomes optional; without one, the card says "Hours unavailable" in place of the hours, in their type and in --ink-muted, without the "Logged on Jira" label and the bar.
  • Unit tests, an end-to-end test, and screenshots.
  • Docs: plan §0, §4.11, §7, §8.2 and decision 187.

Out of scope.

  • The Time page: it shows the card only with a week, and has its own failure lines (decision 184).
  • The top bar's count of unavailable sources, which leaves the week out (decision 186).
  • How old a kept week is (decision 185's known limit).
  • Time's items for "Needs you today" (time-attention).

Acceptance criteria.

  1. A Home with weekState: 'unavailable' and no week ends with "This week", after "Your apps", with its "Day report" link to /time, and a card that says "Hours unavailable" in the hours' type (28 px, 24 px on phones, weight 500) and in --ink-muted, with no "Logged on Jira" label and no bar.
  2. A Home with a week shows the hours as before, whatever its weekState.
  3. A Home with weekState: 'ok' and no week, as without Jira, or with neither member, as from a home without a time peer or one older than the field, leaves "This week" out (decision 161).
  4. Each later Home decides afresh: the hours, "Hours unavailable", or no section.
  5. The Time page's week card doesn't change.
  6. In light and dark, on desktop and phone, the card keeps the week card's box, and the text fits at 320 px.
  7. mise run check passes.

QA

  • Mutations: 18 of 18 caught (mutate.py; 11 by Vitest, 4 by the end-to-end tests, 3 by svelte-check):
    • HomePage: ok in place of unavailable; the new branch removed; the card for any Home; the state winning over a week; a zero week given for unavailable;
    • WeekCard: no card without a week; other wording; an empty card; the text out of the hours' type, not muted, in --ink, lighter, or smaller; the label or an empty bar kept; a zero target read as unavailable;
    • api.ts: no weekState member; other state names.
  • Style and shots spec (shots.spec.ts, 12 checks on desktop Chromium and phone WebKit, all passed):
    • AC1, AC6: in light and dark, the card's padding, border, background and shadow equal the week card's, read from the same Home with a week; the text's font family, size, weight, letter spacing and line height equal the hours'; its colour is --ink-muted, not --ink; the card is one line of text plus its padding and border, at the week card's place under the head and its width.
    • AC6: a width sweep from 320 to 1,440 px: the text stays on one line inside the card, the page never scrolls sideways, and the size turns from 28 to 24 px at 700 px.
    • AC4: live, through the Home's own poll: the hours, then "Hours unavailable", then no section, then "Hours unavailable" again; offline, it stays, with "Offline · as of 09:41"; then the hours come back.
    • AC2, AC3: a Home with neither member leaves the section out; one with a week and unavailable shows the hours.
    • AC5: the Time page's card keeps its hours, label and bar.
    • Two throwaway CSS mutants (a taller card; text that wraps) fail the spec, so its box and one-line checks aren't vacuous.
  • AC5: the built CSS of main and of this branch differ by one rule, the new .unavailable{color:var(--ink-muted)}.
  • Contrast of the muted text on the card: 6.69:1 in light, 6.82:1 in dark (WCAG AA asks 3:1 at this size).

Review

One blocking finding, fixed:

  • §7's bullet still said "as until the time service exists", stale since the time service exists. It now says "as without Jira or without a time service to ask", and the offline bullet says the last "Hours unavailable" stays too.

Non-blocking:

  • HomePage keeps when the section shows as a template branch: one comparison, which a .ts helper would only move.
  • The state type's name, State, is generic; it's private to home/api.ts and mirrors home's Go type, screen.State.
  • The repository's end-to-end test checks the text's type and colour; the box comparison and the width sweep stay in QA's spec, as before.
  • The Home's card doesn't say why the hours are unavailable; the Time page's failure lines do (decision 184).

Shots

The demo Home, with "weekState":"unavailable" and no week.

The Home on a desktop, light
The Home on a desktop, dark
The Home on a phone, light
The Home on a phone, dark

Gates

mise run check passed locally after the review's fix:

  • Go fmt; golangci-lint (0 issues); buf lint and format; jactionlint; process-compose dry run; gen:check; govulncheck (none that the code calls);
  • Go tests with -race, Go coverage 96.0% total;
  • Biome, svelte-check (0 errors, 0 warnings), tsc, knip, pnpm audit (none);
  • Vitest, 1,108 tests;
  • Playwright E2E, 339 passed and 7 skipped.

SonarQube Cloud runs on demand (decision 132).

Merged under the user's standing OK (2026-10-26): merge once CI's check is green, and review everything at the end.

Since #155, home's answer says how asking the time service for the week
went. When home couldn't get the week, the Home left "This week" out, as
if Jira weren't set up. It now keeps the section's head and link, and the
week card says "Hours unavailable" in the hours' type, muted, without
the label and the bar (decision 187).
@Bakhomious
Bakhomious merged commit b1a03a1 into main Oct 29, 2026
2 checks passed
@Bakhomious
Bakhomious deleted the step/week-unavailable branch October 29, 2026 17:05
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