#9121 - The Attributes panel should be disabled for a non-continuous selection of the Nucleotide (preset) type#10081
Open
mariam-khutuashvili wants to merge 2 commits into
Conversation
Contributor
|
Reviewed via subagents (code-quality, performance, documentation, security). Security: no concerns — pure UI flag, no new sinks. The two notable items are inline:
Nice reuse of the existing |
03d3267 to
899e819
Compare
…eotide (preset) type
899e819 to
e3dd4fc
Compare
AlexeyGirin
requested changes
May 25, 2026
…n per reviewer feedback
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
When the user picks "Nucleotide (preset)" in the Monomer Creation Wizard and makes a non-continuous selection on
canvas, the "Mark as base/sugar/phosphate" buttons, the Code input on the preset tab, and the form fields in
MonomerCreationWizardFields are now disabled. A continuous selection keeps them enabled.
Changes
RnaPresetTabs.tsx — Compute isSelectionContinuous by passing the selected atoms plus the bonds derived from them
(bonds whose both endpoints are in the selection) to Editor.isStructureContinuous. Derive isFieldsDisabled =
hasSelectedAtoms && !isSelectionContinuous. Apply it to the "Mark as" button, the Code input, and pass it as a new
prop to MonomerCreationWizardFields.
MonomerCreationWizardFields.tsx — Add optional disabled?: boolean prop and combine it with the existing !type checks
on the four input fields (disabled={!type || disabled}).
Why derive bonds from atoms
Editor.isStructureContinuous builds its adjacency list from the selection's bonds. Canvas selections often track only
atoms (no bonds), which would make chemically connected atoms look isolated and falsely trigger the disabled state.
Deriving bonds from the struct based on the atom selection gives the correct adjacency for the connectivity check.
Scope
Only affects the Nucleotide (preset) component. Other monomer types (Amino Acid, Sugar, Base, Phosphate, CHEM as
single monomers) are unchanged. The existing submit-time "incontinuousStructure" notification still fires.
Verification
npm run test, npm run test:types, npm run build:packages, full Playwright autotests — all pass. Manual repro confirms
buttons + fields disable on non-continuous selection and re-enable on continuous selection.
Check list
#1234 – issue name