Problem
Native translation can remove shared controls or emit the wrong control type.
Audited at v0.2.546, commit 0013ce66e3.
Reproduced evidence
- Compiling the shared-library
Switchproduces text in place of its label subtree; its interactive button is gone. <label>Agree<input type="checkbox" /></label>translates to a single Text node containing "Agree", with a flattened-text diagnostic.- Each of
<input type="checkbox" />,<input type="radio" />, and<input type="hidden" />translates to TextInput, with no diagnostic.
Sources:
- Tag mapping maps label to Text and all input tags to TextInput
- Text settlement flattens child elements
- Shared Switch markup
Requested change
Translate controls based on their HTML semantics, preserve interactive descendants inside labels/text containers, and keep hidden form values from becoming visible text inputs. Define a supported native radio representation or report unsupported behavior explicitly.
Acceptance
- Shared Switch retains a usable control and responds to changes.
- Checkbox produces the intended checkbox semantics and checked state.
- Radio grouping/selection is supported or clearly diagnosed.
- Hidden inputs do not render visible controls.
- Label text and its control both survive translation.
- Regression coverage compiles the real shared-library templates and checks native node types plus interactions.
- Ordinary inline text remains correct.
Priority
Second in the portability audit sequence. Translation fixes can proceed independently; complete interaction tests also depend on the reactive-props/events issue. Compiler output was verified; device rendering was not exercised in this audit.
Related audit issues
- fix(native): make shared component reactive props and emitted events host-independent: https://github.com/stacksjs/stx/issues/2086