Repository navigation
feat(desktop): Restart Tutorial deletes the previous clone - #3365
Conversation
… a clean one in the guide
|
Review of #3365 (read-only; nothing run against ~/stim-tutorial or ~/.stim). Findings, most important first
Dialog bindings look right. The Tests and policy
|
…mes its worktrees and guards re-entry
|
Fresh review of head 0f0e0bf (read-only; nothing run against ~/stim-tutorial or ~/.stim). Earlier findings, verified fixed
Remaining, low priority (not blocking)
Nothing actionable remains for merge. |
|
Heads-up: #3367 (tutorial share step) merged and also regenerated apps/desktop/Sources/StimKit/TutorialSteps.swift from tutorial-data.ts. The branches merged cleanly, but after merging main please rerun node apps/desktop/scripts/generate-tokens.mjs so the generated file reflects both changes. |
Description
After Restart Tutorial, the agent follows
stim guide tutorial run, finds~/stim-tutorialfrom the earlier run (a clean clone withnode_modules) and stops to ask for another folder, as the guide says. Restart never removed the previous clone.Solution
Desktop: Restart looks at the recorded clone path (else
~/stim-tutorial). With no folder it restarts as before. With a folder it asks "Restart deletes and its tutorial worktrees." with Cancel and Delete & Restart. The only guard is the tutorial marker (expo.extra.stimTutorialinapp.json); a folder without it is left alone and the alert says so. On confirm it runsstim stopandstim worktree remove(no--force) for each linked worktree, then for the clone, then moves the folder to the Trash withFileManager.trashItem. Any Stim refusal stops the restart and is shown in an alert. Uncommitted changes are covered by the confirmation and the Trash, not a separate refusal.Guide:
stim guide tutorial runreuses an existing{base}whenapp.jsoncarries this version's marker,originisappandflow/stim-tutorial, the git root is{base}, andgit status --porcelainis empty; it then runsnpm ciandstim doctorand continues. Any other existing folder still stops and asks. Website docs match.Second commit: the Make a Change step text is two sentences, has a copyable prompt box, and the leftover Run iOS button is gone.
Test plan
TutorialCleanupTests(plan: marker removes with its worktrees, no marker refuses; marker read fromapp.json), the Tutorial test filter,swift build -Xswiftc -warnings-as-errors,scripts/format.sh,check-ascii.mjs.pnpm testguide tests updated for the reuse rule;lint,typecheck,knip,format:checkpass.stim stop,stim worktree remove <worktree>,stim stop,stim worktree remove <clone>) against scratch clones under a privateSTIM_HOME; both succeeded and left the source folder for the Trash step.Fixes #3359