Skip to content

feat(editor): add tempo map sync point actions - #74

Merged
byrongamatos merged 1 commit into
mainfrom
feat/editor-tempo-sync-actions
Jul 5, 2026
Merged

feat(editor): add tempo map sync point actions#74
byrongamatos merged 1 commit into
mainfrom
feat/editor-tempo-sync-actions

Conversation

@ChrisBeWithYou

@ChrisBeWithYou ChrisBeWithYou commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add visible Insert and Delete actions to the Tempo Map sync-point inspector
  • keep Delete disabled unless an interior sync point is selected
  • extend inspector helper coverage for action enablement

Validation

  • node --check screen.js
  • node tests\tempo_sync_inspector.test.js
  • node tests\tempo_map_guidance.test.js
  • node tests\tempo_map_bpm.test.js
  • node tests\tempo_map_timesig.test.js
  • node tests\measure_readout.test.js
  • git diff --cached --check
  • staged public-term guardrail scan

Summary by CodeRabbit

  • New Features

    • Tempo Map sync point inspector now shows Insert and Delete buttons for managing sync points directly from the panel.
    • Button availability and tooltip text now update based on the current selection, including preventing deletion of the first and last sync points.
  • Bug Fixes

    • Improved inspector state handling so the controls stay correctly enabled or disabled when selection changes.

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 082596a0-d8b4-4cf8-8317-41c8a157b76e

📥 Commits

Reviewing files that changed from the base of the PR and between 32bd239 and adc8c77.

📒 Files selected for processing (2)
  • screen.js
  • tests/tempo_sync_inspector.test.js

📝 Walkthrough

Walkthrough

The tempo sync inspector now computes insert/delete permission state, adds Insert/Delete controls, and updates refresh behavior to apply those controls. Tests now cover the new state fields for no selection, interior sync points, and edge sync points.

Changes

Tempo Sync Inspector Controls

Layer / File(s) Summary
State computation for insert/delete permissions
screen.js
_tempoSyncInspectorStatePure now returns canInsert, canDelete, and deleteTitle for both the no-selection and selected-measure cases, disabling delete for first/last sync points.
Insert/Delete button wiring and refresh logic
screen.js
_ensureTempoSyncInspector adds Insert and Delete buttons with click handlers; _refreshTempoSyncInspector includes the new state fields in memoization and updates button disabled/title attributes.
Test assertions for new state fields
tests/tempo_sync_inspector.test.js
Tests verify canInsert, canDelete, and deleteTitle for no-selection, selected non-final, and selected final measure scenarios.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant InsertDeleteButtons
  participant refreshTempoSyncInspector
  participant tempoSyncInspectorStatePure

  refreshTempoSyncInspector->>tempoSyncInspectorStatePure: compute state (canInsert, canDelete, deleteTitle)
  tempoSyncInspectorStatePure-->>refreshTempoSyncInspector: return state
  refreshTempoSyncInspector->>InsertDeleteButtons: set disabled/title
  User->>InsertDeleteButtons: click Insert or Delete
  InsertDeleteButtons->>refreshTempoSyncInspector: invoke insert/delete handler
Loading

Related Issues: None referenced.

Related PRs: None referenced.

Suggested labels: enhancement, ui

Suggested reviewers: None specified.

Poem:
A rabbit taps a tiny key,
Insert, Delete—now both are free,
First and last are locked up tight,
Titles whisper what is right,
Hop along, the inspector's set just right. 🐇

✨ 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-tempo-sync-actions

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ast-grep (0.44.1)
screen.js

ast-grep timed out on this file


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

@byrongamatos
byrongamatos force-pushed the feat/editor-tempo-sync-inspector branch from 21bed52 to b9eb1d8 Compare July 5, 2026 20:18
@byrongamatos
byrongamatos force-pushed the feat/editor-tempo-sync-actions branch from d71ce10 to adc8c77 Compare July 5, 2026 20:19
@byrongamatos
byrongamatos changed the base branch from feat/editor-tempo-sync-inspector to main July 5, 2026 20:19
@byrongamatos
byrongamatos marked this pull request as ready for review July 5, 2026 20:19
Copilot AI review requested due to automatic review settings July 5, 2026 20:19
@byrongamatos
byrongamatos merged commit 5d60b11 into main Jul 5, 2026
1 check was pending

Copilot AI 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.

Pull request overview

Adds explicit Insert and Delete actions to the Tempo Map sync-point inspector UI, with state-driven enablement (Delete only enabled for interior sync points) and expanded helper test coverage to validate the new action state.

Changes:

  • Extend _tempoSyncInspectorStatePure() to compute canInsert, canDelete, and deleteTitle.
  • Add Insert/Delete buttons to the inspector UI and wire them to _tempoInsertSyncPoint() / _tempoDeleteSyncPoint().
  • Update tests/tempo_sync_inspector.test.js to assert the new action enablement/title behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
screen.js Adds inspector action buttons and extends the pure inspector-state helper to drive enablement/tooltips.
tests/tempo_sync_inspector.test.js Adds assertions covering insert/delete enablement and delete tooltip/title logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread screen.js
Comment on lines 11709 to 11711
const state = _tempoSyncInspectorStatePure(visible ? _tempoMeasures() : [], visible ? S.tempoSel : -1);
const sig = `${visible}|${S.tempoSel}|${state.label}|${state.bpmValue}|${state.bpmDisabled}|${state.numeratorValue}|${state.denominatorValue}|${state.signatureDisabled}|${state.hint}`;
const sig = `${visible}|${S.tempoSel}|${state.label}|${state.bpmValue}|${state.bpmDisabled}|${state.numeratorValue}|${state.denominatorValue}|${state.signatureDisabled}|${state.canInsert}|${state.canDelete}|${state.hint}`;
_tempoSyncInspectorState = sig;
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.

3 participants