Decisions: Global search
Append as you go, newest last. Record choices someone could reasonably question later, not every edit.
The field wrapper owns the border and focus ring
- Decision: the border, background and focus outline are on a wrapper (
.pds-global-search__field) that holds the input, the key hint and the send button. The<input>is borderless. - Why: the first version used PDS
TextInputand overrode its internal wrapper classes to get the merged box. That breaks silently when the class names change.Composersolves the same problem the same way. - Port impact: none. The field copies the TextInput frame tokens (
--pds-color-border-input,--pds-border-radius-input,--pds-spacing-input-height-m, focus outline).
Open state is one expanding box
- Decision: with the results showing, the field gets the focus-colored border on all sides except a grey divider under it, loses its bottom corners, and the results attach directly below with the same outline. No gap, no separate floating panel.
- Why: it is what the design shows ("the whole search expands"). A field with a floating panel read as two things.
- Port impact: none.
The component holds no data and no content
- Decision: it receives
groups, labels and states as props and reportsonQueryChange,onOptionSelect,onQuerySubmit,onOpenChange. It searches nothing and fetches nothing. - Why: PDS owns how things look and behave, not data or routing. The same component then serves the dashboard, a navbar, or a docs site.
- Port impact: the screen builds the groups and decides what a row does.
Choosing a row is a callback, not a link
- Decision:
onOptionSelect(option); the screen navigates. - Why: keeps the component router-agnostic and the listbox pattern simple.
- Port impact: open question: rows cannot be opened in a new tab.
BASwitchertakeslinkContentfor this; adding it here would make rows links.
Suggestions are one line, results are rich
- Decision: the component renders whatever each option carries. The screen passes only a label (and an action) for suggestions, and adds tags and a second line once there is a query.
- Why: matches the recording: suggestions are scannable names, results need context to tell similar things apart.
- Port impact: none.
Each row has its own action label, shown on the active row
- Decision:
actionLabelappears at the end of the active row;showActionAlwayskeeps it visible on every row of a suggestion list. - Why: the recording shows "Jump to" on every suggestion but only on the hovered result, and "Search" only on a hovered recent search.
- Port impact: none.
No results is the screen's call
- Decision:
noResultsTextrenders above the groups; the screen passes it only when nothing matched. Groups can still follow. - Why: the dashboard always offers the assistant, so "no groups" never means "no results". The first version tried to infer it and never showed the message.
- Port impact: none.
Loading keeps the current results
- Decision:
isLoadingwith no groups shows a spinner andloadingText; with groups it keeps them on screen and setsaria-busy. - Why: replacing the list on every keystroke makes it flash empty. Not in the recording; designed here.
- Port impact: none.
Scroll only for keyboard moves
- Decision: the active row scrolls into view only after an arrow key.
- Why: an initial
defaultActiveIdscrolled the whole page to the component, and hover-driven scrolling fights the mouse. - Port impact: none.
Send icon is an inline up arrow
- Decision: the send button draws an up arrow as inline SVG.
- Why: it is what the design shows. PDS has no
arrowUp;ComposerusespaperPlanethroughIconButton. - Port impact: swap to
IconButtonwith an icon once the open question is settled. Listed incustom.md.
Narrow containers lose the tags
- Decision: below 30rem of container width the tags hide and only the active row keeps its action.
- Why: a container query, not a viewport query, because the component can sit in a narrow column.
- Port impact: the 30rem value has no token (see
custom.md).
The Esc hint is a package Badge with a <kbd> inside
- Decision:
<Badge as='kbd' color='silver-muted' size='xs' label={translationStrings.escapeKey} />from the local Badge proposal replaces a hand-styled<kbd>. Updated 2026-11-20: it first nested a<kbd>in the package Badge's label; the Badge proposal now hasas='kbd', so the badge itself is the key. - Why: PDS has no keyboard-key component; the Badge is the closest. The package
Badgealways renders aspan, which is why the Badge proposal addsas. - Port impact: depends on the Badge proposal's
asprop. Open question: a real key component in PDS, for Composer and menu shortcut hints.
Type uses the pds-copy-* classes (2026-11-20)
- Decision: the input and the row (label,
option) usepds-copy-s(14px); the group heading, the quiet inline text, the second line and the action label usepds-copy-xs(12px); the loading, no-results and error messages usepds-copy-s. The hand-setfont-sizeand the input'sline-height: 1are gone. Weight stays a token on the inner element, because the classes force regular weight: the label is medium, and the heading text sits in its own span (__heading-text) at semibold. - Why: row labels had no size and inherited the page's 16px (2px larger than the input and the Menu Button's items), and most line heights came from the page, not a PDS token. The classes set family, size and line height (
--pds-typography-lh-m) together, as the other proposals do. Designer's call: label sizes, then all text on the classes. - Port impact: none. The look changes slightly: lines are now 150% (21px at 14px, 18px at 12px), so a row with a second line is a little taller than before.
The icon sits on the first line (2026-11-20)
- Decision: the row aligns its content to the top and the icon gets
margin-block-start: calc((1lh - 1em) / 2), so it is centered on the label line. The action label ("Jump to") stays centered on the whole row (align-self: center). - Why: with a second line and tags the icon was centered across both lines, away from the label (designer's call).
- Port impact: the offset assumes the icon is size
s, the same as the text (1em); a different icon size needs a different offset.lhis already used elsewhere in the package.
Opening eases in, with elevation (2026-11-20)
- Decision: on focus the backdrop fades in (
--pds-animation-duration-reveal, 300ms) and the results panel reveals with a fade and a small slide down (--pds-animation-duration-default, 200ms), both on--pds-animation-timing-function-default. The field also takes--pds-elevation-overlaywhile expanded (the panel already had it), so the open box has one lifted edge. The Default story now shows the backdrop. Closing is instant. All motion is off underprefers-reduced-motion. - Why: the box and the dim appeared at once, which felt abrupt, and only the results had a shadow (designer's request). Ease-in only keeps it CSS: the pieces are removed when closed, so an exit animation would need the component to stay mounted.
- Port impact: none. Two local keyframes (
global-search-fade,global-search-reveal) are listed incustom.md. The field and panel shadows are two elements, so the ring is drawn twice where they meet.
Dialog variant for the navigation bar (2026-11-20)
- Decision: one component, a new
variant(inlinedefault,dialog). The dialog variant renders a compact pill trigger (search icon, placeholder text, theshortcutkey as akbdBadge) and, when open, a dialog: a dimmed page, its own field (search icon,eschint), the same results panel scrolling in the middle, and a footer of key hints (arrows and Enter). No send button, sosubmitLabelbecame optional (dev warning ininlineonly).shortcut(for example/) is bound by the component with the package'suseKeyboardShortcut, so the hint and the key cannot drift apart (designer's call, 2026-11-20). Opening eases in: a fade and a scale from 0.98 from the top center. Closing is instant. - Why: from the designer's screen recording of the top-navigation search: the same rows, groups and keys, with a different shell. A separate component would copy all of that. The trigger, the dialog shell and the footer are the new parts.
- Port impact: adds
variantandshortcutand three optionaltranslationStringskeys (dialogLabel,navigateHint,selectHint). The shortcut hook is in the package already; no new dependency.
The dialog opens over the trigger (2026-11-20)
- Decision: the dialog is positioned against the component's root, not the page: its top edge is on the trigger's top edge and it is centered on the trigger (
position: absolute,inset-block-start: 0,inset-inline-start: 50%,translate: -50% 0), wider than the trigger (up to 40rem), covering it. The opening motion scales from the top center, so it grows out of the trigger's spot. Its own field row is 48px against the trigger's 32px, so its text sits a few pixels lower, as in the recording. - Why: a second pass over the recording showed it pops over the search's location. The first build was fixed to the page (40px from the top, centered on the screen), which only matched when the trigger happened to be there. Measured in Storybook: top and center deltas against the trigger are 0 and 0.
- Port impact: an ancestor with
overflow: hiddenor its own stacking context can clip or bury the dialog (it lives inside the root, not in a portal). The engineer may prefer a portal with the position taken from the trigger. Also, a trigger near a viewport edge would push the centered dialog off screen.
The backdrop counts as outside (2026-11-20)
- Decision: a click on the dimmed backdrop closes the results, in both variants.
- Why: the backdrop is inside the component's root, so the outside-click check treated it as inside and the results stayed open. It showed once the Default story turned the backdrop on.
- Port impact: none.
Open questions for the dialog
- Modal behavior: the dialog sets
aria-modaland returns focus to the trigger, but the page is not made inert and there is no focus trap (Tab closes it). Build on the PDS Modal instead? The engineer decides. - Is
/the shortcut in the product, and should it work everywhere? The hook ignores form fields and pauses while a PDS overlay is open. - Mobile: the dialog is at most full width minus a gutter, centered on the trigger; is a full-screen sheet wanted?
- Clipping: portal the dialog so a navigation bar with
overflow: hiddencannot cut it? - Typed results in the dialog (tags, second line) are assumed to match the inline variant; the recording did not show typing.
- The trigger is a pill 32px tall (
--pds-spacing-input-height-s) filling its container; the recording showed about 30px. Confirm the navigation bar's height.
Open questions
- Rows as links, for Cmd-click: Erika and the PDS team.
- What send does, and whether recent searches save: Erika, the product team.
- Send icon: Erika, the PDS team.
- A shared "field" primitive with Composer and TextInput: the PDS team.
- Test with VoiceOver and NVDA before porting: the engineer.