Skip to content

[Web][W3.1] Define State widget registry and read-only scalar/structured renderers #82

Description

@code-tc

Objective

Define the extension and data-binding contract for mapping TinyChain State metadata to UI, then implement read-only scalar, map and tuple renderers.

Scope

Typed widget registry, explicit unsupported-state behavior, SSR-injected versus browser-refreshed state, loading/stale/error/redacted states, developer override points and safe formatting. The client must not infer authority from widget metadata.

Acceptance criteria

  • Registry selection is deterministic and overridable without forking.
  • Scalar/map/tuple fixtures render equivalently from SSR and browser refresh paths.
  • Unsupported, redacted, null, malformed and permission-denied states are visually distinct and non-leaking.
  • Serialization round trips and hydration pass tests.
  • Gallery and screenshot evidence receives human approval.

Parent: #9

Required visual evidence

The draft PR must provide a runnable component-gallery route plus before/after screenshots at 390×844, 768×1024, and 1440×900. Cover light, dark, high-contrast, default, hover, focus-visible, disabled, loading, empty, error, and overflow states applicable to the component. Playwright must exercise keyboard interaction and capture deterministic screenshots. A reviewer other than the implementing agent must approve intentional baseline changes; screenshot generation or a passing pixel threshold is not visual approval.

Tembo execution contract

automation:
  eligible: true
  executor_profile: tembo
  readiness: blocked
  primary_repository: TinyChain-Inc/client
  base_branch: main
  writable_scope:
    - web/src/state-widgets/registry/**
    - web/src/state-widgets/read/**
    - web/src/ui/gallery/**
    - web/tests/**
    - js/src/**
  prerequisites:
    - "#77"
    - "#78"
    - "TinyChain-Inc/tcv2#53"
  concurrency_group: ui-state-registry
  required_commands:
    - "cd web && npm ci"
    - "cd web && npm run test:all"
  external_actions: none
  draft_pr_only: true
  completion_authority: human
  visual_validation:
    required: true
    browsers: [chromium]
    viewports: [mobile, tablet, desktop]
    evidence: [component-gallery-url, screenshot-bundle, playwright-report]
    baseline_update_requires: human-visual-approval
    failure_policy: never-auto-accept-diff
  budget:
    size: large
    max_revisions: 3
    max_wall_minutes: 120

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions