Repository navigation
ComponentGroup: make the segmented control work on the current native themes - #5791
Conversation
β¦ themes A horizontal ComponentGroup is a segmented control, and it is the only use of ComponentGroup the current native themes carry any styling for. Both style ToggleButton and its First/Last/Only variants in full, across all four states, and neither defines a single GroupElement or ButtonGroup rule. Neither sets ComponentGroupBool either, so updateUIIDs returned early and setHorizontal(true) renamed nothing: the styling was unreachable through the API that exists to reach it, and a segmented group painted as plain buttons on every new app. Turning the flag on in those themes is not the fix. It also governs the vertical path, which flattens Labels, TextFields and Buttons onto one GroupElement UIID that neither theme styles, so it would trade an inert segmented control for badly styled vertical groups. The flag stays, and still governs that path. What changes is that a group which is horizontal and still using the ToggleButton UIIDs setHorizontal installs is active on its own. The activation is deliberately narrow -- it recognises the framework's own ToggleButton UIIDs, not "horizontal" on its own -- so an application that chose its own element UIID keeps the documented theme-gated behaviour. Renaming to ToggleButton without consulting the theme is what Button.setToggle already does, ungated, so an app with toggle buttons already depends on that UIID. Two bugs found alongside it: setForceGroup only assigned the field. It took effect if and only if something else later called updateUIIDs -- adding a component, or a theme refresh -- so on an already-populated group it did nothing, and clearing it never restored anything. It now applies the change it records. Leaving the horizontal state could deactivate a group, and updateUIIDs only renames; it has no path back. Members kept ToggleButton names a vertical group no longer justified. The three copies of that restore loop are now one method. The comment in the iOS theme claimed that theme sets ComponentGroupBool, which is true of the legacy iOS themes and not of it. The guide said the same thing. Both corrected. RadioButtonTest.testRestoreWorksAfterGroupingIsSwitchedOff used a horizontal group to reach the restore path. A horizontal group no longer deactivates, so it now uses a vertical one; what it tests -- the ownership marker outliving the restore -- is unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
βΉοΈ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with π while any review is running, comments if it has suggestions, and reacts with π once all reviews finish with no findings. |
There was a problem hiding this comment.
π‘ Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dc13b3584b
βΉοΈ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with π.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Developer Guide build artifacts are available for download from this workflow run:
Developer Guide quality checks: |
β¦ot just one
Review found that setElementUIID strands its members: a populated horizontal
group is active, naming a custom element UIID makes it inactive, and the
updateUIIDs call at the end of the setter returns early and renames nothing, so
the members keep the ToggleButton names from the state the group just left.
It was right, and it is the same shape as the setHorizontal bug already in this
branch, so this enumerates the rest of the family instead of patching the one
that was reported. Every mutator that can change the answer to isGroupingActive
now goes through one applyOrRestore, because updateUIIDs only ever renames and
has no path back.
Two more turned up in the sweep, both older than this branch:
setGroupFlag assigned the field and did nothing else, so pointing a group at a
constant the theme does set never activated it, and pointing it away never
restored.
setPropertyValue("groupFlag", value) called setGroupFlag(groupFlag) -- the field,
not the argument -- so the property assigned the flag to itself and a designer
edit was discarded. Its forceGroup neighbour assigned the field directly and
skipped the setter's apply.
Five tests, each probed against the code before this commit, where all five fail.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
β Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
There was a problem hiding this comment.
π‘ Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aec50d12e8
βΉοΈ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with π.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Cloudflare Preview
|
Native fidelity (Android, Material 3)54 pairs compared -- median 95.6%, worst 91.3% ( Distribution --
Geometry vs native (bbox offset / size ratio / center offset / corner radius) -- gated separately from the visual score
Side-by-side comparisons (worst first)
|
setHorizontal only called updateUIIDs inside its "GroupElement" branch, so a group that already carried the ToggleButton UIID -- set explicitly, rather than swapped in by this method -- became segmented on the orientation change and applied nothing. isGroupingActive then reported that the group owned its members' UIIDs while they still wore their own, which is also what Button.groupOwnsUIID reads, until an unrelated insertion or theme refresh happened to put it right. Orientation alone decides activation for such a group, so the apply is now unconditional rather than confined to the branch that renames the UIID. Found in review, and the last of the flip points in this family. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
π‘ Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 875f7159b9
βΉοΈ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with π.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
β¦e group A grouped ComboBox is forced into spinner mode. removeComponentImpl restored the UIID and nothing else, so a combo that left the group went on opening as a spinner for the rest of its life. That is older than this branch, but the self-activating segmented group is what makes it reachable with no theme constant set, which is why it is fixed here. The restore was also lossy in the other direction: it assigned the group's own uiidsDirty flag rather than the value the application had chosen, so restoring a combo that was deliberately set to spinner mode turned it into a popup. The prior mode is now recorded on the way in, the way $origUIID already is, and put back on the way out. Two tests. The removal one fails against the code before this commit. The second does not -- the old path happened to leave the flag true for the reason that is the bug -- so it is there to pin that the restore returns the application's choice rather than a hardcoded false, which is what a naive fix would have done. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
π‘ Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d0173ba65f
βΉοΈ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with π.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
All three from review, all three against the restore added in the previous commit, and each has a test that fails without its fix. A missing snapshot is not the same as "it was false". An inactive group never records one, so restoring unconditionally took spinner mode away from an application that had asked for it, merely because the combo passed through an inert ComponentGroup. Absent snapshot now means this group took nothing and has nothing to give back. The snapshot is scoped to one membership. Left in place after a restore, a second grouping kept the value the first had captured, so a combo the application changed in between came back wrong. It is cleared on the way out. Removal during an animation restored nothing. Container.removeComponentImpl queues the physical removal while the AnimationManager is animating and leaves the child in the component list, so the restore ran and updateUIIDs put the grouped UIID and spinner mode straight back -- and the queued callback goes to removeComponentImplNoAnimationSafety, which never reaches this class, so nothing undid it. Re-grouping the remaining members now happens before the departing one is restored, so the restore is last and stands. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
π‘ Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 508f2a3941
βΉοΈ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with π.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Compared 151 screenshots: 151 matched. Native Android coverage
β Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
Removal is hooked in two places now, because the two things that have to happen are true at different moments. removeComponentImpl restores the departing member. An animated removal only queues the physical removal, so that member can sit in the component list for the length of the animation, and waiting until completion leaves it wearing the group's UIID throughout -- or for good, if the animation never completes. removeComponentImplNoAnimationSafety re-groups the survivors, because that is where the member is genuinely out of the list. Recomputing positions in removeComponentImpl still counts a queued member, which left the survivor of a two-element group reading ToggleButtonLast instead of ToggleButtonOnly, and the queued callback goes straight to Container so nothing came back to correct it. It is package-private and this class is in the same package, so this is the supported hook rather than a workaround. Every route out arrives there, which incidentally fixes replace(): it bypasses removeComponentImpl entirely, so a replaced member used to keep the group's UIID permanently. Its other half is left alone -- replace() inserts through insertComponentAtImpl, which this class does not override, so the incoming component is not grouped and never has been. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
π‘ Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7e14363957
βΉοΈ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with π.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Review found the insert-side twin of the removal seam fixed in the last commit, twice: an addComponent during an animation, and replace(). Rather than patch each, this moves the insert hook to the point that has the same property the removal hook does. insertComponentAtImpl is where a member genuinely enters the component list, and every route arrives there -- the immediate insertion, the one the AnimationManager queues, and replace(). insertComponentAt only queues while animating, so positions recomputed there do not count the arriving member, and the queued callback goes straight to Container and never comes back here. Both are package-private and this class is in the same package, so both hooks are supported rather than worked around. That also settles replace() properly. The previous commit noted that its incoming member was never grouped because it does not call insertComponentAt; it does call insertComponentAtImpl, so hooking there groups it, and the note and the test comment that recorded the gap are gone. The class now has one rule on each side: group when a member is in, restore when it is out, both at the moment it is actually true. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
π‘ Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c4a6703887
βΉοΈ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with π.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
updateUIID only snapshots when nothing is recorded, and nothing cleared the record, so a component that was grouped, given a new UIID, and grouped again was restored to the name it wore two memberships ago. Dormant on themes without ComponentGroupBool; a self-activating horizontal group reaches it by default. Cleared on departure, which is the same scoping the spinner snapshot already got. Deliberately not on deactivation: a group that merely goes inactive still holds the member, and Button reads this marker while working out what leaving toggle mode should restore, so clearing it there would change behaviour that has its own tests. Those tests -- RadioButtonTest, ButtonTest, CheckBoxTest, ButtonGroupTest and the lead-component sample -- were run against this and pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
π‘ Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c1080827fe
βΉοΈ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with π.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
β¦Horizontal gives The guide said a horizontal ComponentGroup needs no theme constant, flatly. isSegmented is narrower than that on purpose: it self-activates only while elementUIID is exactly ToggleButton, so a group given its own element UIID before being turned horizontal is theme-gated like a vertical one. There is a test in this branch asserting precisely that, so the guide was promising behaviour the implementation deliberately withholds. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
π‘ Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6aad07dd41
βΉοΈ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with π.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
β¦hot too Two more of the same family, both found in review. Reordering decides which member is First and which is Last, so it belongs with insertion and removal rather than outside them. Container.drop reorders through setComponentIndex and starts a layout animation, reaching neither of the other hooks, so a dragged segment kept the UIID of the position it came from -- reachable by default now that a horizontal group needs no theme constant. setComponentIndex is package-private and this class is in the same package, so it is the third supported hook and not a workaround. Deactivating now drops $origUIID as departing already did. The previous commit scoped the clear to departure out of caution about Button, which reads the marker while working out what leaving toggle mode restores. The caution was misplaced: Button's restore runs off its own preToggleUIID field, and the branches that touch $origUIID exist to keep a live group's snapshot in step, so they are correctly inert once the group has handed the UIID back. Run against RadioButtonTest, ButtonTest, CheckBoxTest, ButtonGroupTest and the lead-component sample, all passing. Both comments that documented the old "set once, never cleared" lifetime -- the one here and the one in Button -- say what is now true instead. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
π‘ Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d82cd01c00
βΉοΈ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with π.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
β¦ here Review asked grouping to preserve both aliases of a member configured through setUIID(portrait, landscape). The defect it describes is real: getUIID resolves to whichever alias matches the current orientation, the one-argument setUIID writes the portrait slot, so in landscape the group's name never takes effect and a restore can put a landscape alias into the portrait slot. It is not fixable from this class. Component.landscapeUiid is private and has no accessor, so there is nothing here to read or to put back, and the only way to do it properly is to give Component a way to read and swap both aliases together. That is a change to core styling, with its own reach beyond this container, and it does not belong on a segmented-control fix. Nothing about it is new either: updateUIID has always used the one-argument setUIID, so every group that has ever been active -- the legacy iOS themes, any forced group -- has behaved this way. What this branch changes is how easy it is to reach, which is worth a note in the code rather than a workaround in it. Recorded at the call site, since the review thread is not what a future reader of this method will have. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
π‘ Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b74c4af469
βΉοΈ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with π.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The class-level contract still told callers a component group does nothing without ComponentGroupBool. That is what the code did before this branch and is now wrong for a horizontal one, so the generated API documentation contradicted both the implementation and the developer guide -- and a caller reading it would not expect their children to be restyled. Stated with the same boundary the code and the guide use: the exception covers a horizontal group still wearing the ToggleButton UIIDs setHorizontal installs, and naming your own element UIID puts it back under the constant. The internal note on isGroupingActive had the same stale list of activation conditions and is updated with it. Third time a claim has been corrected in one place and left standing in another on this branch, so this one was swept by grepping the class for the claim rather than fixing the line that was reported. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
π‘ Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f0356fcc60
βΉοΈ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with π.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
isSegmented derives activation from the layout, and Container.setLayout is public, so a caller could flip a populated group between segmented and not without anything putting the member UIIDs right: dropping a Y axis layout on a horizontal group left every child wearing ToggleButton, and an X axis one on a group already carrying that UIID never applied it. Reconciling in setLayout covers that route and the setHorizontal route with one rule, so setHorizontal no longer reconciles for itself. Its two halves are reordered for that: the UIID swap now happens before the layout change, because setLayout is what reconciles and it has to see the names the group means to use. The other order would have run it once against a half-changed group. That is the fifth hook in this family, and they all say the same thing -- insertion, removal, reordering, and now orientation each reconcile at the point the thing positional UIIDs depend on actually changes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Compared 181 screenshots: 181 matched. |
Native fidelity (iOS Modern, Metal)68 pairs compared -- median 95.0%, worst 83.5% ( Distribution --
Geometry vs native (bbox offset / size ratio / center offset / corner radius) -- gated separately from the visual score
Side-by-side comparisons (worst first)
|
|
Compared 148 screenshots: 148 matched. Benchmark Results
Detailed Performance Metrics
|
|
Compared 160 screenshots: 160 matched. Benchmark Results
Detailed Performance Metrics
|
|
Compared 149 screenshots: 149 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
|
Compared 144 screenshots: 144 matched. |
|
Compared 143 screenshots: 143 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
|
Compared 217 screenshots: 217 matched. |
Not this branch's render. #5791 (ComponentGroup / segmented control) changed the layout by about 4px below the Birthdate picker, and landed at 21:58 on 2026-09-12 while master last ran the Windows and Linux screenshot gates at 07:01 that morning -- those gates skip most pushes to master, so nothing compared the new render until the next PR did. This branch is JavaScript-target only (the JS suspension analysis, the JS emitter, parparvm_runtime.js and the JS port's own files), so it cannot reach the Windows or Linux native renderers at all. The three goldens come from this PR's own CI artifacts: the windows x64, arm64 and cross-build runs produce a byte-identical PNG and share one golden, and both linux arches produce another, so no arch is left mismatching. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* JS port: let a static initializer make a host call (issue #5774) A <clinit> that reached the host answered `undefined` and said nothing. `ensureClassInitialized` drives a generator clinit with a synchronous run-to-completion loop that steps it with `result.next()` and discards whatever it yields. For a HOST_CALL that means the message is never posted to the main thread and the `yield` it came from resumes with `undefined`. The JSO bridge turns that into a Java null with no error anywhere -- `isDegradedObjectResult` does not treat a null getter result as degraded -- so the app dies later, somewhere else, with nothing connecting it back. In #5774 an app's `SystemFont` clinit read a preference. `Window.current()` was answered `undefined`, fell through to wrapping the WORKER GLOBAL as the window and cached that for the life of the worker, so `getLocalforage()` read `self.localforage` (undefined) and `LocalForage.<init>` NPE'd on `impl.config(opts)` -- a bare NPE naming a constructor the developer never called. Four changes: * `jvm.ensureClassInitializedSuspending` drives the clinit with `yield*`, so its ops reach `handleYield` on the real trampoline and resume with the host's answer. `_Ig` routes there, with a shared stateless no-op iterator for the already-initialized case so the common path allocates nothing. * The emitter uses `yield* _Ig("X")` instead of `_I("X")` at a guard whose clinit chain suspends, and `JavascriptSuspensionAnalysis` records the same guard (GETSTATIC / PUTSTATIC / INVOKESTATIC / NEW) as a call edge into that clinit so the method holding it is a generator. The two sides must agree: a `yield*` in a plain `function` is a SyntaxError, not a subtle bug. * The synchronous driver now FAILS on an op it cannot service, naming the class and the op, instead of stepping past it and answering `undefined`. That is the whole point -- the residual gap (a suspending clinit reached from a method the analysis proved synchronous) is narrow and now loud. * `Window.current()` no longer caches the worker-global fallback, so one failed round trip cannot pin a DOM-less window for the whole session, and `LocalForage.<init>` says which of the two things went wrong instead of NPE'ing. Regression test: `JsClinitHostCallApp`, whose <clinit> asks the host to echo 41 through the same worker protocol the port uses. Before the fix the host call is never sent; the test asserts 42 comes back. `-Dparparvm.js.clinitedge.off=1` disables the analysis edges on both sides, for A/B measuring the generator-count cost and for bisecting. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * JS port: resolve the static-field owner before deciding what a clinit guard names Review found that the new clinit edges read the owner straight off the instruction. A Fieldref names any accessible SUBTYPE rather than the declaring class -- javac writes `getstatic Impl.VALUE` for a field the interface `Impl` implements declares, confirmed with javap (`Fieldref Q$Impl.VALUE`) -- and the emitter has always resolved that, because `_S` and the clinit are both keyed on the declaring class. Reading it raw made the own-class/ancestor elision fire on an access the emitter guards against the INTERFACE, so the edge was dropped for a clinit that does suspend and the method stayed synchronous. `classInitGuardOwner` is now the one implementation of "what class does this instruction's guard name", living next to the emitter that places the guards, parameterized by the class lookup because `classIndex` is only populated at emit time and the analysis runs before it. The INVOKESTATIC owner goes through `resolveDirectInvokeOwner` for the same reason. Writing the test for that shape turned up an older bug in the same family, and without it the shape cannot work at all. `JavascriptReachability` seeded the clinit from the raw owner too, and `markClassInstantiated` walks the SUPERCLASS chain only -- so the declaring interface's `<clinit>` was seeded by nothing, culled, and the field read back as its default with no error anywhere. JLS 12.4.1 initializes the declaring interface. Both owners are marked now; the raw one has been marked there for as long as the pass has existed. The regression fixture covers both guard shapes and sums them, so either one failing changes the answer: a plain static holder (echo 41 -> 42) and an interface-declared field reached through the implementing class (echo 20 -> 21). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Reseed the ValidatorLightweightPicker goldens for windows and linux Not this branch's render. #5791 (ComponentGroup / segmented control) changed the layout by about 4px below the Birthdate picker, and landed at 21:58 on 2026-09-12 while master last ran the Windows and Linux screenshot gates at 07:01 that morning -- those gates skip most pushes to master, so nothing compared the new render until the next PR did. This branch is JavaScript-target only (the JS suspension analysis, the JS emitter, parparvm_runtime.js and the JS port's own files), so it cannot reach the Windows or Linux native renderers at all. The three goldens come from this PR's own CI artifacts: the windows x64, arm64 and cross-build runs produce a byte-identical PNG and share one golden, and both linux arches produce another, so no arch is left mismatching. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * JS port: a null invoke owner is "no guard here", not an NPE `classInitGuardOwner` handed `resolveDirectInvokeOwner`'s result straight to `sanitizeClassName`, which dereferences it. The resolver answers null for a null owner -- that guard is why it has one -- so the analysis pass would have thrown rather than reporting what every caller already understands: null means this instruction places no class-init guard. Found red-teaming this branch's own diff, not in review. ASM does not hand out a null owner for a real methodref, so it is latent; the emitter's existing call site has the same shape and has never fired. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
















































































































































































































































Answering "does
ComponentGroupstill serve a real purpose?" -- mostly no, with one exception that turned out to be broken.What the themes actually contain
GroupElementButtonGroupToggleButtonComponentGroupBooliOS7Theme.res(legacy)iOSModernThemeAndroidMaterialThemeThe original purpose -- iOS 6 style grouped rows with rounded first/last corners -- is gone. Neither current native theme defines a single
GroupElementorButtonGrouprule.What survives is the segmented control:
setHorizontal(true)renames members toToggleButton/First/Last/Only, and both themes style exactly those, in full, across all four states.The bug
That surviving case did not work.
updateUIIDsis gated onComponentGroupBool, neither theme sets it, sosetHorizontal(true)renamed nothing and a segmented group painted as plain buttons on every app using a current native theme. The styling was unreachable through the API that exists to reach it.Turning the flag on in those themes is not the fix. It also governs the vertical path, which flattens Labels, TextFields and Buttons onto one
GroupElementUIID neither theme styles -- trading an inert segmented control for badly styled vertical groups. The flag stays and still governs that path.Instead, a group that is horizontal and still using the
ToggleButtonUIIDssetHorizontalinstalls is active on its own. The activation is deliberately narrow: it recognises the framework's own UIIDs, not "horizontal" on its own, so an application that set its own element UIID keeps the documented theme-gated behaviour. Renaming toToggleButtonwithout consulting the theme is whatButton.setTogglealready does, ungated, so any app with toggle buttons already depends on that UIID resolving.Two more bugs found alongside it
setForceGrouponly assigned the field. It took effect if and only if something else later calledupdateUIIDs-- adding a component, or a theme refresh -- so on an already-populated group it did nothing, and clearing it never restored anything.updateUIIDsonly renames; it has no path back. Members keptToggleButtonnames a vertical group no longer justified. The three copies of that restore loop are now one method.Two false claims corrected: the comment in the iOS theme said that theme sets
ComponentGroupBool(true of the legacy iOS themes, not of it), and the guide said the same.Behaviour change
setForceGroup(false)no longer deactivates a horizontal group -- it is a segmented control on its own terms now.RadioButtonTest.testRestoreWorksAfterGroupingIsSwitchedOffused a horizontal group to reach the restore path and now uses a vertical one; what it tests, the ownership marker outliving the restore, is unchanged.Verification
core-unittests: 6695 tests, 0 failures. SpotBugs report regenerated from scratch: 0 findings.ComponentGroupSegmentedTest, 8 tests. Probed against pre-fix code: 5 of the 8 fail, which are the behavioural ones. The 3 that pass are the two deliberate guards (vertical still gated, custom element UIID still gated) and the characterization test for the newsetForceGroupsemantics.check-cast-semantics.sh,check-control-characters.py,check-copyright-headers.sh(4 files passed), guide structure / xrefs / missing-code-blocks / unused-images, Vale 0 alerts, LanguageToolstatus: oktotal: 0.~/.m2.