Repository navigation
polish(desktop): tutorial highlights only on controls, as a fading glow - #3164
janicduplessis wants to merge 2 commits into
Conversation
janicduplessis
left a comment
There was a problem hiding this comment.
Fresh review of #3164 (diff, three commits, issue #3154, polish rules). Read from the diff and origin/polish/3154-tutorial-highlight; I did not build or run it. CI build was still pending.
Must fix
-
The pulse never stops after the fade.
TutorialGlow(Design/TutorialAnchors.swift,.onAppear, about line 148) startsrepeatForever(autoreverses: true)onpulsed. The 4 s task only setsshown = false, which sets opacity to 0. The view stays in the tree and the animation keeps driving a blur and stroke-width change at opacity 0 until the step or page changes. That is the CPU cost you asked about. Fix: after the fade, remove the glow (render it onlyif shown, or call back to the parent to drop it). Or setpulsed = falsewith a non-repeating animation when fading, and start the pulse again whenshownbecomes true. -
"Show Me" now appears on steps that never had it. Before, the whole block was
if let hint, let id = hint.anchor, so the fallback button only showed for steps with an anchor. Now it isif let hint, so theshowFallbackbranch also runs for steps whose anchor is nil: begin, phone, machine and the default case. It shows whenever the tour workspace is not the selected page. Removing the build, rebuild and agent anchors keeps their button, as before (theiridbecomes nil and the match fails, so they fall to the same branch). The extra button on begin, phone and machine is a behavior change to a navigation control, and the polish definition excludes navigation changes. Either restrict the fallback to the steps that had it (hint.anchor != nil || ["build","rebuild","agent"].contains(hint.step)), or take it out of this polish PR into its own issue. Say which in the PR body.
Should fix
-
The glow re-shows whenever the target view is recreated, so it is not limited to step and page changes. The glow is created only while a match exists and
intersectsthe bounds. If the target leaves and re-enters (scrolling the sidebar or device list off screen and back, inspector toggle, a list re-render that drops the anchor for a pass),TutorialGlowis recreated,@Stateresets, and it glows for 4 s again. That matches "when the target first appears" in the PR body, but a transient re-render re-flashes. Staying on a static page does not repeat it. Decide whether this is acceptable; a "shown for this restartKey" record in the parent would stop it. -
The two commits that move the build anchor to the header and then remove it are churn. Commit 221dda8 adds
.tutorialAnchor(.buildSection)on the header, and 7b5c67a removes it, so the net diff of the first commit disappears. The polish rule asks for one commit per change. Squash the build-anchor work into the audit commit so no commit leaves a state the PR does not ship. -
Commit prefixes. Recent polish PRs on main use
polish(desktop):(a34e7fc, 32e7726, 7a274a4, 1cd98ea, cf6e365). The PR title matches, but all three commits usefix(desktop):/feat(desktop):. If the merge is a squash on the title this is harmless. If commits are kept, rename them topolish(desktop):.
Nits
TutorialHint.calloutdefault:("Follow the tutorial workspace") is now unreachable, because the glow only renders whenhint.anchoris non-nil. Delete it.id != nil && $0.key.id == idplusif let id, let matchchecks the same thing twice. Hoistingguard let idis simpler.- The callout picks above or below the target by checking only
rect.minY - 24 >= 0. The old code checked room below againstgeometry.size.height; the new fallback to below is unchecked. A target at the top that also reaches the bottom is unlikely, so low risk. reduceMotionis read once inonAppear. Toggling Reduce Motion while the glow is up does not stop a running pulse. This is rare;@Environment(\.accessibilityReduceMotion)itself is the right key.
Checked and fine
- Timers: the 4 s sleep lives in
.task(id: restartKey), so it is cancelled on disappear and on a key change, andTask.isCancelledguards the fade. - Restart:
restartKeyis step plus selected path, so a step or page change re-shows without remounting. A restart after a fade pops back to full opacity without animation, which is fine. - Step completion: it is driven by
TutorialProgress/TutorialModelsnapshots and does not read anchor preferences. No remaining reference to the removed keys (buildSection,cacheBadge,agentActionsas anchor,replay) inapps/desktop; the otheragentActionshits are unrelated retained-bytes fields. The.tutorialAnchorcall sites that remain match the five enum cases (sidebarRow, deviceTile, viewerControl, logsTab, archivedFilter). - Show Me behavior for removed steps:
RootView.tutorialHint.showMestill navigates and opens logs for "agent". Unchanged. - The Build sheet no longer gets the hint (
.environment(\.tutorialHint)and.tutorialHighlights(showFallback: false)both removed), and the three duplicate.buildSectionpublishers are gone..tutorialHighlights(showFallback:)is still used correctly on the root (true) and the viewer sheet (false). Palette.onPrimaryexists (Tokens.swift:79).- Beyond item 2, no commit changes commands, data, navigation or dependencies.
- Gaps the author already listed: no dark-mode or per-step glow crops, and no screenshots of the final state on the kept steps. The polish rule asks for a screenshot or recording of each change on each affected platform; add at least the device and Logs steps.
Verdict: not clear to mark ready. Fix items 1 and 2, squash item 4, and add the missing screenshots. Items 3 and 5 are judgment calls.
…ever the Build sheet
…ades after 4 seconds
7b5c67a to
01c0709
Compare
|
Folded into #3380: its fading glow (pulse, capsule label, 4 s fade, Reduce Motion) is in TutorialAnchors.swift there, rebuilt on current main. Closing this draft. |
…view ticks, PR detection (#3380) * feat(desktop): drop the tutorial's commands disclosure Refs #3366 * feat(desktop): one Next button per tutorial step Refs #3366 * feat(tutorial): give the parallel change a copyable prompt that asks for a new worktree Refs #3366 * feat(tutorial): the agent checks each change on the device with agent-device Refs #3366 * feat(desktop): tutorial glow points at the launch notice's Show button Folds the fading glow from #3164: a pulsing halo with a capsule label that fades after four seconds, only on controls a step names. Refs #3366 * feat(desktop): Agent Actions and Replay step glows the actions list, then Replay, and ticks both Refs #3366 * fix(desktop): Live View and Control ticks either tutorial simulator, glows its screen and stays in view Refs #3366 * feat(desktop): Share Your Finish detects the pull request from the first change's worktree Refs #3366 * fix(desktop): tint the tutorial's Open the build link Refs #3366 * fix(desktop): let taps pass through the viewer's tutorial card; align docs with the removed manual section Refs #3366
Description
The tutorial highlight appeared where it did not help. During "First iOS Build" it outlined the Build sheet's build detail card (the
.buildSectionanchor inBuildSheet.swiftplus the tutorial hint injected into the sheet inWorkspaceDetail.swift) and, on the page behind, a status or build region. On "Rebuild from Cache" it outlined the header status line while the label talked about build details. The highlight was also a solid stroke with the label notched into its edge.I could not reproduce the large page rectangle from the maintainer's screenshot (device tile through logs). In my copy the build step outlined the header status line only. I did not find which anchor produced the larger region; it no longer exists because the build anchors are gone.
Solution
Two commits:
TimelineView(about 1.4 s per cycle), so nothing animates once the glow has faded and left the view tree after 4 s. It shows again when the step or selected page changes, or when the target comes back after being absent for more than 1 s. Reduce Motion: no pulse, same fade.Test plan
Own test copy via
stim macosfromapps/desktop, with a temporary local override forcing the tutorial step (not committed), so the maintainer's tutorial state was not changed.stim logs --errorswas empty.Before (header status line outlined, label notched in the border) and after (glow with capsule label, then faded after 4 s), build step, captured before the audit removed that step's highlight:
Not verified: dark mode crops and a glow crop on each kept step (sidebar, device, logs, Archived). The machine was at load average 700 and the test copy fell back to the setup guide, so I stopped capturing.
swift buildandswift testwith-Xswiftc -warnings-as-errors,scripts/format.sh --checkandcheck-ascii.mjspass.Fixes #3154