Skip to content

Commit ed4c471

Browse files
author
Roy Lin
committed
feat: inventory renderer field ownership
1 parent c716c69 commit ed4c471

6 files changed

Lines changed: 593 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ libraries.
412412
## Documentation
413413

414414
- [Runtime and protocol architecture](docs/architecture.md)
415+
- [Renderer field inventory](docs/renderer-field-inventory.md)
415416
- [Native app shell](docs/app-shell.md)
416417
- [Native packaging](docs/packaging.md)
417418
- [React Aria native direction](docs/react-aria-native.md)

docs/architecture.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,12 @@ software reference evidence, while
155155
interaction, focus, selection, i18n, and accessibility remain usable without
156156
Graphics, SWC, or `rsx_ui`.
157157

158+
The versioned [renderer field inventory](renderer-field-inventory.md) keeps
159+
parsing coverage separate from renderer coverage. Its executable contract
160+
enumerates all current `PortableStyle` fields and exhaustively assigns native
161+
roles and normalized input events to their first complete delivery milestone.
162+
Later-milestone fields remain explicit diagnostics in earlier renderer slices.
163+
158164
The remaining dependencies stay one-way:
159165

160166
- `ComponentCx`, RSX parsing, and `rsx_ui` authoring compile outward-facing

docs/renderer-field-inventory.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Renderer Field Inventory
2+
3+
Updated: 2026-08-01
4+
5+
This inventory is the cutover contract between the existing semantic runtime
6+
and the self-drawn A3S Graphics path. A field being parsed into `PortableStyle`
7+
or `NativeProps` is not evidence that layout or paint implements it.
8+
9+
`src/render_contract.rs` is the executable source of truth. It enumerates all
10+
504 current top-level `PortableStyle` fields from their serialized shape and
11+
assigns each one to its first complete delivery milestone. Its tests pin the
12+
field count, so adding or removing a field requires an intentional inventory
13+
update. `NativeRole` and `NativeEventKind` use exhaustive matches, so new enum
14+
variants cannot compile without an assignment.
15+
16+
## Milestone assignments
17+
18+
| Assignment | Owned projection |
19+
| --- | --- |
20+
| Semantic | Raw declarations, custom properties, interaction-variant declarations, cascade bookkeeping, and the parser's explicit unsupported map |
21+
| M3 layout/scene | Box sizing, block and row/column flex flow, explicit and constrained size, padding, margin, gap, inset, solid background and border rectangles, radius, opacity, overflow clipping, z-order, visibility, and pointer hit eligibility |
22+
| M4 interaction/text | Font and text fields, writing direction, editing, caret and selection, focus visuals, normalized input, IME, clipboard, overlays, speech semantics, and accessibility bridges |
23+
| P1 components | Grid, tables, columns, lists, containment, assets, images, advanced backgrounds, SVG component paint, scrolling policy, themes, and complete collection/component projection |
24+
| P2 advanced Graphics | Transforms, masks, filters, blend/isolation, paths and shapes, advanced SVG paint, animation, transitions, and view transitions |
25+
26+
M3 may carry any `NativeRole` through generic box layout. The role assignment
27+
records when its visible content and behavior become complete: structural
28+
containers are M3; text and basic controls are M4; assets, collections,
29+
overlays, and tables are P1; Canvas is P2. Metadata-only roles remain semantic.
30+
31+
## Native tree fields
32+
33+
The `NativeElement` identity, role, props, and ordered children remain the
34+
shared input. The renderer uses a path-qualified identity derived from stable
35+
sibling keys; it must not use a platform handle or a tree index as identity.
36+
37+
`NativeProps` fields are owned as follows:
38+
39+
| Field group | Owner/gate |
40+
| --- | --- |
41+
| `web.class_name`, `web.style`, visibility, orientation | M3 style resolution and layout |
42+
| label, value, placeholder, range values, input hints, editing constraints | M4 text/input/IME; sensitive values are never copied into paint diagnostics |
43+
| action, disabled, required, invalid, read-only, selected, checked, expanded, focus flags | Existing semantic runtime plus M4 hit/focus/action projection |
44+
| accessibility name, description, relationships, structure, and state | Existing semantic truth plus parallel M4 OS bridges; never inferred from paint |
45+
| popover/anchor and overlay metadata | Existing overlay policy plus M4 layout/layer projection |
46+
| resource URLs, intrinsic media size, loading/decoding policy, HTML resource groups | P1 asset and component projection; product I/O remains outside GUI |
47+
| HTML activation, form, collection, dialog, shadow, microdata, and metadata groups | Semantic-only unless a listed M4/P1 projection consumes the field |
48+
49+
## Input, focus, overlay, text, and accessibility
50+
51+
- Input inventory covers every `NativeEventKind`, modality, modifier, position,
52+
delta, repeat, click count, handled-activation marker, related target, and
53+
optional value. All belong to M4; coordinates feed GUI-owned hit testing.
54+
- Focus inventory covers node identity, containment, restoration, autofocus,
55+
disabled state, tab order, focusability, input modality, focus-visible, and
56+
focus-within. Semantic state exists today; geometry integration is M4.
57+
- Overlay inventory covers modal/underlay/dismiss policies, blur and Escape
58+
behavior, autofocus, anchor and boundary rectangles, placement, direction,
59+
offsets, flip policy, container padding, arrow geometry, and maximum height.
60+
M4 owns the self-drawn layer and focus containment.
61+
- Text inventory includes label/value/placeholder content, font selection and
62+
fallback, size/weight/style/features, shaping direction and writing mode,
63+
line layout, wrapping, alignment, decoration, selection, caret, composition,
64+
and password redaction. Embedded reference fonts are mandatory for fixtures.
65+
- Accessibility inventory includes role, name, value sensitivity, description,
66+
relationships, structural indices/spans, live state, control state, focus,
67+
selection, checked/expanded state, children, actions, and announcements. It
68+
is a parallel product of semantic state and must not be reconstructed from
69+
Graphics commands.
70+
71+
## Diagnostic rule
72+
73+
The layout/scene adapter reports every requested field whose assigned
74+
milestone has not landed. A field assigned to a later milestone is deferred
75+
with its owner; a field present in `PortableStyle::unsupported` is rejected.
76+
No adapter may treat a parsed field as implemented merely by ignoring it.

docs/roadmap.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,11 @@ Landed evidence:
235235
readback failures into the GUI error contract
236236
- the first compatibility cleanup removed class-name widget mapping shims and
237237
replaced broad dead-code allowances with target-accurate compilation
238+
- the versioned renderer inventory accounts for all 504 `PortableStyle`
239+
fields, every `NativeRole`, all normalized input events, and the focus,
240+
overlay, text, and accessibility records required by cutover
238241

239-
Remaining work is the field inventory and the first `NativeElement`
240-
layout-to-scene adapter.
242+
Remaining work is the first `NativeElement` layout-to-scene adapter.
241243

242244
Deliverables:
243245

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ pub mod overlay;
4848
pub mod overlay_position;
4949
pub mod platform;
5050
pub mod protocol;
51+
pub mod render_contract;
5152
pub mod renderer;
5253
#[cfg(feature = "authoring")]
5354
pub mod rsx;

0 commit comments

Comments
 (0)