Skip to content

feat(ui): adopt Shadcn AI Elements in the deferred workspace - #39

Merged
robinbraemer merged 33 commits into
mainfrom
codex/shadcn-ui-system
Aug 27, 2026
Merged

robinbraemer merged 33 commits into
mainfrom
codex/shadcn-ui-system

Conversation

@robinbraemer

@robinbraemer robinbraemer commented Aug 11, 2026 •

Copy link
Copy Markdown
Member

Outcome

Flect now uses Shadcn v4 as the neutral UI foundation and the official AI Elements registry for its agent experience. The protected workspace remains an Astro island on Vite: the static shell loads first, while the Preact-compatible workspace and Effect-owned runtime remain deferred until needed.

What changed

  • Added the Shadcn v4/Radix component foundation and neutral light/dark tokens.
  • Added official AI Elements compositions for conversation, messages, composer, reasoning, and tool activity.
  • Removed superseded bespoke chat primitives and the old persistent pink accent.
  • Kept agent workflows, cancellation, and resources in Effect; AI Elements owns presentation only.
  • Restored the canonical protected-workspace bundle budget and emits a sorted per-island dependency report from the existing bundle gate.
  • Fixed the normal Astro development origin so a real browser can create a Pi session.
  • Fixed asynchronous continuity updates from overwriting an in-progress composer draft.
  • Made the packaged macOS verifier locate the composer through its public accessibility role and name.
  • Moved protected Settings out of the conversation rail: it uses the complete left workspace at wide sizes, and the full viewport at compact sizes.
  • Simplified first run to one clear creation action; canvas-only controls stay hidden until an interface exists. The product surface no longer carries Flect branding, and a larger protected desktop drag strip is available above it.
  • Replaced the global canvas-editing bar with a compact overlay trigger and a viewport-safe contextual palette attached to the selected element. Hover preview, capsule selection, Move earlier/later, resize presets, clearing, busy state, and the existing attributable agent/revision workflow remain connected.
  • Added observable Light/Dark WCAG, viewport-containment, capsule-action, and full direct-edit regression coverage for the contextual overlay.
  • Reworked the chat into one chronological turn timeline with compact grouped tool activity, expandable bounded details, clearer success/attention states, and a calmer composer surface.
  • Moved the model, provider, and reasoning picker into a native top-layer dialog so the canvas cannot clip or cover it.

Current evidence

  • Final local commit: 6698b9a.
  • bun run check passed: 905 Vitest tests (1 intentional skip), type-checking, lint, Effect and product-quality gates.
  • The production and diagnostic browser bundle gates pass with the protected workspace still below its decoded and gzip budgets.
  • Production Chromium passed the grouped tool disclosure closed/open contract and chronological persistence through reload.
  • Production Chromium passed the full Select element → target → Move later flow through the same agent and revision path.
  • Production Chromium passed contextual-overlay WCAG A/AA, viewport containment, hover targeting, and screenshots in both Light and Dark appearances.
  • The full production-Chromium suite passed: 91/91 flows, including settings-as-overlay, model selection, forced-colors, disposable role workspaces, local control, sharing, and the interaction/performance budgets.
  • Rust formatting and 26 native tests passed; the ad-hoc signed macOS .app bundle built successfully.
  • Prior packaged macOS verification passed ad-hoc signature verification, actionable setup, editable draft, sidecar-loss recovery, restored draft, native menus/controls, and one window.
  • Dated baseline evidence: verification report.
  • The hosted Flect quality gate passed for 6698b9a (run 31706281232).

External evidence deliberately not claimed

This host has no xctrace/Instruments, AgentOS cluster, Windows/Linux target, clean second machine, or manual VoiceOver environment. Those remain external release gates and are not represented as complete in this PR.

Review focus

  • Verify AI Elements remains behind the Astro island boundary.
  • Verify application workflows remain Effect-owned.
  • Review the Settings workspace, starter flow, desktop drag region, and contextual selection overlay.
  • Confirm neutral tokens, selected-element visibility, and contextual controls in both appearances.

A request like "make me a landing page website" now makes Shaper write
complete self-contained web source in its sandbox and finish through the
new reserved, Shaper-only `flect app validate|propose` commands. The
source is packaged by the same bounded pre-capsule adapter as project
import, checkpointed onto flect/authoring, compiled for framework
entrypoints, and rendered in the isolated capsule frame as the running
canvas. Because the authorship trust domain equals a declarative
proposal while the frame confinement is stronger, a review without
blocked activation accepts automatically as one local Git transition;
blocked reviews fall back to the explicit candidate ceremony (ADR 0005).

- static authored apps accept through a direct local path so no
  candidate ceremony state ever becomes visible; framework builds keep
  their visible progress before automatic acceptance
- compiled apps own their viewport full-bleed; the window drag surface
  shrinks to its visible handle and the protected Recovery control
  keeps a legible ground over arbitrary app content
- the Shaper prompt authors files in small appended chunks, which also
  removes an unbounded stall when one huge bash tool-call argument hit
  the model output-token limit and Pi re-issued it forever; the Shaper
  generation timeout rises to 180 seconds
- turn work logs report the wall-clock span of agent work instead of
  the summed tool durations
- the capsule staging pipeline and framework packager load on demand,
  keeping the protected pre-tool workspace below its budget
  (607.9 KiB decoded, previously 612.5 KiB)
- .agents/skills/flect-ui-state records the UI-state rules and the
  Effect Atom adoption decision (blocked until it supports effect v4)

Claude-Session: https://claude.ai/code/session_01VNmFXmRMNV98Hyd3xogUuK
@robinbraemer
robinbraemer merged commit 298ee5d into main Aug 27, 2026
1 check passed
@robinbraemer
robinbraemer deleted the codex/shadcn-ui-system branch August 27, 2026 17:49
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.

1 participant