Repository navigation
feat: add highlight action-request that forwards ids to NMRium's highlightedIds - #317
Merged
Merged
Conversation
vcnainala
force-pushed
the
feat/highlight-peak-controllable
branch
2 times, most recently
from
October 4, 2026 09:58
a076b40 to
e6c826d
Compare
3 of 5 tasks
4 tasks
vcnainala
marked this pull request as ready for review
October 7, 2026 11:37
Collaborator
|
I’ve taken a look at the code, and I’m not convinced that saving the last NMRium state in the wrapper is the right approach. All the logic for finding peak IDs or range IDs should be handled entirely on your side and should not be part of the RW. The wrapper’s only responsibility should be to take the IDs and pass them down to NMRium, nothing more. |
… API Add highlightPeak, highlightSignal and clearHighlight action requests on top of NMRium's public highlight / onHighlightChange props instead of aliasing its private highlight module. highlightSignal resolves a 1D signal by id or nucleus + delta and also highlights its parent range and the peaks inside that range. Host-driven highlights use an UNKNOWN source so NMRium's Delete/Backspace handler cannot delete the highlighted peak or signal.
Switch from the controlled highlight / onHighlightChange API (#4402) to the additive highlightedIds prop from cheminfo/nmrium#4405. Host highlights no longer touch NMRium's internal highlight state, so the sourceData workaround and the permanent option are gone. Drop the embedding settings from the QM demo fixture: they hide NMRium's panels, which the demo and e2e tests rely on.
Per review, the wrapper no longer stores NMRium's state or resolves
peaks, ranges or signals. Hosts look up the ids in their own data and
send them; the wrapper forwards them to NMRium's highlightedIds prop.
Replace highlightPeak and highlightSignal with a single
highlight { ids: string[] } action and drop the automatic tab switch;
hosts send selectTab first. Invalid ids emit nmr-wrapper:error.
vcnainala
force-pushed
the
feat/highlight-peak-controllable
branch
from
October 9, 2026 12:10
8020998 to
2997bcb
Compare
Firefox opens the QM fixture on the 13C tab and Chromium on 1H, so the 1H highlight tests found nothing to highlight in Firefox. Select 1H first, and start the selectTab test on 1H so it switches tabs in every browser.
hamed-musallam
approved these changes
Oct 9, 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.
Summary
nmr-wrapper:action-requestchannel using NMRium'shighlightedIdsprop (feat: support externally controlled highlights cheminfo/nmrium#4405, released in NMRium 3.1).highlightwithparams: { ids: string[] }: passes the ids tohighlightedIdsand replaces the previous host highlight.clearHighlight: clears the host highlight.selectTaband thenhighlight.highlightedIdsis additive: NMRium's own hover/click highlighting keeps working, and Delete/Backspace cannot remove a host-highlighted peak or range.params.idsand unknown action types emitnmr-wrapper:errorinstead of throwing.Example:
Rebased on
development(NMRium 3.1, React 19).Test plan
npm run check-types, eslint, prettiernpx playwright test --project chromium: all 11 pass, including highlight a peak by id, highlight a signal with its range and peak,selectTabfollowed byhighlighton another nucleus, and invalid ids emittingnmr-wrapper:error