You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
polish(desktop): tutorial completion card with stats and achievements - #3387
The last part of #3376. The tutorial ended on a plain "Tutorial Complete" label. This PR replaces it with a completion card built from the stats #3384 now keeps, plus achievements for the optional steps.
Solution
TutorialCompletionCard replaces the label at the top of the finished panel and keeps the archive note and Open Archived.
Header: the time from clone to archive: the end of Finish and Archive (stepTimes["delete"], or stepTimes["done"] without it) minus startedAt. It doesn't grow while Delete waits.
Tiles, each shown only when its data exists:
the first build's time;
the second build's time, labelled "cache hit" when it came from a cache, with the time saved;
the two worktrees, "building at once" when the builds overlapped;
the agent actions to replay;
after Delete, the space freed: the summed worktreeBytes of the two worktrees and the clone.
Badges: one per optional step: Hands on, Replay, Logs, Pocket Stim (only when the phone app is enabled), Shared, Clean slate. A badge is solid when the step is in record.done and dashed when it was skipped. A step that hasn't been reached yet, such as Delete while it is current, has no badge. Next records a step as done only when its checkpoint saw the evidence, and as skipped otherwise, so a solid badge means Stim saw the evidence.
It reads only the TutorialSnapshot the panel already has. The done screenshot fixture now carries sample stats and skips Logs and Phone, so the render shows the full card. The Desktop docs describe the card.
Light and dark, from the done fixture:
Test plan
STIM_TUTORIAL_SHOTS=<dir> swift test --filter TutorialScreenshotTests renders the card in both schemes (above).
swift test -Xswiftc -warnings-as-errors passes, and scripts/format.sh --check and check-ascii.mjs are clean.
stim macos from apps/desktop builds and launches, and stim logs --errors is empty.
apps/desktop/Sources/StimDesktop/Views/TutorialCompletionCard.swift:~85 (total): the header says "from clone to archive", but once the tutorial is done it uses stepTimes["done"], which is when the Delete step ended (Next or a successful delete). While Delete is still current it uses stepTimes["delete"], the end of Finish and Archive. The same tutorial therefore shows a longer time after Delete, and the time grows with how long the user sits on that step. Use stepTimes["delete"] (the Delete step start, i.e. archive time) whenever present, falling back to done only if it is missing.
TutorialCompletionCard.swift:~100 (achievements): the card also shows while currentStep == "delete" (isFinished). Then "Clean slate" is neither done nor skipped but still renders dashed with the accessibility label "skipped". Delete is pending there and the user can still complete it. Give pending its own look and label (or omit the badge until Delete is done or skipped), and base earned on record.skipped vs record.done so only a real skip reads as skipped.
PR description and docs/desktop.md: "a badge means Stim saw the evidence" is overstated, since markDone can complete a step manually after 120 s without evidence. Reword.
Minor, no change needed: "freed" sums worktreeBytes only for folders that were measured, so it can understate if the clone was never measured. Build with -warnings-as-errors passes, ASCII check clean, no new data reads (the card only uses the snapshot), both commits fit the polish definition.
Addressed in 1c4f42a: the header now uses the end of Finish and Archive, and only done or skipped optional steps get a badge (none for Delete while it is current). On the evidence claim: markDone no longer exists on main (#3380 replaced it with Next), and next(now:) records a step as done only when its checkpoint finished it, otherwise as skipped, so the wording stays.
Finding 1 resolved: the header uses stepTimes["delete"] (the start of Delete, set in advance/update), falling back to done, so it no longer grows while Delete waits.
Finding 2 resolved: badges render only for optional steps in record.done or record.skipped; Delete while current has none, and the phone step auto-skipped without the phone app (advance without a skip entry) has none either.
Finding 3 correctly rebutted: next(now:) appends to done only when the step was finished by its checkpoint, otherwise to skipped. Narrow caveat, no change needed: the launch-time resume path marks every non-skipped pre-Delete step done without evidence.
Tiles are each hidden when data is missing; "cache hit" vs "second build" keys on cache == "none"; freed needs done to contain delete and measured bytes above 0. Panel wiring, the fixture change, docs and PR description match the code. Both commits fit the polish definition (look and copy only, snapshot data already read). swift build -Xswiftc -warnings-as-errors passes. Desktop CI was still pending when I checked.
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
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.
Description
The last part of #3376. The tutorial ended on a plain "Tutorial Complete" label. This PR replaces it with a completion card built from the stats #3384 now keeps, plus achievements for the optional steps.
Solution
TutorialCompletionCardreplaces the label at the top of the finished panel and keeps the archive note and Open Archived.stepTimes["delete"], orstepTimes["done"]without it) minusstartedAt. It doesn't grow while Delete waits.worktreeBytesof the two worktrees and the clone.record.doneand dashed when it was skipped. A step that hasn't been reached yet, such as Delete while it is current, has no badge. Next records a step as done only when its checkpoint saw the evidence, and as skipped otherwise, so a solid badge means Stim saw the evidence.It reads only the
TutorialSnapshotthe panel already has. Thedonescreenshot fixture now carries sample stats and skips Logs and Phone, so the render shows the full card. The Desktop docs describe the card.Light and dark, from the

donefixture:Test plan
STIM_TUTORIAL_SHOTS=<dir> swift test --filter TutorialScreenshotTestsrenders the card in both schemes (above).swift test -Xswiftc -warnings-as-errorspasses, andscripts/format.sh --checkandcheck-ascii.mjsare clean.stim macosfromapps/desktopbuilds and launches, andstim logs --errorsis empty.Refs #3376