feat: add production UI gallery and inspector system
CI / Format, lint, test, build (push) Waiting to run

This commit is contained in:
Rbanh committed 2026-07-18 12:05:26 -04:00
1 parent cf6eaba534
commit 53dc1e44d8
95 files changed
+11003 -1652

No files matched your search

+47 -14
View File
@@ -56,15 +56,14 @@ body. A 32 px **Materials** heading precedes repeated slots. Expanded headers ar
expanded. An expanded wide row keeps its label/value/channel geometry fixed while only the texture
field grows above the reference width.
| Column | Width |
|--------|-------|
| Parameter label | 82 px |
| Value | 132 px |
| Value/channel gap | 6 px |
| Channel | 48 px |
| Channel/texture gap | 16.5 px |
| Texture field | 198.5 px at the reference width |
| Locate / Clear | 24 px each, separated by 6 px |
| Element | Exported geometry |
|---------|-------------------|
| Parameter label | x12, 82 px |
| Scalar group | x103.35, 138.8 px visible ownership |
| Scalar internals | 6 px leading inset, 93.8 px track, 6 px gap, 33 px number |
| Channel | x242.5, 48 px |
| Texture group | x298.5; 198.5 px field at the reference width |
| Locate / Clear | 24 px each, separated from the field by 6 px |
At the 420 px Inspector floor, the slot is 396 px and parameter sections are 369 px. Surface remains
46 px and Inputs is 372 px: each of the six rows uses a 58 px two-line layout with parameter,
@@ -72,9 +71,10 @@ value, and channel above a 345 px asset picker. UV reflows from 54 px to 94 px.
scrolling, clipped buttons, or height-dependent width changes.
These reference dimensions are implemented as owning rectangles, not nested `horizontal` flow.
At 569 px, each input row begins its value at x96, channel at x234, and texture group at x298.5.
At 369 px, the parameter line is `x12/y5/w345` and the texture line is
`x12/y31/w345`. Texture names are clipped and ellipsized inside the field, so content cannot move
At 569 px, a scalar row begins its value group at x103.35, channel at x242.5, and texture group at
x298.5. At 369 px, the scalar group remains at x103.35 and expands to 205.3 px (a 160.3 px track),
the channel begins at x309, and the texture line is `x12/y31/w345`. Texture names are clipped and
ellipsized inside the field, so content cannot move
the fixed Locate/Clear anchors. A transient width below 372 px retains finite clipped rectangles
and replaces the two low-frequency texture actions with one overflow control until the Inspector
minimum is restored.
@@ -138,11 +138,44 @@ non-interactive preview labelled `Planned — screen sampling pending`.
Every preview updates the live material document. Apply keeps the dirty in-memory value; Cancel,
Escape, Close, and outside dismissal restore the exact value captured on open. No picker action
writes source or queues derived processing. Material scalar inputs use the reusable 130 x 22
Penpot control: a 70 x 14 track, 10 px thumb, 8 px separation, and 48 x 22 numeric field. Expanding
writes source or queues derived processing. At the 620 px reference, Material scalar inputs use a
138.8 x 22 visible group: 6 px leading inset, 93.8 x 10 interaction track with a 3 px painted rail
and 4 px thumb radius, 6 px separation, and a 33 x 22 numeric field. At the 420 px reference only
the track grows, to 160.3 px. Expanding
Advanced scrolls its complete 178 px disabled-preview body into view rather than revealing a clipped
partial section.
## Focused UI gallery workflow
Use the lightweight production-component gallery for routine design iteration:
```bash
python scripts/editor/ui_gallery.py watch
```
The gallery links `editor_ui` and `material_schema` directly and does not open a project, scene,
renderer, or gameplay runtime. F1–F4 select Materials 620, Materials 420, Renderer 760, and Renderer
480; Shift+F1–F4 select Live, Side by side, Overlay, and Difference; Page Up/Page Down cycle the
ownership and health fixtures. `crates/ui_gallery/fixtures/theme.json` and `material.json` reload in
the running process. Rust changes rebuild only the focused dependency closure, report a bounded
`resolved/rebuilt` counter, launch the replacement, and then stop the last-good gallery; a failed
build leaves the last-good process available.
Renderer presets are not screenshots of a gallery-only approximation. `editor_ui::renderer` owns
the shared renderer-array header, 84/60 px renderer identity headers, 38 px property heading, 50 px
indexed material heading, and slot rail used by both the gallery and the full Static Mesh Renderer
Inspector. Renderer material slots reuse `MaterialSlotPanel`; the first slot may retain its full
82 px identity/action header while only its parameter body is collapsed, secondary slots use the
compact state, and an actually empty slot has an explicit drop/Choose Material presentation.
Difference statistics are diagnostic, not a standalone acceptance threshold: truthful runtime
semantics and renderer rasterization can intentionally differ from an authored mock. Every such
difference is recorded in the [M2 UI gallery delta matrix](evaluations/content-workspace-m2/ui-gallery-delta-matrix.md).
Final acceptance still requires a paired full-editor capture and interaction scenario. If the
build-storage hard limit blocks a rebuild, keep the current last-good binary and evidence, record
the gate as pending, and resolve storage through the managed lane workflow rather than deleting
individual Cargo files.
## Review checklist
- Verify the 620 px geometry numerically and in a native capture.
@@ -14,10 +14,12 @@
**Release-candidate commit:** Pending publication commit
**Native interaction acceptance:** **Pass for the workflows recorded below**
**Native interaction acceptance:** **Pass for the recorded content workflows; current Inspector UI acceptance remains in progress**
**Pinned Penpot acceptance targets:** [export index](penpot/README.md)
**Current UI comparison record:** [UI gallery delta matrix](ui-gallery-delta-matrix.md)
This feature-level record covers the Content Browser interaction pass added during M2 completion.
It does not close the milestone or replace the exact-commit, clean-checkout, import/reimport,
forward/Solari, packaging, and independent signoff gates in the M2 plan.
@@ -4,6 +4,10 @@
The current Penpot README makes pages 01–30 authoritative, pages 90–91 implementation masters only, and page 99 forbidden as current guidance. The `CODEGEN MAP` block is handoff documentation and never renders in Blacksite.
Measured production/reference differences and intentional semantic exceptions are tracked in the
[UI gallery delta matrix](../ui-gallery-delta-matrix.md). A raw Difference score never overrides a
runtime invariant or substitutes for the paired full-editor acceptance capture.
## Responsive Inspector targets
| Export | Penpot page and shape | Required match |
@@ -0,0 +1,58 @@
# M2 UI Gallery Delta Matrix
> **Evidence record — not current product guidance.** Use the [documentation index](../../../README.md)
> for current guidance. The canonical visual contract is the [Editor Design System](../../design-system.md),
> with architecture in [ADR 0049](../../../adr/0049-penpot-led-editor-visual-system.md).
This matrix distinguishes correctable production drift from deliberate differences between an
authored Penpot mock and a truthful interactive editor. The direct PNG is the visual reference;
the SVG is used to inspect numeric child geometry because it does not embed Source Sans Pro.
| Area | Penpot reference | Production/gallery truth | Classification | Evidence/state |
|------|------------------|--------------------------|----------------|----------------|
| Materials canvases | 620 x 539 and 420 x 735 | Exact presets render the shared `editor_ui` components | Required match | Geometry/unit tests pass; fresh paired gallery captures and full-editor primitive captures at 620/420 pass |
| Renderer canvases | 760 x 1233 and 480 x 828 | Exact gallery presets use shared renderer/component chrome | Required match | Fresh paired gallery captures cover both widths; the rebuilt full editor now has managed static-renderer captures at 760/480 |
| Renderer hierarchy | 50 px component header, 40 px array header, 84/60 px entry headers, 38 px properties heading, and 50 px indexed-material heading | The gallery and full editor call the same `editor_ui::renderer` view-model/chrome functions | Resolved structural drift | Focused checks pass and the fresh full-editor static renderer shows the same hierarchy without the former duplicate slot presentation |
| Renderer slot states | Full primary slot, compact secondary slot, explicit unassigned drop target, and collapsed sibling renderers | The shared material panel supports a full header with collapsed parameters and a first-class empty thumbnail/Choose Material action | Resolved structural drift | Fresh 760/480 gallery pairs show all states without gallery-only material cards |
| Scalar geometry | 6 px inset, 93.8/160.3 px track, 6 px gap, 33 px number | Same exported child coordinates at 620/420 | Resolved drift | Focused tests and 620 overlay pass |
| Scalar sample value | Text reads `0.72`; thumb is positioned near 0.55 | Thumb position is computed from the displayed/runtime value | Intentional semantic delta | Keep truthful 0.72 normalization |
| ORM channels | ORM selected while AO, Roughness, and Metallic sample glyphs all read G | Canonical ORM is AO=R, Roughness=G, Metallic=B | Intentional semantic delta | Runtime/schema invariant and fixture test |
| Material preview | Authored static sample sphere | Gallery uses a deterministic fixture approximation; full editor uses the real typed thumbnail | Intentional content delta | Full-editor thumbnail was observed pending and then resolved in place without layout movement |
| Texture identity | Mock fields use generic/synthetic asset art | Ready project textures show their typed thumbnail without a redundant generic icon | Intentional product delta | Texture-field test passes |
| Borders/rasterization | Browser-rendered SVG strokes can antialias across pixel boundaries | egui uses deterministic inside strokes | Renderer-level delta | Do not alter semantic colors or geometry to mimic browser antialiasing |
| Typography | Direct PNG preserves Source Sans Pro | Production bundles Source Sans Pro Regular/Bold and maps explicit 400/700 families | Required match | Font/type-role tests and fresh gallery/full-editor captures pass |
| Difference metric | Raw per-pixel comparison includes all sample and raster deltas | Latest Materials 620 diagnostic: mean 7.41, max 231, 22.8% of pixels above 8 | Diagnostic only | Must be interpreted through this matrix, never used alone for acceptance |
| Runtime reload | Not applicable to the design mock | Theme and material fixture JSON reload without rebuild/restart | Framework requirement | Focused reload tests pass |
| Rebuild/restart | Not applicable to the design mock | Focused managed build reports bounded progress; replacement launches before last-good exits; failures preserve last-good | Framework requirement | Eight workflow tests pass |
## Remaining acceptance
- Primitive Materials pass full-editor 620/420 and deep-scroll containment. The rebuilt static
renderer passes the native 760/480 hierarchy and containment check. The current checked-in scene
has no placed skinned actor, so skinned presentation remains proven through the shared production
component, renderer gallery fixture, focused tests, and editor compile rather than a separate
native actor capture.
- The broad `penpot-material-inspector` scenario intentionally remains incomplete because picker,
color, invalid-drop, dirty/save/relaunch, and broken-reference assertions are outside this gallery
framework boundary. Its fixture was restored byte-for-byte after the two managed integration
captures.
- Attach the paired reference/native evidence to #68 at the next authorized tracker synchronization.
Keep #68, #59, #65, and M2 in Acceptance-in-progress; this framework slice is evidence for the
next visual pass, not permission to publish or close the milestone.
## Fresh local evidence — 2026-07-18 10:20 UTC
- Materials 620: `ui-gallery-materials-620-20260718T102015Z.png`
(`cc918c567522204f9dc8d8f179e24e49ba802fe03a81d3a65fa1e5b6058623c9`)
- Materials 420: `ui-gallery-materials-420-20260718T102015Z.png`
(`70dea081df62ab38d589ea559d73a6e8d3685f26fee54dbc87cc8682ebed8474`)
- Renderer 760: `ui-gallery-renderer-760-20260718T102015Z.png`
(`724d9cedf25753de9315993f9e6ea656949f54e5b54c44f1f8ab46f1db88b0d6`)
- Renderer 480: `ui-gallery-renderer-480-20260718T102015Z.png`
(`f90c3f72b757649f5c11362ed6d776e5e85288751ffd74f08f8cc386f162fc4f`)
- Full-editor primitive Inspector 620, 420, and deep-scroll captures are recorded under the same
local `.codex/evidence/` store with timestamp `20260718T095413Z`.
- Full-editor static renderer 480: `penpot-material-inspector-20260718T104504Z.png`
(`3c5c6585822afffa6c29994aa757adf645c81d653e369e059bbee08c26c1aa26`)
- Full-editor static renderer 760: `penpot-material-inspector-20260718T104550Z.png`
(`95ef7366d1671ac494cb5fd389d3332d51a0d5636cd0a02f66e9faf0399eb82f`)
+11
View File
@@ -181,6 +181,17 @@ section stacks the texture field beneath that line. A bounded transient fallback
Locate/Clear into overflow instead of allowing negative or out-of-clip geometry. Slot IDs, source
paths, fingerprints, and usage counts are diagnostics rather than material parameters.
Routine visual iteration uses `python scripts/editor/ui_gallery.py watch`, which renders these same
production components against the direct 620/420 Penpot exports without loading material runtime
state. The gallery is diagnostic; final behavior and persistence acceptance still runs in the full
editor. Intentional mock/runtime differences are listed in the
[M2 UI gallery delta matrix](evaluations/content-workspace-m2/ui-gallery-delta-matrix.md).
In renderer arrays, collapsing Parameters does not have to erase material identity or assignment
actions. The shared slot can retain its complete asset header while the parameter body is closed;
secondary compact rows and genuinely empty drop targets are explicit states of that same component,
not separate renderer-only material widgets.
Base Color is a multiplier over its albedo texture. Metallic and Roughness are scalar multipliers
over their selected channel; Occlusion is a scalar texture input. The **ARM / glTF ORM** preset uses
R=ambient occlusion, G=roughness, and B=metallic. **Separate Maps** samples each map's R channel,