Repository navigation
feat(PowerSearch): presentation is a stable prop, and adaptive is its default - #9797
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 6c6779f |
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| PowerSearch · Storybook | 195.2 kB (+12 B) · 21.6 kB CSS (0) | 6,912 (+5) | ✓ · ✓ · ✓ |
| Tokenizer · Storybook | 71.4 kB (0) · 17.1 kB CSS (0) | 2,128 (0) | ✓ · ✓ · ✓ |
Package size: @astryxdesign/core 6.26 MB packed (−257 B); no new dependencies.
API changes: core +3 · ~0 · −1
Committed API report behind this build: core 1 row; run pnpm api:report.
4 API changes (advisory)
| Package | Where | Signature | Usage | |
|---|---|---|---|---|
| + | core |
. · Components · component PowerSearch |
prop presentation?: PowerSearchPresentation = 'adaptive' |
<PowerSearch presentation="adaptive" /> |
| + | core |
. · Types · type PowerSearchPresentation |
type PowerSearchPresentation = AdaptivePresentation |
import type {PowerSearchPresentation} from '@astryxdesign/core' |
| + | core |
./PowerSearch · Also exported from an earlier entry point · PowerSearchPresentation |
PowerSearchPresentation (.) |
import {PowerSearchPresentation} from '@astryxdesign/core/PowerSearch' |
| − | core |
. · Components · component PowerSearch |
prop experimental?: { presentation?: 'popover' | 'bottom-sheet' | 'adaptive' } @experimental |
<PowerSearch experimental="popover" /> |
Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Requesting changes for one story; the graduation itself matches the approved PowerSearch record and the release rules for a [feat] prop plus a [breaking] default.
Blocking
- The
IssueTrackerstory inapps/storybook/stories/PowerSearch.stories.tsxpassesmenuWidth: 700withoutpresentation, so on a phone it now renders the sheet trigger and logs themenuWidthdevelopment warning; addpresentation: 'popover'to its args, as the Overflow stories do.
Also worth a look
- If
.changeset/powersearch-experimental-bottom-sheet.mdis still pending when this merges, its sentences "a PowerSearch that does not opt in does not carry it" and "omitting it keeps the stable behavior" will contradict the[breaking]entry in the same release notes.
After the fix, this still waits for main to declare a minor: pnpm check:changesets refuses the [breaking] Changeset while main declares 0.7.7, unless the graduation is split out as a patch first.
[Automated review]
| // `adaptive` resolves through the policy the selection controls share; an | ||
| // open flow keeps its presentation until it closes, so a resolution change | ||
| // mid-task cannot pull the surface out from under the person. |
There was a problem hiding this comment.
Non-blocking (comment style): this sentence carries two topics, restates what useAdaptivePresentation does, and ends in an idiom. A shorter version that keeps only the reason:
// An open flow keeps its presentation until it closes. A resolution change
// then cannot replace the surface during the task.6c6779f to
464f988
Compare
|
/approve-spec 464f988 |
There was a problem hiding this comment.
This looks ready on its own terms: the stable presentation prop and the adaptive default match the approved PowerSearch record, and the Issue Tracker story now pins presentation: 'popover', so it renders the same on a phone as before.
It still merges only once main declares a minor, because pnpm check:changesets refuses the [breaking] Changeset while main declares 0.7.7, unless the graduation is split out as a patch first. The earlier comment-style suggestion on PowerSearch.tsx line 609 still applies and is non-blocking.
[Automated review]
464f988 to
1fa08d2
Compare
|
/approve-spec 1fa08d2 |
1fa08d2 to
2063349
Compare
|
/approve-spec 2063349 |
2063349 to
70f5663
Compare
|
/approve-spec 70f5663 |
There was a problem hiding this comment.
Changes requested: the stable presentation prop, the deprecated alias and the codemod look right, but the adaptive default cannot ship as a [feat] patch.
.changeset/powersearch-presentation-stable.mdlabels theadaptivedefault[feat]in a patch, but it changes released phone behavior that callers can only keep by addingpresentation="popover"(as three stories in this pull request already do), whichspec:AST-017FR3, FR1 and FR6 classify as breaking and FR31 keeps out of a patch; ship the default in its own[breaking]Changeset for a declared minor, or graduate the prop with thepopoverdefault now, and reword the release-tier sentences in the record's Compatibility section and DEC-3.- The
@deprecatedtag onexperimental.presentation, the precedence warning and the threeexperimentaldoc entries name the replacement but notastryx upgrade, which FR29b requires when a migration command exists.
If touch defaults are meant to be patch-eligible, that is an amendment to spec:AST-017 itself; the Selector record still plans its identical default change as [breaking] for a minor. A non-blocking comment-style suggestion is inline.
[Automated review]
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [feat] PowerSearch's `presentation` prop is stable, and its default is `'adaptive'`. `presentation` takes `'popover' | 'bottom-sheet' | 'adaptive'`, typed by the new exported `PowerSearchPresentation`. The API change is additive: the prop is new and optional, no existing prop, type or export is removed or narrowed, and `experimental={{presentation: x}}` keeps working as a deprecated experimental alias that `astryx upgrade` rewrites to `presentation={x}`; when both are set, `presentation` wins and the field warns once in development. The behavior changes only on compact coarse-pointer screens (phones), which is what `'adaptive'` is for: there a PowerSearch with no `presentation` becomes one trigger with display-only filter tokens that opens the stacked Filters, Add filter and value sheets, a filter reaches `onChange` when its value step confirms, and `menuWidth` and `tokenOverflowBehavior` have no surface, with a development warning that names them. With a mouse or trackpad, on a screen that is not compact, in the server render and while hydrating, nothing changes. Pass `presentation="popover"` to keep the previous behavior on every device. Shipping this default in a patch is a product decision of the engineering owner, agreed with the owner of the compatibility policy. |
There was a problem hiding this comment.
Blocking: on a phone this default turns the combobox typeahead into a dialog trigger, menuWidth and tokenOverflowBehavior lose their surface, and focusTypeahead() focuses the trigger, so callers must add presentation="popover" to keep the released field. spec:AST-017 FR3 judges such a default under FR1 (breaking), FR6 rules out owner approval as a reason to call it nonbreaking, and FR31 keeps a breaking change out of a patch. Put the default in its own [breaking] Changeset for a declared minor, or keep popover as the default in this patch.
| * top-level `presentation` wins when both are set. | ||
| * @experimental | ||
| * @default 'popover' | ||
| * @deprecated Use the stable `presentation` prop. |
There was a problem hiding this comment.
spec:AST-017 FR29b asks every deprecation warning to name the migration command when one exists, and this pull request adds one. Suggested:
* @deprecated Use the stable `presentation` prop; `astryx upgrade` rewrites static uses.The precedence warning at line 614 and the three experimental entries in PowerSearch.doc.mjs need the same clause, as List.tsx and CodeBlock.tsx do.
| // `adaptive` resolves through the policy the selection controls share. An | ||
| // open flow keeps its presentation until it closes. A resolution change | ||
| // during a task does not replace the open surface. |
There was a problem hiding this comment.
Non-blocking (comment style): the first sentence restates what useAdaptivePresentation does, and the next two say one thing twice. A shorter version that keeps only the invariant:
// An open flow keeps its presentation until it closes, so a resolution
// change cannot replace the surface during a task.70f5663 to
237eda7
Compare
|
/approve-spec 237eda7 |
237eda7 to
3c61eba
Compare
|
/approve-spec 3c61eba |
There was a problem hiding this comment.
Approval waits on an engineering owner's decision about the release tier of the new adaptive default, and one code change is needed either way.
Owner decision needed: on a phone the default turns the combobox into a dialog trigger and stops menuWidth and tokenOverflowBehavior unless the caller adds presentation="popover", which spec:AST-017 FR3, FR1, FR6, FR25 and FR31 and architecture:public-component-api INV3 treat as a breaking default change for a declared minor, while this pull request ships it in a [feat] patch without amending them. An engineering owner either amends those records so a touch-presentation default with a presentation escape may ship in a patch and approves the amended head by commenting /approve-spec <full head SHA> (the author may do this as an engineering owner), or the default moves to a [breaking] Changeset for the next declared minor while presentation graduates with the popover default now.
Blocking:
packages/cli/assets/codemods/transforms/next/promote-powersearch-presentation.mjsrepeatspromote-tokenizer-presentation.mjsline for line except the component name and the spread placement, and the two already rewrite<X {...args} experimental={{presentation: ...}} />with opposite precedence, so move the transform into one shared helper that both codemods call with one spread rule.
[Automated review]
| * @param {import('../../../../authoring/codemod/type').CodemodTransformApi} api | ||
| * @returns {string | null | undefined} | ||
| */ | ||
| export default function transformer(file, api) { |
There was a problem hiding this comment.
Blocking: this transformer, with unwrap, keyName and addComment above it, repeats promote-tokenizer-presentation.mjs line for line except the component name and the spread placement below. The two already disagree: for <X {...args} experimental={{presentation: 'bottom-sheet'}} /> this copy writes presentation before the spread and Tokenizer's after it, although both components resolve presentationProp ?? experimental?.presentation. Please move the transform into one shared helper (for example promoteExperimentalPresentation(componentName)) that both codemods call with one spread rule, and delete the copy.
| // keeps its presentation until it closes, so a resolution change mid-task | ||
| // cannot pull the surface out from under the person. | ||
| const presentation = experimental?.presentation ?? 'popover'; | ||
| // An open flow keeps its presentation until it closes. |
There was a problem hiding this comment.
Non-blocking: this line now sits above the precedence code, and the latch comment a few lines below already says it. Suggest deleting it.
3c61eba to
5d33dd5
Compare
|
/approve-spec 5d33dd5 |
… default
PowerSearch's touch sheet flow graduates from `experimental.presentation`
to a stable top-level `presentation` prop (`'popover' | 'bottom-sheet' |
'adaptive'`, typed by the new exported `PowerSearchPresentation`), and an
omitted `presentation` resolves `adaptive`: the stacked filter sheets on a
compact coarse-pointer screen, and the tokenizer field with its editor
popover with a fine pointer, on a screen that is not compact, on the
server, and while hydrating.
`experimental.presentation` stays as a deprecated experimental alias; the
top-level prop wins when both are set, with one development warning. A
staged codemod rewrites a static `experimental={{presentation: x}}` to
`presentation={x}`. Stories that pass `menuWidth` or
`tokenOverflowBehavior`, which the sheet does not render, pin
`presentation="popover"`.
The default change is `[breaking]` under spec:AST-017 FR1, FR3, and FR31,
so it is held for a declared minor; the promotion is `[feat]`.
5d33dd5 to
957f8c9
Compare
|
/approve-spec 957f8c9 |
There was a problem hiding this comment.
Changes requested: the stable presentation prop is in good shape, and desktop and server output are unchanged, but the new adaptive default cannot ship in a [feat] patch under the current release rules.
.changeset/powersearch-presentation-stable.mdships theadaptivedefault as a[feat]patch, but on a phone it turns the field from a combobox into a dialog trigger and stopsmenuWidth,tokenOverflowBehaviorandfocusTypeahead()'s input focus unless callers addpresentation="popover", whichspec:AST-017FR3 and FR1 classify as breaking (FR6, FR25 and FR31 keep it out of a patch whilemaindeclares 0.7.8) andarchitecture:public-component-apiINV3 rules out for a new behavior prop; either graduate the prop with thepopoverdefault and moveadaptiveto a[breaking]Changeset for the next declared minor, as Selector's DEP-0011 and CLN-0020 do, or land an owner-approved change to those records first.- The commit message describes a deprecated
experimental.presentationalias, a staged codemod and a default held for a minor, none of which this diff contains, so please reword it to match the change.
The component:PowerSearch record changes are owner-approved; that approval does not change spec:AST-017 or INV3, which still govern the release tier.
[Automated review]
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [feat] PowerSearch gains a touch surface through a new `presentation` prop, `'popover' | 'bottom-sheet' | 'adaptive'`, typed by the new exported `PowerSearchPresentation`, with `'adaptive'` the default. `bottom-sheet` makes the whole field one trigger showing display-only filter tokens, and moves filter editing into a flow of tall modal sheets that stack: each step opens above the one that led to it, and dismissing a step reveals the one beneath, so no sheet has a Back action. A Filters sheet lists the active filters as rows that edit a filter, each with a trailing remove button, under a fixed header with Add filter and over a fixed footer with Clear all and Done; with no filter it shows one centered Add filter. Clear all asks for confirmation, removes the editable filters, keeps read-only ones, and leaves Filters open. An Add filter sheet lists the fields grouped (searchable from eight fields), or the content search with the field typeahead's suggestions listed inline, and leaves its search unfocused until tapped; a field whose only operator takes no value adds at once. A value step stages operator → value and confirms from its footer, the editor on the sheet's surface, or in muted sections beside the operator choice. Closed vocabularies are full-width rows, numbers stage as typed, and `string_list` / `entity_list` values edit through the Tokenizer's own sheet presentation titled with the field label. `adaptive` uses the sheet on compact coarse-pointer screens and the popover otherwise, resolved the same way Selector resolves it. The sheet flow loads on demand, only when a field presents it. New `@astryx.powersearch.sheet.*` catalog keys for the sheets' strings; no new theming target. |
There was a problem hiding this comment.
Blocking: on a phone this default turns the combobox into a dialog trigger, and menuWidth, tokenOverflowBehavior and focusTypeahead()'s input focus stop working unless the caller adds presentation="popover". spec:AST-017 FR3 judges such a default under FR1, FR6 says engineering approval does not make it nonbreaking, and FR25/FR31 keep a breaking change out of a patch while main declares 0.7.8. Suggest graduating presentation with the popover default here and moving the adaptive default to its own [breaking] Changeset for the next declared minor (as Selector's DEP-0011/CLN-0020 do), unless an owner-approved change to spec:AST-017 and INV3 lands first.
Owner ruling (engineering owner), agreed with the AST-017 owner: the stable presentation prop and its adaptive default ship as a [feat] patch. The API change is additive (a new optional prop; the unreleased experimental option is removed), the behavior change is limited to compact touch screens, and desktop and server output are unchanged; presentation="popover" keeps the inline field. The squash commit message is rewritten at merge to describe this diff (no alias, no codemod, no held default).
User need
On a phone, PowerSearch's editor popover and typeahead compete with the software keyboard. PowerSearch now ships its touch surface, the stacked filter sheets, behind a stable
presentationprop, andadaptiveis the default. A phone then gets the sheet flow without each caller opting in. A mouse, a trackpad, a screen that is not compact, the server render and hydration all keep today's tokenizer field and editor popover.Problem and solution fit
presentation?: 'popover' | 'bottom-sheet' | 'adaptive'is a top-level prop, typed by the new exportedPowerSearchPresentation(the selection controls' and Tokenizer'sAdaptivePresentation). The default is'adaptive'.experimental={{presentation: …}}(feat(core): PowerSearch touch sheet flow behind experimental.presentation #8001), and no release has carried it. This PR removes theexperimentalprop: there is no alias, no codemod and no precedence warning. Underspec:AST-017/FR22, removing an experimental surface needs no alias, and nobody has an upgrade to migrate.[experimental]Changeset from feat(core): PowerSearch touch sheet flow behind experimental.presentation #8001 is folded into this PR's[feat]Changeset. The next release then announces one thing: the touch sheet behind the stablepresentationprop, with theadaptivedefault.reftype.refreaches the root element in both presentations, so its type does not change.menuWidthandtokenOverflowBehaviorwarnings now namepresentation="popover"as the way to keep those props.PowerSearch.doc.mjs(en, zh, dense) documents the prop and its default, and its example showspresentation="popover". The stories usepresentationand drop "Experimental:" from their names (Bottom sheet (forced), Adaptive (default), Bottom sheet with content search, Bottom sheet states). The record makes DEC-3 a stable decision.api-report.mdis regenerated.Current specification
component:PowerSearch: DEC-3 (rewritten here), FR10, Compatibility and migration, and the INV16 paragraph. That paragraph already said: "anadaptivedefault is the stable-promotion decision, recorded then".spec:AST-017: FR3, FR22 and DEC-23.architecture:public-component-api: INV16.component:Selector: DEC-1, DEP-0011 and CLN-0020 are the precedent.Release tier: patch, by owner decision
One Changeset,
[feat], patch. The engineering owner ruled the change nonbreaking and ships it in a patch, and the owner ofspec:AST-017agrees. The record (Compatibility and migration, DEC-3) and the Changeset state the reasons:presentationprop is additive: it is new and optional. No existing prop, type or export is removed or narrowed.'adaptive': compact touch screens get the sheet flow. Desktop, fine pointers and server rendering are unchanged.presentation="popover"keeps the previous behavior everywhere.spec:AST-017.Precedent. Selector, MultiSelector, DropdownMenu (and MoreMenu), ContextMenu and Popover already ship a stable
presentationwith the same three values.component:SelectorDEC-1 also makesadaptivethe default, withpresentation="popover"as the way back. This PR follows the same shape.Internal consumers
menuWidthortokenOverflowBehavior.PowerSearchWithTable.storiesand the other PowerSearch storiestokenOverflowBehavior), and Issue Tracker (menuWidth, throughargs)popoverpopover, and the sheet's list editors ask forbottom-sheet. This PR does not change those lines.doc.mjsand the blocksEvidence: desktop and server unchanged
presentation="popover"andpresentation="adaptive".matchMediais a 1280×800 desktop with a fine pointer that hovers. Result:branch vs main (absent) diffs: [], every announcement sequence is equal, and main shows no self-variance. This ran at an earlier head; the popover code path has not changed since.PowerSearch.test.tsx,PowerSearchEditPopover.test.tsxandTokenizer.test.tsxare not edited. Their tests pass as on main.pointer: fine). The DOM is identical to main for all 31 comparable PowerSearch stories; the four renamed stories have no counterpart on main. Opening the default PowerSearch menu gives identical page markup.pointer: coarse, 390px). On main, the default PowerSearch story renders the tokenizer field. On this branch it renders the trigger, and a tap opens the "Add filter" sheet. The pinned "Overflow Inline" story stays a tokenizer field.renderToStringoutput is byte-identical to main for an empty PowerSearch and for one with filters andresultCount.PowerSearch.ssr.test.tsxruns the default with no prop. It server-renders the tokenizer field, hydrates with no recoverable error, and swaps to the trigger on a coarse client. A new case shows that the default's server markup equalspresentation="popover"'s.Bundle
The sizes come from the PR size report's measurer (gzip of the eager import), main at
7a8a648faagainst this branch.On current main, PowerSearch's eager chunks already include
SelectorBottomSheetandBottomSheet, through Selector. This PR does not change that.PowerSearchBottomSheetis not in PowerSearch's eager chunks.scripts/core-single-bundle.test.mjspasses.Scope
CodeBlockstartLineNumberline thatapi:reportregenerates on main is left out.Testing
internal/, adopters,slotPresence,touchTriggerTargets, the i18n PowerSearch end-to-end test, the CLI codemods, the CLI golden reads, experimental isolation and the single-bundle test: 173 files and 3,395 tests pass.pnpm typecheckpasses. It runs every workspace typecheck script, as CI does.check:changesets,check:syncandcheck:knowledgepass, andsync-exports --checkis up to date. Changeset coverage passes; this PR ships only to@astryxdesign/core.codemod-verify.mjshas nothing to verify, because no codemod changes.git diff --checkis clean.Overlap with open work
experimental.presentationand its codemod. This PR does not touch those files. Both PRs changeTokenizer.composites.test.tsxdifferently, though: this PR moves the test's PowerSearch topresentation, and the cleanup PR leaves that line alone.Writing rubric results
docs/specs/components/PowerSearch/PowerSearch.spec.md:popoverbehavior only to classify the change, and they state the release tier as the owners' product decision, which DEC-3 records with its reasons. Three stable-fix bullets and two date-gap sentences said "outside the experimental exception" or "outside this experimental option". They are reworded, because no experimental option governs the sheet. One older sentence said "so PowerSearch is now a component that composes Field"; it is rewritten in the present tense. The record no longer describes an experimental spelling.popoveras the default" was added. Two old lines were removed because this decision overturns them: an automatic switch without an opt-in, and a stable prop before consumer evidence.