Repository navigation
Show a caller-owned component in a composition with movableComponentOf - #49
Merged
Ivan Matkov (MatkovIvan) merged 1 commit intoNov 23, 2026
Merged
Conversation
Ivan Matkov (MatkovIvan)
force-pushed
the
ivan.matkov/movable-component-of
branch
from
November 23, 2026 18:09
e7a551b to
1b2720c
Compare
…ovableComponentOf Code that builds a component in a plain Swing tree and lends it to composed UI had no correct path. ExistingSwingNode never places the component, and a SwingNode factory that returns an existing component is replaced, not moved, when a key or branch changes, so the component ends in the wrong parent. movableComponentOf(component) returns a MovableComponent whose call places the component with a modifier. One component has one MovableComponent, so a key change, an if/else or a nested content composition relocates the same node. When the placement ends, the modifier's writes are given back and the component leaves the container the placement put it in; the caller puts it back where it keeps it. Two calls composed at once in one Recomposer are refused before anything is written. Across Recomposers the newer call takes the component over, and the superseded call stays empty until it is inserted again. CreatedNodeHolder and the new caller holder share placement through PlacingNodeHolder. No dedicated unwind runs when apply fails: a claim that survives the failure is cleared when the component is next placed from another Recomposer, as for the rest of a dead composition.
Ivan Matkov (MatkovIvan)
force-pushed
the
ivan.matkov/movable-component-of
branch
from
November 23, 2026 18:22
1b2720c to
7e207fe
Compare
Ivan Matkov (MatkovIvan)
deleted the
ivan.matkov/movable-component-of
branch
November 23, 2026 18:33
This branch was successfully deployed
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.
movableComponentOf(component)returns aMovableComponentthat places a component the caller built and keeps. Call it with aSwingModifierwhere the component should stand.key, anif/elsebetween containers or a move into a nested content composition relocates the component instead of replacing it.PlacingNodeHolderis the new shared base ofCreatedNodeHolder.SwingNodeandExistingSwingNodepoint to it in their KDoc, and theSwingNodeFactoryReusesComponentmessage names it.RecomposerthrowIllegalStateException. Under independent roots, such as two windows, the call composed last takes the component over.