Skip to content

docs(spec): define theme-aware component adaptations - #6123

Closed
imdreamrunner wants to merge 1 commit into
feat/theme-tiersfrom
feat/component-adaptations-spec
Closed

imdreamrunner wants to merge 1 commit into
feat/theme-tiersfrom
feat/component-adaptations-spec

Conversation

@imdreamrunner

@imdreamrunner imdreamrunner commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • define adaptations={{default, rules}} for one component-owned policy value
  • reuse PR feat(theme): ordered environmental adaptations in defineTheme #5543's named width points and width/pointer condition grammar
  • make default the explicit SSR and hydration value
  • use popover | bottom-sheet for Selector and native | popover | bottom-sheet for DateInput/DateTimeInput
  • keep structural presentation in JavaScript because it changes DOM, ARIA, focus, and native controls
  • preserve direct presentation and nativePicker props as compatibility syntax
  • stage implementation as shared resolver, Selector, and date/date-time picker PRs

Key boundaries

  • no CSS variables or additional React context are needed
  • BottomSheet does not choose its own breakpoint policy
  • TimeInput and DateRangeInput are out of scope because they do not expose all three picker surfaces
  • theme adaptation rule values do not affect component adaptations
  • Selector's current inclusive 768px adaptive edge becomes AST-012's exclusive below: 'md' edge

Validation

  • node scripts/check-knowledge.mjs
  • independent design review: no actionable issues

Spec approval is intentionally left to the owner.

@vercel

vercel Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Sep 18, 2026 3:56am UTC

Request Review

@xinzi-bot

Copy link
Copy Markdown

Heads-up: this PR and #6091 both add docs/specs/AST-031/spec.md.

Both branches add the file (neither modifies an existing one), and their shared base feat/theme-tiers does not contain AST-031 — so whichever merges second will hit an add/add conflict on that path.

They are two different specs sharing one id, not a duplicate:

Verified next free id: AST-033. AST-032 is not a safe fallback — it is already claimed by two other open PRs (#6066 and #6153). AST-014, -016, -019, -023 and -025 are unused gaps on main, if the team would rather fill those than keep allocating upward.

Since #6091 was opened a day earlier, the tidiest fix is for this PR to take the next id before merge: the id: in the frontmatter plus any in-body spec:AST-031 references. Ordering is up to you two — both specs share the same owners — as long as it happens before the second one merges.

Flagging only; I have not touched either branch.

@astracat-bot

astracat-bot Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟡 Reviewed (for maintainers only) Sep 18, 2026, 4:07 AM UTC

@imdreamrunner
imdreamrunner marked this pull request as ready for review September 18, 2026 03:58

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for writing this up. If this becomes current, every migrated component and its consumers inherit a second shared adaptation contract for choices AST-012 leaves product-owned. Please keep structural surface selection at product callsites through the existing direct props rather than adding ComponentAdaptations<T> or a shared resolver.

@cixzhang

Copy link
Copy Markdown
Contributor

I like the unification direction and connection to the theme API. One concern: using complex objects and lists here will make the props more difficult to memoize and results in more context for garbage collection over time. Might be worse for components that could appear repeatedly. It's possible to workaround but makes me wonder if the simpler "presentation" API with just a string might be better to start.

This branch was successfully deployed

1 active deployment
Preview — b22bf719 Deployed Sep 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants