fix(editor): trust & ergonomics cluster — undoable phrase add, Escape-deselect, default sustain keys - #298
Conversation
|
Important Review skippedNo new commits to review since the last review. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughPhrase insertion now executes through undo history, Escape dismisses menus and clears selections in the appropriate editor modes, and FeedBack maps ChangesEditor interaction behavior
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
03ec9b3 to
a6aefbf
Compare
Three small, self-contained fixes that close credibility gaps in the manual editing loop. From a fresh gap-audit of
origin/main— the old ranked backlog is fully shipped, and these are the highest-value cheap wins that remain (one is a genuine undo-integrity bug).What changed
Fixed — Add-Phrase undo-trap (the integrity bug)
Adding a phrase (Shift+P) was the only structural add that bypassed
EditHistory. So pressing Ctrl+Z afterward silently rolled back whatever you did before the phrase (a note move, a fret change) and left the phrase sitting there — undo lied about what it undid. NewAddPhraseCmd(@pure:phrase-cmds) routes the add through the history, holding thearr.phrasesarray + phrase object by reference (neverS.currentArr, which can change before an undo) so exec↔rollback restore that arrangement's phrases exactly, sort order included. Mirrors the existingAddSectionCmdpattern.Changed — Escape clears the selection
In note/drum editing, Escape now drops the current selection — the standard DAW gesture, previously inert outside tempo-map mode. Layered under every existing Escape owner: the read-only Tab-preview / User-Guide lenses (handled at the top of
onKeyDown, which return first), the transient modals (closed by main.js's import-time listener), and tempo-map's own suggest-dismiss / barline-clear branches (guarded out via!S.tempoMapMode). Non-destructive — selection isn't undo state, so it touches no history and no-ops when nothing is selected.Changed — Sustain keys in the default FeedBack profile
[and]now shorten/lengthen the selected note's sustain by one grid step in the FeedBack profile. The commands (shortenSustain/lengthenSustain) already existed but were bound only in the Legacy (EOF) profile (feedback:''), so default-profile users had no keyboard sustain edit at all. Matches the EOF bracket convention; in tempo-map mode the brackets stay the beat-count controls (that block resolves first, so no shadowing).Tests
tests/phrase_undo.test.mjs— round-tripsAddPhraseCmdthrough the realEditHistory(exec → rollback deep-equality → redo), incl. the interleaved case proving each add is its own LIFO step (the exact trap), equal-start_timerefs, and redo-stack drop. Slices@pure:phrase-cmds, so it fails on main (the class doesn't exist there).tests/eof_shortcuts.test.mjs— added a FeedBack-profile assertion that[/]resolve to shorten/lengthen sustain and display in the registry rows; fails on main (no FeedBack binding there).npm run lint0 errors (3 pre-existing baseline warnings in untouched files).routes.pyuntouched, so no pytest.🤖 Generated with Claude Code
Summary by CodeRabbit