Repository navigation
feat(sync): per-section sync results UI (#26) - #71
Merged
Merged
Conversation
Add a Tempo/Grid menu item that opens a review list of the #24 per-section analysis: one row per section with a confidence badge, the scale factor/shift it would bake, and an Apply/Skip toggle. Low-confidence sections default to skip and are never applied unless explicitly selected; failed sections are not selectable. Apply all high-confidence re-selects just the trusted sections, and Apply bakes the accepted map through the same applyPerSectionSync path as #25, so preview and commit are one map. A single-section song collapses to the uniform model. The pure decision layer (_sectionSyncPlanPure, _proposalAcceptedPure selected override, SECTION_SYNC_CONFIDENCE_FLOOR) lives in section-sync.js; section-sync-ui.js only gathers onsets, renders and hands the plan over.
Self-review fixes for #26: - Restore focus inside the modal after a toggle re-renders the rows container (previously focus fell to <body>, so Escape/Tab and global shortcuts leaked through the overlay), and fall back to the primary control / modal root when the disabled Apply button refuses focus. - Track the decision INTENT (`wanted`) separately from the conflict-demoted acceptance so a both-ends-pinned section is not toggle-stuck; show it as `conflict` and let the user skip it to clear. - Count only genuinely-skipped low-confidence sections in the summary (a forced-on section no longer reads as skipped). - Disable 'Apply all high-confidence' when a conflict blocks Apply. - Preserve the rows scroll position across re-renders; add dialog ARIA. - Add a DOM-driven suite pinning the focus/summary/apply/Escape behaviour.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (8 files)
Previous Review Summary (commit 8423af3)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 8423af3)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (8 files)
Reviewed by efficient · Input: 32.2K · Output: 7.9K · Cached: 223.9K |
cchacs
approved these changes
Oct 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #26 (sub-issue 5/5 of per-section sync #8; builds on #24/#25).
What
Adds the review surface for the per-section alignment engine: a Per-section sync (review sections)… item in the Tempo/Grid menu opens a list with one row per section.
highgreen /lowamber /failedred), the scale factor and time shift it would bake, and an Apply/Skip toggle.failedsections (no usable fit) are not selectable at all.applyPerSectionSyncpath as Per-section sync 4/5: bake the piecewise warp into note timestamps (offline, with round-trip) #25, so the preview and the committed edit are the same map. A conflict (a run pinned to identity at both ends) blocks Apply with a status message instead of silently demoting._installModalKeyboardtrap (Escape closes, Tab wraps, focus restored to the opener); focus is kept inside the modal across the per-toggle re-render so global shortcuts can't leak through the overlay.Design
src/section-sync.js:SECTION_SYNC_CONFIDENCE_FLOOR = 0.7,_sectionSyncPlanPure(analysis, decisions, options), and an explicitselectedoverride in_proposalAcceptedPure(false= hard skip,true= force a low-confidence-but-usable section; affine validity is never overridable). Rows expose both the decision intent (wanted) and the conflict-demoted result (accepted) so a pinned run is not toggle-stuck. The map builder now tags intervals with their sectionindex.src/section-sync-ui.jsonly gathers onsets, renders, and hands the plan to the apply path.main.jswires thewindow.editor*entry points;screen.htmladds the modal;CHANGELOG.mdgets an[Unreleased]entry.Tests
tests/section_sync_ui.test.mjs(new): default skips low confidence, explicit overrides both ways, failed sections unselectable, single-section collapse, conflict surfacing, and an integration pass proving the plan drivesapplyPerSectionSync(skipped notes untouched, selected notes baked).tests/section_sync_ui_dom.test.mjs(new): drives the real module against a DOM stub — Apply disabled + focus inside the modal on an all-skipped plan, focus restored after a toggle re-render, summary skips-count, apply bakes and closes, Escape restores the opener.big-pickle(free) | 𝕏