Skip to content

Add a guided tutorial to the dashboard - #285

Merged
coryodaniel merged 8 commits into
dashboardfrom
dashboard-tutorial
Nov 30, 2026
Merged

coryodaniel merged 8 commits into
dashboardfrom
dashboard-tutorial

Conversation

@coryodaniel

Copy link
Copy Markdown
Member

Stacked on #284.

mass dashboard --tutorial walks through what everything on the map means, on a made-up organization, with no profile and no API calls.

  • The organization has seven environments in three projects. Between them they show:
    • every instance status, a firing alarm, a running deploy, a deploy awaiting approval, and an upgrade
    • a fork, a banner, traffic with errors, and notes and links
    • an environment out of view (🔭) and one you can't access (◌)
  • Eighteen steps, each locking on to what it explains with the same reticle as --watch, under a caption box:
    1. the constellation
    2. rings
    3. instances
    4. alarms
    5. deploying
    6. selection
    7. sparks
    8. forks
    9. blast radius
    10. upgrades
    11. banners
    12. notes and links
    13. out of view
    14. no access
    15. flashes, fired live
    16. the ticker
    17. the side panel
    18. the keys
  • →, space or enter goes to the next step, ← back, and q or esc quits. After the last step you're left on the demo organization to try the keys. Writes are refused.

The tutorial's API embeds the recording API from --playback, with a fixed clock, a backlog of audit events for the ticker, and sample logs for f.

🤖 Generated with Claude Code

coryodaniel and others added 2 commits November 28, 2026 01:03
@coryodaniel

Copy link
Copy Markdown
Member Author

@claude please review.

@claude

claude Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Claude finished @coryodaniel's task in 33s —— View job


Review of #285: guided tutorial for mass dashboard

I read the full diff and tutorial.go. I didn't run make check or the tests; this is a read-only review. The design is sound. It fits the layering rules: cmd/ only wires the flag, the logic and fakes live in internal/commands/dashboard, there is no new file in cmd/, and the docs are updated. I found nothing blocking. These are the points I'd look at:

Behavior

  1. --theme is silently ignored with --tutorial. Tutorial() forces cfg.Theme = ThemeConstellation (tutorial.go:32), and cmd/dashboard.go doesn't pass theme into the config. The captions describe constellation visuals, so the choice makes sense. But mass dashboard --tutorial --theme radar runs without any warning. Either reject the combination or say in the flag help that the tutorial always uses constellation. Likewise --watch, --read-only, --env and --depth are dropped, and --tutorial wins over --playback. A one-line "mutually exclusive" check in cmd/ would be cheap.

  2. Step 6 ("Selection") describes behavior the tutorial disables. The caption says "once it rests the map re-centers there", but refocus returns early when m.tutorial.on (model.go), and the arrow keys are captured by handleTutorialKey anyway. The user can't see this during the tour. After the last step the re-centering works, since refocusSeq++ is bumped. Consider rewording the caption, for example "…and in the free-roam part after the tour, once it rests the map re-centers".

  3. The clock is frozen, so nothing ages. cfg.Now = func() time.Time { return now } keeps the fixtures fresh, as the comment says. It also means ticker ages and "running for 2m" never advance, and the live flashes in steps 15–16 are all stamped with the same At. That is probably fine for a demo. It is worth knowing if someone later wonders why "2m ago" never changes.

  4. The final step has no way to leave the tour except →, and q quits the whole program. q always exits the program rather than skipping to the explore state, which matches the PR description. If users ask for "skip to explore", that would be an extra key.

  5. h/l also move between steps (tutorial.go:89,96), but the footer and docs list only →/←/space/enter. That's harmless. Either document it or drop it so it doesn't conflict with any h/l meaning once the tour ends.

Repo conventions (CLAUDE.md)

  1. Comments on unexported helpers. CLAUDE.md says no doc comments on unexported helpers, and to comment only on why.
    • tutorialOverlay (tutorial.go:163-164) has a "lays the step's caption over the map…" comment that restates what the code does.
    • The env is selected and locked on… field comment on tutorialStep and the // Tutorial walks through… comment on Config.Tutorial are borderline. The latter is on an exported field, so it's fine.
    • Keep the comments on tutorialFlashEvery, the frozen clock and shown, since they explain why.

Minor

  1. handleTutorialKey leaves m.tutorial.step stale-safe, but showStep returns early when m.graph == nil. tickTutorial re-calls showStep once the graph loads, because shown != step. That is good, and it's the only reason the first step works with async loading. A test that presses → before the graph loads would lock this in. I couldn't tell whether TestTutorialKeys covers it, so check.

  2. demoVault (secops-vault) has no Environment, only references from ecomm-prod-api's dependency. The "no access" step relies on the model synthesizing a restricted node from the dependency. If that inference ever changes, step 14 will silently lose its subject. TestTutorialSteps seems to check each step's selection exists, but confirm that it covers demoVault.

Summary

Approve-worthy once the --theme conflict is handled (1) and the unexported doc comment is trimmed (6). Item 2 is a small caption fix. Please run make check and make docs; CI will catch any docs diff.

