Repository navigation
fix(app-space): render tutorial time as minutes, not seconds - #2862
Merged
Merged
Conversation
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).
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.
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
timeToCompletecomes fromTutorials.averageTimeToComplete, which is stored in minutes (sourced from frontmattertime; admin label is literally "Avg Time (min)"). The island'sformatTime(seconds)divided the value by 60:round(15/60)= 0 minEvery other consumer (tutorial object page
u1-object-page.html, mission/groupcard-group.html) renders this value as minutes directly.Fix
hugo-apps/src/app-space/AppSpace.vue—formatTimenow 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.timeToCompleteand the summedtrackTotalTime), 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/60behaviour 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(getEventProgresstwin) — same field shape, same latent bug if rendered the same way.srv/lib/build-catalog.js:59does the opposite (/60onaverageTimeToCompletefor 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.