Repository navigation
feat(desktop): keep tutorial stats and complete App Logs from the Logs view - #3384
Conversation
TutorialRecord.stats keeps the first and second build, the agent action count and each tutorial folder's measured size after the workspaces are removed. App Logs completes when the Logs view of a tutorial workspace appears. Fixes #3377
|
Review: one actionable problem, plus test and ordering notes. Format check and
Checked and fine:
|
|
Review: clear. Fresh re-review of the whole diff; Earlier findings:
Also checked: first build uses the same selection and since as the build checkpoint, second build the same as parallel; comments are doc comments; no other issues. |
Description
The illustrated tutorial (#3376) rewards finished steps with real numbers and achievements. Two gaps made that dishonest:
TutorialEnvironmentworkspaces. Finish and Delete remove those workspaces, so a completion card had nothing to show.Solution
TutorialRecord.stats, a new optionalTutorialStats, is written byTutorialProgress.updatewhile the data is visible and never cleared:agent_actionrecords seen on the first change's simulator since the tutorial started.worktreeBytes(both worktrees and the clone), for a "freed" figure after Delete. It usesworktreeBytesonly, which includes node_modules.buildBytesis left out because removal archives part of it.savedMs,buildsOverlappedandmeasuredBytesare derived from those fields. The record lives in Desktop's own preferences (tutorial.progress), so an older record simply has nostats.App Logs now completes, with a Logs opened tick, when the user shows a tutorial worktree's Logs while the App Logs step is current. A new
TutorialViewerEvent.logsOpened(path)comes from two places:WorkspaceDetail, when its Logs view appears for a live workspace while the tutorial hint's step islogs;TutorialProgressaccepts the event only for the two tracked worktree paths. Logs left open from an earlier step, archived logs and the build sheet's logs don't count.I checked the other steps for the same gap:
worktree.pullRequest(feat(desktop): tutorial guided steps: one Next, prompts, glows, live-view ticks, PR detection #3380).No other step relies on Next alone.
Test plan
TutorialProgressTests:stats, still decode (the existing legacy-record case).swift test -Xswiftc -warnings-as-errorspasses.stim macosfromapps/desktopbuilds and launches, andstim logs --errorsis empty. The screen was locked, so I couldn't click through to Logs in the running app; the event wiring is covered by the build and the unit test above.Fixes #3377