@coryodaniel

Copy link
Copy Markdown
Member Author

Fixed in ae79068, with #284 merged in:

  • 1: --tutorial now refuses --theme, --watch, --read-only, --env, --depth and --playback with a clear error, and its help says it plays on its own made-up org.
  • 2: the step 6 caption and the same claim in step 13 are reworded to be true while the tour runs.
  • 3: only →, space and enter go forward, and only ← goes back. h and l are gone.
  • 6: the doc comment on tutorialOverlay is removed. The comments left explain why: the frozen clock, the flash spacing, shown starting at -1.
  • 7: TestTutorialStepBeforeLoad presses → before the first read lands. TestTutorialSteps asserts secops-vault is selected on the no-access step, which needs it on the map.

@claude please review.

@claude

claude Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Claude finished @coryodaniel's task in 26s —— View job


Re-review of #285 at ae79068

I read the diff and tutorial.go. I didn't run make check or the tests. Items 1, 3, 6 and 7 are fixed and I have no concerns about them. Item 2 is only half fixed.

Still open: two captions describe behavior the tour disables

refocus returns early while m.tutorial.on (model.go). handleTutorialKey also swallows the arrow keys. So during the tour the selection can't move and the map never re-centers. Two captions still say it does:

  • Step 6, Selection (tutorial.go:274-276): "When you move the selection with the arrow keys, the map re-centers there once it rests."
  • Step 13, Out of view (tutorial.go:322-324): "Move the selection onto it with the arrow keys and the map re-centers there."

ae79068 changed the wording of both, but each still reads as something you can do now. Add a clause that says it applies after the tour, for example "Once the tour ends, moving the selection with the arrow keys re-centers the map there once it rests." Step 13 needs the same kind of edit. Since these are caption strings, make docs isn't affected, but TestTutorialSteps matches caption substrings, so check its expectations for these two steps.

Verified

  • Flag conflicts (1): runTutorial rejects theme, watch, read-only, env, depth and playback via Changed. It runs before newMassdriverClient, so there are no profile or API calls. --render, --flashes and --palette are still passed through, which makes sense. The generated docs and helpdoc match the flag text.
  • Keys (3): only right, space and enter go forward. Only left goes back. q, esc and ctrl+c quit. The footer matches.
  • Comments (6): the remaining comments explain why. They cover the frozen clock, the flash spacing, and shown starting at -1.
  • Tests (7): TestTutorialStepBeforeLoad exists. TestTutorialSteps expects secops-vault on the "No access" step. TestTutorialOrganization also asserts it is Restricted, which covers the case where the model stops synthesizing that node.

Minor, not blocking

  • The Flashes and Ticker steps have no env, so the selection stays on secops-vault, the restricted ring from step 14. The tests assert this. It means the side panel and lock-on there describe a no-access environment while the captions are about events. Setting env: demoStore on those two steps would be more natural, if you don't mind updating the test's expected selection.
  • tutorialOverlay returns body unchanged when the box would be under 24 columns wide. On a very narrow terminal the user then sees the map with no captions, and the footer still advances steps. That is acceptable, but a "terminal too narrow" notice would be friendlier.

Summary: fix the two captions and this is ready to merge from my side. No other blockers.
· branch dashboard-tutorial

@coryodaniel

Copy link
Copy Markdown
Member Author

Fixed in a818e50, with #284 merged in: both captions now say the re-centering happens on a live map, which is true and doesn't describe the steps themselves.

No change: the Flashes and Ticker steps keep the selection where it was. Their captions are about events across the map, not one environment.

@claude please review.

@claude

claude Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Claude finished @coryodaniel's task in 9s —— View job


Re-review of #285 at a818e50

I read the diff since ae79068 and the two captions. I didn't run make check or the tests.

Captions (fixed). Both captions now say the re-centering happens "on a live map", so they no longer describe something the tour disables:

  • Step 6, Selection (tutorial.go:275): "On a live map, moving the selection with the arrow keys re-centers the map there once it rests."
  • Step 13, Out of view (tutorial.go:323): "On a live map, selecting it re-centers the map there."

tutorial_test.go has no assertions on this wording, so no test needed changing.

Flashes and Ticker selection (no change). Your reasoning is fine. The captions are about events across the map, so leaving the selection where it was is acceptable.

Not blocking. On a very narrow terminal (box under 24 columns), tutorialOverlay shows the map with no captions. That is still acceptable.

I found nothing else. This is ready to merge from my side, as long as make check and make docs are clean in CI.
· branch dashboard-tutorial

Base automatically changed from dashboard-ticker-widgets to dashboard November 30, 2026 06:12
@coryodaniel
coryodaniel merged commit 986c7ae into dashboard Nov 30, 2026
2 checks passed
@coryodaniel
coryodaniel deleted the dashboard-tutorial branch November 30, 2026 06:12
@coryodaniel

Copy link
Copy Markdown
Member Author

Folded into #272.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant