Skip to content

feat(editor): entry tours (workspace-shell C3) - #223

Merged
byrongamatos merged 3 commits into
mainfrom
feat/editor-tours
Jul 12, 2026
Merged

byrongamatos merged 3 commits into
mainfrom
feat/editor-tours

Conversation

@ChrisBeWithYou

@ChrisBeWithYou ChrisBeWithYou commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Workspace-shell Phase C3 (charrette §3.5). Two short, task-based first-run tours in a new src/tour.js, seeded by how you entered the editor (the same C1 lane signal). Requires B4/B5/C1 — all merged.

The two tours (≤4 steps each)

  • Compose (create-from-scratch): place → snap → play → loop.
  • Transcribe (import): leads with the reframe "the recording never moves — you line the GRID up to it," taught by doing — turn on Onsets → put the first barline on the first attack → tap tempo → switch snap to Onset.

How it works

  • A small state machine — start / advance / skip / resume / complete + the escape transition — drives a non-modal card (never blocks the canvas).
  • Task-based: steps advance when you actually do the task (the tour listens on the existing action sites — note placement, snap change, play, onset toggle, tempo-map entry, tap tempo, snap→onset), or via the card's Next button, so you're never stuck.
  • Skippable + resumable from Help ▸ Editor tour (which replays a completed tour from the top).
  • Transcribe's "I'll align later" drops you into the Compose tour.
  • A tour auto-starts at most once per lane; all state is editor-pref (localStorage), never the pack. It closes on a fresh song load, keeping the resume point.

