feat(ui): add bounded adapter foundations - #3252
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a21d9e5092
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ea281e1f7e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 372cd30b4b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
bfd6fb0 to
a46c492
Compare
c8eaebd to
7fb43e5
Compare
c3ea04f to
6d28f4c
Compare
6d28f4c to
2722510
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2722510701
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
Pull request overview
This PR introduces a dependency-free UI adapter layer in src/react/components/ui/adapter/ and routes new primitives (Accordion, Toast, ToggleGroup, Toolbar) through adapter “mechanics” while keeping the public skins lightweight and theme-token based.
Changes:
- Adds
UIAdapterProvider+ a typed adapter contract, with builtin slots for disclosure, toast, toggle-group, and toolbar. - Ships new public UI primitives (Accordion, Toast, ToggleGroup, Toolbar) plus Storybook docs and overview navigation.
- Adds adapter conformance suites and expands module-boundary guards to enforce “no third-party UI engine” imports in core.
Verification
- Not run in this review environment. Recommended:
deno test --no-check --allow-all --quiet src/react/components/uideno task test -- scripts/docsdeno task storybook:check
Reviewed changes
Copilot reviewed 33 out of 34 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| storybook/stories/ui/Toolbar.stories.tsx | Adds Storybook docs/examples for Toolbar. |
| storybook/stories/ui/ToggleGroup.stories.tsx | Adds Storybook docs/examples for ToggleGroup (includes a controlled example). |
| storybook/stories/ui/Toast.stories.tsx | Adds Storybook docs/examples for Toast provider and API usage. |
| storybook/stories/ui/Accordion.stories.tsx | Adds Storybook docs/examples for Accordion. |
| storybook/stories/Overview.stories.tsx | Registers new UI stories in the Overview navigation grid. |
| src/server/handlers/dev/framework-candidates.generated.test.ts | Ensures new class candidates used by adapter-backed primitives are in the framework candidate set. |
| src/react/components/ui/toolbar.tsx | Adds Toolbar skin routed through the adapter toolbar slot. |
| src/react/components/ui/toggle-group.tsx | Adds ToggleGroup skin routed through the adapter toggleGroup slot. |
| src/react/components/ui/toast.tsx | Adds adapter-routed Toast provider + stable context bridge (useToast). |
| src/react/components/ui/toast-parts.tsx | Adds adapter-independent presentational toast parts + duration validation + auto-dismiss logic. |
| src/react/components/ui/slot.tsx | Strengthens disabled Slot activation blocking across click/auxclick/keyboard. |
| src/react/components/ui/slot.test.tsx | Expands coverage for disabled activation blocking and propagation suppression. |
| src/react/components/ui/index.ts | Exposes new primitives and adapter surfaces on the public veryfront/ui barrel. |
| src/react/components/ui/index.test.ts | Updates the “expected runtime exports” snapshot to include new runtime exports. |
| src/react/components/ui/boundary.test.ts | Adds a module-boundary test to guard against third-party UI engine imports in core ui/**. |
| src/react/components/ui/adapter/toolbar.conformance.test.tsx | Adds adapter conformance tests for the toolbar slot (builtin + independent adapter). |
| src/react/components/ui/adapter/toggle-group.conformance.test.tsx | Adds adapter conformance tests for the toggleGroup slot (builtin + independent adapter). |
| src/react/components/ui/adapter/toast.conformance.test.tsx | Adds adapter conformance tests for the toast slot (builtin + independent adapter + switching). |
| src/react/components/ui/adapter/disclosure.conformance.test.tsx | Adds adapter conformance tests for the disclosure slot (builtin + independent adapter). |
| src/react/components/ui/adapter/contract.ts | Defines the public adapter contract types (new veryfront/ui/adapter surface). |
| src/react/components/ui/adapter/context.tsx | Implements UIAdapterProvider and useAdapter with explicit slot-by-slot merging. |
| src/react/components/ui/adapter/builtin/toolbar.tsx | Implements builtin toolbar roving-focus mechanics as ToolbarParts. |
| src/react/components/ui/adapter/builtin/toggle-group.tsx | Implements builtin toggle-group selection mechanics as ToggleGroupParts. |
| src/react/components/ui/adapter/builtin/toast.tsx | Implements builtin toast queue + viewport + imperative API as ToastParts. |
| src/react/components/ui/adapter/builtin/index.ts | Assembles the builtin adapter map. |
| src/react/components/ui/adapter/builtin/disclosure.tsx | Implements builtin disclosure mechanics as DisclosureParts. |
| src/react/components/ui/accordion.tsx | Adds Accordion skin coordinated by Accordion, with item mechanics routed through the disclosure slot. |
| src/react/components/ui/accordion.behaviour.test.tsx | Adds end-to-end behavioural tests for Accordion + disclosure-slot wiring + hydration. |
| scripts/docs/generate-api-reference.ts | Improves deep-import sample generation to emit import type for type-only barrels. |
| scripts/docs/generate-api-reference.test.ts | Adds a regression assertion for import type generation on type-only deep imports. |
| scripts/build/npm-package-metadata.test.ts | Asserts veryfront/ui/adapter is exported via deno.json exports/imports. |
| docs/api-reference/veryfront/ui.md | Updates generated UI API reference to include new exports and deep import section. |
| deno.json | Exposes ./ui/adapter and veryfront/ui/adapter as a public subpath. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cd4a2414cd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 34 out of 35 changed files in this pull request and generated no new comments.
Suppressed comments (1)
src/react/components/ui/toolbar.tsx:117
ToolbarLinkcannot be disabled via the shared Slot disabled gate. BecauseToolbarLinkPropsextendsAnchorHTMLAttributes, consumers cannot passdisabled, so slotted links cannot be blocked the same way as other adapter-routed controls. If you intend disabled links to be supported (and styled) consistently with the Slot boundary, accept adisabledprop, forward it totoolbar.Item(so Slot receives it), and addaria-disabled:*styles so anchors show the disabled state (they will not get a nativedisabledattribute).
/** Props accepted by `<ToolbarLink>`. */
export interface ToolbarLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
/** React 19: ref is a regular prop. */
ref?: React.Ref<HTMLAnchorElement>;
}
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 393b9cb295
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Addressed the latest exact-head review findings in commit 4c48499:
Validation is green locally: verify:quick; 187 React suites / 1,130 steps; docs generator; Storybook; and test-typecheck baseline. The synthetic merge against current main ef22006 is clean with no overlapping files. @codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4c48499003
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Addressed the exact-head review findings in commit 3d19b29:
Validation is green locally: verify:quick; focused adapter suites (42 steps); full React suite (188 suites / 1,133 steps); docs generator; Storybook; and test-typecheck baseline. The one 1 ms SSR deadline test that flaked under concurrent load passed alone and again in the clean full-suite rerun. Synthetic merge against current main 847b50d is clean with no overlapping files. @codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3d19b295a2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 36 out of 37 changed files in this pull request and generated no new comments.
Suppressed comments (1)
src/react/components/ui/toolbar.tsx:91
ToolbarButtondoes not set a safe defaulttype. If an adapter’stoolbar.Itemrenders a native<button>without explicitly applyingtype="button", usingToolbarButtoninside a<form>will default totype="submit"and can trigger unintended form submits. Other UI button-like primitives in this codebase defensively default tobuttonwhen notasChild(e.g.src/react/components/ui/button.tsx:147).
export function ToolbarButton({ className, ...props }: ToolbarButtonProps): React.ReactElement {
const { toolbar } = useAdapter();
return (
<toolbar.Item
Summary
UIAdapterProviderwith explicit, fail-safe partial compositionSafety and bounds
undefinedentries cannot erase builtin behaviorDeliberate extraction boundary
This is a source-only extraction from #3185 onto the UI foundation merged in #3246. It intentionally does not transplant the recovered Popover, Dialog, Menu, Select, Tooltip, Drawer, or Combobox adapters: review found those implementations predate #3246 accessibility and lifecycle hardening and would regress it. Those surfaces require a separate migration that preserves the #3246 state machines intact.
Verification
maincommit7250d13b3; all nine child commits are patch-equivalent bygit range-diffdeno task verify:quickdeno task storybook:check(13 steps green)deno task lint:test-typecheck(64 grandfathered files, 0 new)git diff --check