Skip to content

fix(app-space): render tutorial time as minutes, not seconds - #2862

Merged
jung-thomas merged 1 commit into
DEVfrom
worktree-fix-appspace-time-units
Oct 20, 2026
Merged

jung-thomas merged 1 commit into
DEVfrom
worktree-fix-appspace-time-units

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

Problem

The App-space / Developer Garage track view showed per-tutorial times as "0 min" or "1 min", while the tutorial object page and mission/group cards showed the correct, larger times.

Root cause

timeToComplete comes from Tutorials.averageTimeToComplete, which is stored in minutes (sourced from frontmatter time; admin label is literally "Avg Time (min)"). The island's formatTime(seconds) divided the value by 60:

  • 15 min → round(15/60) = 0 min
  • 30–89 min → 1 min

Every other consumer (tutorial object page u1-object-page.html, mission/group card-group.html) renders this value as minutes directly.

Fix

hugo-apps/src/app-space/AppSpace.vue — formatTime now treats its input as minutes (drop the /60); the hr/min rollover operates on the real minute count. Both call sites already pass minutes (item.timeToComplete and the summed trackTotalTime), so no other change is needed.

Tests

New AppSpace.time-format.test.ts: 15 → "15 min" and 45+45 → "1 hr 30 min". Both fail against the old /60 behaviour and pass with the fix (verified by temporarily reintroducing the bug). Full app-space suite green (7/7).

Note (not in this PR)

Two related spots have the same minutes-vs-seconds ambiguity and may warrant a follow-up:

  • srv/developer-service.js:622 (getEventProgress twin) — same field shape, same latent bug if rendered the same way.
  • srv/lib/build-catalog.js:59 does the opposite (/60 on averageTimeToComplete for missions) — internally inconsistent with the ~6 other minutes-as-minutes consumers.

Left alone here to keep the fix minimal; flagging for a maintainer decision on the canonical unit.

AppSpace track view passed averageTimeToComplete (stored in minutes,
from frontmatter `time`) into formatTime(seconds), which divided by 60.
A 15-min tutorial rendered as "0 min" and 30-89 min as "1 min", while
the tutorial object page and mission/group cards render the same value
as minutes directly.

Treat formatTime's input as minutes (drop the /60); hr/min rollover now
works on the real minute count. Adds unit coverage asserting 15 -> "15 min"
and 45+45 -> "1 hr 30 min" (both fail against the old /60 behaviour).
@jung-thomas
jung-thomas merged commit b1818bd into DEV Oct 20, 2026
5 checks passed
@jung-thomas
jung-thomas deleted the worktree-fix-appspace-time-units branch October 20, 2026 20:22
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