Tests & verification

  • tests/tours.test.mjs (8): one-time auto-start, step advance (Next and the matching task action), completion, skip-keeps-resume, Help resume/replay, escape→Compose, load-reset, and ≤4 task-based steps.
  • Verified live on the testbed: Help opens the Transcribe tour; toggling Onsets advances the task step (1/4 → 2/4); Next advances; "I'll align later" switches to Compose; Skip closes it; no console errors. (Non-modal card; renders top-centre over the display-only waveform.)
  • npm test 115 green, npm run lint 0 errors (3 pre-existing warnings = main's ratchet). screen_markup + menu_model stay green (new card is a balanced sibling of the canvas; Help gains the "Editor tour" row).

Completes the workspace-shell onboarding track (C1 #216 · C2 #222 · C3 this). Independent of the tempo track.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added first-run Editor tours for composing new entries and transcribing imported content, with short, non-modal, skippable guidance.
    • Added Help ▸ Editor tour to replay/resume tours, with progress remembered separately per workflow and each tour running at most once per lane.
    • Tour steps react to common actions (e.g., placing notes, onset strip/snap changes, Tempo Map and Tap Tempo), and the tour resets/hides appropriately when loading a new song.
    • Added an option to defer alignment during the importing tour.
  • Tests
    • Added coverage for tour progression, skipping, resuming, completion, and persistence.

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7602012a-6594-4d1f-95d5-46f4623151c0

📥 Commits

Reviewing files that changed from the base of the PR and between a822338 and a431ea3.

📒 Files selected for processing (9)
  • CHANGELOG.md
  • screen.html
  • src/file-ops.js
  • src/input.js
  • src/main.js
  • src/menu-bar.js
  • src/tempo.js
  • src/tour.js
  • tests/tours.test.mjs
🚧 Files skipped from review as they are similar to previous changes (5)
  • CHANGELOG.md
  • screen.html
  • src/file-ops.js
  • tests/tours.test.mjs
  • src/tour.js

📝 Walkthrough

Walkthrough

Adds Compose and Transcribe first-run editor tours with persisted progress, Help-menu replay, action-driven advancement, entry-flow startup, load reset behavior, UI controls, and isolated tests.

Changes

Editor entry tours

Layer / File(s) Summary
Tour state and rendering
src/tour.js
Defines the Compose and Transcribe steps, per-lane persistence, resume/restart behavior, progression, escape handling, completion, and tour-card rendering.
Tour entry points and controls
screen.html, src/create.js, src/main.js, src/menu-bar.js
Adds the tour card, Help-menu entry, global controls, and automatic startup after Compose or Transcribe entry flows.
Editor action progression
src/add-note.js, src/audio.js, src/input.js, src/main.js, src/tempo.js, src/file-ops.js
Routes note placement, onset and snap changes, playback, Tempo Map, tap tempo, and song loading into tour state updates.
Tour documentation and tests
CHANGELOG.md, tests/tours.test.mjs
Documents the entry tours and verifies persistence, replay, advancement, escape behavior, load reset, and step structure.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Editor
  participant TourState
  participant LocalStorage
  participant TourCard
  Editor->>TourState: start Compose or Transcribe tour
  TourState->>LocalStorage: read or persist lane state
  TourState->>TourCard: render current step
  Editor->>TourState: report matching editor action
  TourState->>TourCard: advance and render next step
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 41.94% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding editor entry tours.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/editor-tours

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/tour.js`:
- Around line 106-109: Update editorTourEscape to set LS_SEEN('compose') before
calling _tourStart('compose', 0), while preserving the existing current-lane
marking behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6c8f9c00-6577-49d4-9585-60a105f23eb5

📥 Commits

Reviewing files that changed from the base of the PR and between 2a764a1 and 08dbaf7.

📒 Files selected for processing (12)
  • CHANGELOG.md
  • screen.html
  • src/add-note.js
  • src/audio.js
  • src/create.js
  • src/file-ops.js
  • src/input.js
  • src/main.js
  • src/menu-bar.js
  • src/tempo.js
  • src/tour.js
  • tests/tours.test.mjs

Comment thread src/tour.js
Charrette §3.5. Two ≤4-step, task-based first-run tours in a new src/tour.js,
seeded by how you entered the editor (the C1 lane signal):
  - Compose (create-from-scratch): place → snap → play → loop.
  - Transcribe (import): the reframe "the recording never moves — you line the
    GRID up to it," taught by doing — turn on Onsets, put the first barline on
    the first attack, tap tempo, switch snap to Onset.

A small state machine (start / advance / skip / resume / complete + the escape
transition) drives a non-modal card. Steps advance when the user actually does
the task — the tour listens on the existing action sites (note placement, snap
change, play, onset toggle, tempo-map entry, tap tempo, snap→onset) — or via
the card's Next button, so you're never stuck. Skippable, and resumable from
Help ▸ Editor tour (which replays a completed tour from the top). Transcribe's
"I'll align later" drops into the Compose tour. A tour auto-starts at most once
per lane; all state is editor-pref (localStorage), never the pack. Closes on a
fresh song load, keeping the resume point.

tests/tours.test.mjs (8): one-time auto-start, step advance (Next + matching
task action), completion, skip-keeps-resume, Help resume/replay, escape→Compose,
load-reset, ≤4 task-based steps. Verified live: Help opens the Transcribe tour;
toggling Onsets advances the task step; Next advances; "I'll align later"
switches to Compose; Skip closes it; no console errors. npm test 115 green,
lint 0 errors.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EBQCHCNA81E9tHmSDHSe2Q

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main.js (1)

1311-1320: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Only advance the Play step when playback starts.

_tourNoteAction('play') currently runs after both startPlayback() and stopPlayback(). If the tour is on the Play step while playback is already active, stopping playback incorrectly advances the tour without satisfying the task.

Proposed fix
-    if (S.playing) stopPlayback(); else startPlayback();
-    _tourNoteAction('play');   // C3 Compose tour: step 3 task
+    if (S.playing) {
+        stopPlayback();
+    } else {
+        startPlayback();
+        _tourNoteAction('play');   // C3 Compose tour: step 3 task
+    }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main.js` around lines 1311 - 1320, Update editorTogglePlay so
_tourNoteAction('play') is invoked only in the startPlayback branch, not after
stopPlayback; preserve the existing recording-finalization and playback toggle
behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/tours.test.mjs`:
- Around line 102-110: Add assertions to the test for the transcribe escape flow
to verify the Compose seen flag after completing the escaped-into Compose tour,
then call _editorMaybeStartTour('compose') again and assert it does not restart.
Preserve the existing assertions for the active Compose lane and transcribe seen
flag.

---

Outside diff comments:
In `@src/main.js`:
- Around line 1311-1320: Update editorTogglePlay so _tourNoteAction('play') is
invoked only in the startPlayback branch, not after stopPlayback; preserve the
existing recording-finalization and playback toggle behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3b9f482e-6bee-4dc4-9f46-2128a901fe77

📥 Commits

Reviewing files that changed from the base of the PR and between 5f5a847 and a822338.

📒 Files selected for processing (12)
  • CHANGELOG.md
  • screen.html
  • src/add-note.js
  • src/audio.js
  • src/create.js
  • src/file-ops.js
  • src/input.js
  • src/main.js
  • src/menu-bar.js
  • src/tempo.js
  • src/tour.js
  • tests/tours.test.mjs
🚧 Files skipped from review as they are similar to previous changes (7)
  • CHANGELOG.md
  • src/menu-bar.js
  • src/file-ops.js
  • screen.html
  • src/input.js
  • src/create.js
  • src/tour.js

Comment thread tests/tours.test.mjs
# Conflicts:
#	CHANGELOG.md
#	screen.html
#	src/file-ops.js
#	src/input.js
#	src/main.js
#	src/tempo.js
@byrongamatos
byrongamatos merged commit b6b6b2d into main Jul 12, 2026
4 checks passed
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.

2 participants