Fix OMR search navigation and zoom framing - #994
Conversation
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (7)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Two OMR search bugs were fixed: - Clicking a result now navigates. ResultView used Marionette 2's childEvents, which backbone.marionette 4 ignores, so showResult never reached focusRegion. Switch to childViewEvents and pass the model explicitly (v4 no longer prepends the child view to the handler args). - The jump to a result no longer over- or under-zooms. zoomToRegion's padding is a fraction of the region, so one value can't frame both small and large boxes; scale it to the box size, framing each result to a minimum share of the page so results of any size zoom alike. The same Marionette-4 gap silently broke two sibling wirings, fixed here too: - NeumeGalleryView: clicking a neume exemplar adds it to the search again (replace the onChildviewExemplarClicked method with an explicit childViewEvents entry). - ChantCompositeView: the chant fold/unfold state syncs again (childEvents -> childViewEvents; ChantItemView passes itself so the handlers keep their child.model access). Rebuild the JS bundle. Closes #978.
6f82161 to
17d59dd
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
nginx/app/src/js/search/omr-search/ResultView.js (1)
29-30: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd regression coverage for the model payload.
Extend
nginx/app/src/js/search/omr-search/ResultView.spec.jsto click a child.result-targetand assert thatzoomToResultreceives the exact result model. Include a model with a populatedboxes[0]entry so the OMR focus path is covered.Also applies to: 50-51
🤖 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 `@nginx/app/src/js/search/omr-search/ResultView.js` around lines 29 - 30, Add regression coverage in ResultView.spec.js for the childViewEvents showResult-to-triggerZoomToResult flow: render a model with a populated boxes[0] entry, click the child .result-target, and assert that zoomToResult is called with the exact result model.
🤖 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.
Nitpick comments:
In `@nginx/app/src/js/search/omr-search/ResultView.js`:
- Around line 29-30: Add regression coverage in ResultView.spec.js for the
childViewEvents showResult-to-triggerZoomToResult flow: render a model with a
populated boxes[0] entry, click the child .result-target, and assert that
zoomToResult is called with the exact result model.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 0927bc6b-083b-4a19-91b2-e5756884aaa4
⛔ Files ignored due to path filters (1)
nginx/static/js/app/cantus-min.js.mapis excluded by!**/*.map
📒 Files selected for processing (7)
nginx/app/src/js/manuscript-detail/DivaBackend.jsnginx/app/src/js/manuscript-detail/folio/ChantCompositeView.jsnginx/app/src/js/manuscript-detail/folio/ChantItemView.jsnginx/app/src/js/search/omr-search/NeumeGalleryView.jsnginx/app/src/js/search/omr-search/ResultItemView.jsnginx/app/src/js/search/omr-search/ResultView.jsnginx/static/js/app/cantus-min.js
Closes #978.
Summary by CodeRabbit