#4009 - Macro: After clicking Cancel, RNA Builder becomes inactive#10397
Open
aslmbk wants to merge 1 commit into
Open
#4009 - Macro: After clicking Cancel, RNA Builder becomes inactive#10397aslmbk wants to merge 1 commit into
aslmbk wants to merge 1 commit into
Conversation
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 #4009
Problem
In Macromolecules mode → RNA tab, when building a new preset (adding Sugar/Base)
and pressing Cancel, the RNA Builder ended up inactive: it stayed expanded but
dropped out of edit mode, both action buttons were disabled, and clicking monomers
in the library no longer filled the slots. The user could not start building again
without re-opening the builder.
Root cause
While building a new preset, the in-progress monomers live in component-local state;
the Redux
activePresetstays the empty object fromcreateNewPreset. On Cancel,onCancelcalledresetRnaBuilder, which setsisEditMode = false. For a new/emptypreset this left the editor expanded but non-editable (
handleItemSelectionearly-returnswhen not in edit mode), producing the dead state.
Fix
When Cancel is pressed on a new/never-saved preset (
isActivePresetEmpty), reset thebuilder to a pristine "new preset" state that stays open and editable — reusing the
same actions as the "New Preset" flow (
createNewPreset+setActiveRnaBuilderItem(Presets)setIsEditMode(true)), plus a validations recalculation. Cancelling an edit of anexisting preset keeps the previous behaviour (revert changes → view mode).
Changes
resetRnaBuilderToNewPresethelper inresetRnaBuilder.ts.onCancelinRnaEditorExpanded.tsxon the new/empty-preset case.RnaEditorExpandedunit test store state.#4009: RNA Builder stays active after Cancel).Testing
ketcher-macromoleculesunit tests: 8 suites / 36 tests / 4 snapshots — passing.tsc --noEmit— clean.existing-preset Edit → Cancel still reverts to view mode.
Screenshots
Screen.Recording.2026-07-06.at.13.51.26.mov
Check list
#1234 – issue name