Skip to content

feat: Control group component - #5145

Draft
jperals wants to merge 15 commits into
mainfrom
dev-v3-jotresse-control-group
Draft

jperals wants to merge 15 commits into
mainfrom
dev-v3-jotresse-control-group

Conversation

@jperals

@jperals jperals commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Description

This PR includes:

And on top of that:

  • Moves the control-group component and its test utils from the internal directories to the public ones so ControlGroup is available as a public component
  • Adds analytics metadata
  • Adds small changes to API docs of select and multiselect, to explain that when rendered in a control group:
    • expandToViewport is enforced in both
    • inlineTokens is enforced in multiselect

How has this been tested?

Unit, integration and visual regression tests.

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Reconcile the branch's public ControlGroup work onto origin/main's internal
implementation. The canonical component now lives at
src/internal/components/control-group/ (main's location); src/control-group/
is a thin public wrapper that re-exports it, so there are no two divergent
copies of the component logic.

Conflict resolution (option 2):
- src/control-group/index.tsx + interfaces.ts: reduced to a thin public
  wrapper over the internal component (adopting main's new-location imports).
- src/input/__tests__/control-group.test.tsx: public ControlGroup + public
  ControlGroupWrapper + internal PositionProbe.
- interfaces: kept main's richer ControlGroupProps.ControlGroupDirection
  (horizontal | vertical | auto).

Consistency: repointed grouped-control-styles consumers, the public test-util
selectors import, and the cross-component control-group tests; removed the
duplicated public implementation files; regenerated the documenter and
test-utils snapshots. The public wrapper now wires useBaseComponent +
applyDisplayName and the internal component accepts an optional
__internalRootRef so the released component meets the public-component
baseline.

Verified: npm run build (pass), npm run lint (pass), targeted control-group
jest suites (pass), broader consumer suites (pass), naming-convention and
use-base-component for control-group (pass), snapshots regenerated, full
npm run test:unit green except the pre-existing test-utils-selectors
CWD-path bug on the untouched wizard component (out of scope).
@codecov

codecov Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.73%. Comparing base (010510f) to head (ebd1f0d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5145   +/-   ##
=======================================
  Coverage   97.73%   97.73%           
=======================================
  Files         996      997    +1     
  Lines       32210    32215    +5     
  Branches    11900    11902    +2     
=======================================
+ Hits        31481    31486    +5     
  Misses        723      723           
  Partials        6        6           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Resolve two control-group conflicts introduced by merging origin/main
while keeping the control group publicly available.

- src/internal/components/control-group/index.tsx: keep both the
  InternalBaseComponentProps import (public base-component wiring) and
  main's new FormFieldContext/useFormFieldContext imports, since the
  merged body uses all of them for validation and __internalRootRef.
- control-group.test.tsx: take main's new Select and createWrapper
  imports but use the PUBLIC test-utils/dom/control-group wrapper path
  instead of main's internal path, keeping a single public surface.

All other changes from main's latest are kept as-is. Public wrapper,
public test-util path, and barrel registrations remain intact.
Promote the control-group component from an internal component to a
fully public component, co-located following the segmented-control /
tiles convention.

- Move implementation to src/control-group/internal.tsx
- Co-locate interfaces, styles, tests, and integ tests under
  src/control-group/
- Keep the shared grouped-control-styles helper internal under
  src/internal/components/control-group-styles/
- Repoint all tests and dev pages to the public component
- Repoint test-utils to the public component

sim: https://taskei.amazon.dev/tasks/control-group-release
Port #5173 onto the relocated public
control-group component. The PR's original internal paths
(src/internal/components/control-group/) are deleted on this branch;
the component now lives at src/control-group/.

- interfaces.ts: ControlGroupProps extends FormFieldControlProps,
  exposing controlId / ariaLabelledby / ariaDescribedby in the public
  API (imported from ../types/form-field, public-safe).
- internal.tsx: wire the three props into useFormFieldContext and
  resolve a group id for the inline-label case (generated fallback so
  the inline label's htmlFor can reference the native group).
- Add 4 unit tests covering controlId and the ARIA properties,
  including the inline-label + ariaLabelledby merge.
- Regenerate the documenter snapshot to reflect the three new props.
Port GitHub PRs #5182 and #5172 onto the relocated public control-group
component (src/control-group/; the PRs' internal paths under
src/internal/components/control-group/ are deleted on this branch).

#5182: disabled grouped-control styles (grouped-control-disabled mixin),
parameterized grouped-control validation-border padding, grouped-control
CSS class renames (with-error/with-warning -> grouped-with-error/
grouped-with-warning, grouped-validation-first -> grouped-row-first) across
the shared mixin, grouped-control-styles helper, input, autosuggest-input,
button-trigger and segmented-control; base border now
color-border-control-group-default; segmented-control wrapper drops the
grouped-control class helper; plus an autosuggest inline-tokens validation
dev-page example.

#5172: a shared grouped-control dev-warnings module, its test, and consumer
wiring in autosuggest, input, multiselect and select.

Path remaps: grouped-control-styles helper and the new dev-warnings module
live under src/internal/components/control-group-styles/; the dev-warnings
test lives under the public src/control-group/__tests__/. The multiselect
inlineTokens destructured default is dropped (false -> no default) so an
explicit false is distinguishable from undefined for the warning.
Port the latest commits of PR #5173 onto the public control-group
layout. ControlGroupProps now only picks ariaLabelledby and
ariaDescribedby from FormFieldControlProps; the group id still comes
from a surrounding FormField context. Regenerate the documenter
snapshot.
Port the latest commits of PR #5182 onto the public control-group
layout: add a grouped-<direction> class, replace grouped-row-first
with direction/position selectors to fix the vertical-last border,
and restore grouped classes on the segmented control select mode.
Port PR #5186 onto the public control-group layout: wrap the
autosuggest token field in ResetGroupedControlContext so nested
controls do not pick up grouped borders in validation state.

This branch was successfully deployed

3 active deployments
dev-pages-react18 — b792a4a8 Deployed Oct 23, 2026 by jperals via deploy (React 18) / deploy #2948
dev-pages-react16 — b792a4a8 Deployed Oct 23, 2026 by jperals via deploy (React 16) / deploy #2948
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