Skip to content

feat(ui): add Unity 6 UI Toolkit authoring and verification - #3

Merged
mflRevan merged 3 commits into
mflRevan:mainfrom
quentinleon:feat/ui-toolkit-authoring
Sep 6, 2026
Merged

mflRevan merged 3 commits into
mflRevan:mainfrom
quentinleon:feat/ui-toolkit-authoring

Conversation

@quentinleon

Copy link
Copy Markdown
Contributor

Agents authoring UI Toolkit assets currently have no isolated way to populate fixture states, inspect resolved bindings and layout, or verify the rendered result. This adds a Unity 6+ ucp ui workflow that performs those steps without loading or dirtying a scene.

  • Add ui list, importer/clone-backed ui lint for UXML/USS/TSS, bounded ui inspect, panel PNG ui screenshot, and multi-state ui check.
  • Support strict .ucp-ui.json scenarios with data overlays, fixture mutations, repeat templates, and managed virtualized ListViews.
  • Traverse realized control children, preserve error details under diagnostic limits, and avoid false focus warnings on Unity internals. Inspect immutable package artifacts without forced reimport.
  • Report interrupted UI operations on reload/quit, recover results through status lookup after notification timeouts, and allow the bridge's 300-second ceiling through the default CLI render timeout.
  • Add command documentation, mirrored website content, and a generated ucp-ui micro-skill.

ucp ui screenshot captures the isolated UI harness. The existing top-level ucp screenshot implementation is unchanged.

Validation

Validated after integrating upstream 0.6.2:

  • Rust: all 117 tests passed offline.
  • Unity 6000.3.20f1, Linux with graphics enabled: all 52 UI Editor tests passed, none skipped, in an isolated project using this branch's bridge package.
  • Website production build passed.
  • Version metadata, generated micro-skills, and whitespace checks passed.

Live checks before the upstream integration also confirmed that a visible empty ListView passes --fail-on-warnings, a late binding error survives a full warning budget, reload produces a structured interruption result, and immutable package lint does not force reimport.

Other Unity versions and platforms have not been validated for this feature. Rendering requires an interactive Editor with a graphics device; lint supports batch mode. The capture backend uses an internal Editor API, so additional Unity-version coverage remains valuable before release.

- add `ucp ui` commands for listing, linting, inspecting, capturing, and checking UI Toolkit assets
- support strict scenarios, data binding, repeaters, virtualized lists, and deterministic screenshots
- add Unity bridge services plus Rust and Editor test coverage
- document Unity 6+ workflows and publish the focused `ucp-ui` agent skill
@vercel

vercel Bot commented Sep 6, 2026

Copy link
Copy Markdown

@quentinleon is attempting to deploy a commit to the mflrevan's projects Team on Vercel.

A member of the Team first needs to authorize it.

mflRevan added a commit that referenced this pull request Sep 6, 2026
Integration pass over #3 on top of the contributor's commits:

- Normalize the eight two-line .cs.meta stubs to the package's full
  MonoImporter form so Unity does not rewrite them on first import.
- UiOperationManager: skip the per-frame pruning scan while idle, and expose
  ActivateNextForTests() instead of having a test reach for the private
  method through reflection.
- UiSimpleQuery: reject compound name/class selectors such as ".a.b" or
  "#a#b" up front; they previously validated and then matched nothing.
- Name scenario capture artifacts "Inventory-<state>-..." rather than
  "Inventory.ucp-ui-<state>-...".
- Tests: broken USS and unknown-UXML-element lint through the real importers
  and the router, missing/unsupported path diagnostics, the full `set`
  allowlist end to end, set type-mismatch locations, ui/list discovery with
  an invalid fixture, selector and query validation, ui/status for unknown
  ids, envelope sanitizing through MiniJson; Rust coverage for result
  aggregation, outcome mapping, range validation, and --force requiring an
  output target.
- Changelogs for 0.6.3 (CLI and bridge), PROJECT.md section for the harness.

Validated: 121 Rust tests; 159/159 bridge edit-mode tests on 6000.4 in
batch mode with zero skips; live list/lint/inspect/screenshot/check against
a scenario fixture in the demo project with both states captured correctly.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012TJzJDDKMoV5TgpLJMRu15
@mflRevan
mflRevan merged commit a1ab2a6 into mflRevan:main Sep 6, 2026
1 check failed
@mflRevan

mflRevan commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Merged into main for 0.6.3 with your three commits intact, followed by two integration commits (a2f1f02, 389fc00). Thank you for a thorough, well-tested contribution; it fits the bridge and CLI conventions closely and needed only small adjustments:

  • Eight .cs.meta files were two-line stubs; they are now in the package's full MonoImporter form so Unity does not rewrite them on first import.
  • UiOperationManager.Tick now returns early while idle (it runs on every editor update once subscribed), and ActivateNextForTests() replaces the reflection call in the shutdown test.
  • UiSimpleQuery.Validate rejects compound selectors such as .a.b / #a#b up front instead of validating them and matching nothing.
  • Scenario capture artifacts are named Inventory-<state>-...png rather than Inventory.ucp-ui-<state>-...png.
  • Added tests on top of yours: broken USS and unknown-UXML-element lint through the real importers and the router, the full set allowlist end to end, ui/list with an invalid fixture, selector/query validation, ui/status for unknown ids, and envelope sanitizing; plus Rust coverage for result aggregation and --force requiring an output target.
  • Changelog entries (CLI and bridge) and a PROJECT.md section for the harness.

Validation on this end: 121 Rust tests; bridge edit-mode tests 160/160 in batch mode on every Unity 6 slot (6000.0, 6000.1, 6000.2, 6000.3, 6000.4) with zero skips, so the CaptureEditorWindow path and the window-backed tests hold across the range you had not covered; and a live list/lint/inspect/screenshot/check --all-states pass against a scenario fixture on 6000.4 (Windows, D3D12) with both states captured correctly and bindings resolved on repeat cards and realized ListView rows.

It ships in 0.6.3.

@quentinleon
quentinleon deleted the feat/ui-toolkit-authoring branch September 6, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants