Skip to content

feat(search): minimized search #4115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: spectrum-two
Choose a base branch
from

Conversation

aramos-adobe
Copy link
Contributor

@aramos-adobe aramos-adobe commented Aug 6, 2025

Description

The search component allows for a minimized state where the search field is collapsed to an action button. When clicked the the search field is visible.

How and where has this been tested?

Please tag yourself on the tests you've marked complete to confirm the tests have been run by someone other than the author.

Validation steps

Include steps for the PR reviewer that explain how they should test your PR. Example test outline:

  1. Open the storybook for the search component:
  • Check true is collapsed state (@cdransf)
  • Click the action button to show the search field (@cdransf)

Regression testing

Validate:

  1. The documentation pages for at least two other components are still loading, including:
  • The pages render correctly, are accessible, and are responsive.
  1. If components have been modified, VRTs have been run on this branch:
  • VRTs have been run and looked at.
  • Any VRT changes have been accepted (by reviewer and/or PR author), or there are no changes.

Screenshots

To-do list

  • I have read the contribution guidelines.
  • I have updated relevant storybook stories and templates.
  • I have tested these changes in Windows High Contrast mode.
  • If my change impacts other components, I have tested to make sure they don't break.
  • If my change impacts documentation, I have updated the documentation accordingly.
  • ✨ This pull request is ready to merge. ✨

Copy link

changeset-bot bot commented Aug 6, 2025

🦋 Changeset detected

Latest commit: 3579e94

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@spectrum-css/search Major
@spectrum-css/bundle Patch
@spectrum-css/preview Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Aug 6, 2025

File metrics

Summary

Total size: 1.44 MB*
Total change (Δ): 🟢 ⬇ 0.13 KB (-0.01%)

Table reports on changes to a package's main file. Other changes can be found in the collapsed Details section below.

Package Size Minified Gzipped Δ
alertbanner 6.43 KB 6.17 KB 1.41 KB 🔴 ⬆ 0.39 KB
assetcard 15.96 KB 15.21 KB 2.25 KB 🔴 ⬆ 0.13 KB
card 16.20 KB 15.23 KB 2.53 KB 🔴 ⬆ 0.13 KB
coachmark 7.66 KB 7.29 KB 1.55 KB -
combobox 27.43 KB 26.34 KB 3.20 KB 🔴 ⬆ 0.16 KB
dial 10.80 KB 10.14 KB 1.91 KB -
page 0.89 KB 0.88 KB 0.50 KB 🟢 ⬇ 0.07 KB
search 12.93 KB 12.38 KB 2.06 KB 🔴 ⬆ 0.48 KB
sidenav 14.44 KB 13.79 KB 2.23 KB -
stepper 28.53 KB 27.46 KB 3.02 KB 🔴 ⬆ 0.50 KB
treeview 17.53 KB 16.58 KB 2.40 KB -

File change details

alertbanner

Filename Head Minified Gzipped Compared to base
index.css 6.43 KB 6.17 KB 1.41 KB 🔴 ⬆ 0.39 KB
metadata.json 3.66 KB - - 🔴 ⬆ 0.05 KB

assetcard

Filename Head Minified Gzipped Compared to base
index.css 15.96 KB 15.21 KB 2.25 KB 🔴 ⬆ 0.13 KB
metadata.json 8.89 KB - - -

card

Filename Head Minified Gzipped Compared to base
index.css 16.20 KB 15.23 KB 2.53 KB 🔴 ⬆ 0.13 KB
metadata.json 7.62 KB - - 🔴 ⬆ 0.10 KB

coachmark

Filename Head Minified Gzipped Compared to base
index.css 7.66 KB 7.29 KB 1.55 KB -
metadata.json 4.55 KB - - -

combobox

Filename Head Minified Gzipped Compared to base
index.css 27.43 KB 26.34 KB 3.20 KB 🔴 ⬆ 0.16 KB
metadata.json 16.62 KB - - 🔴 ⬆ 0.16 KB

dial

Filename Head Minified Gzipped Compared to base
index.css 10.80 KB 10.14 KB 1.91 KB -
metadata.json 4.57 KB - - -

page

Filename Head Minified Gzipped Compared to base
index.css 0.89 KB 0.88 KB 0.50 KB 🟢 ⬇ 0.07 KB
metadata.json 0.36 KB - - -

search

Filename Head Minified Gzipped Compared to base
index.css 12.93 KB 12.38 KB 2.06 KB 🔴 ⬆ 0.48 KB
metadata.json 7.42 KB - - 🔴 ⬆ 0.07 KB

sidenav

Filename Head Minified Gzipped Compared to base
index.css 14.44 KB 13.79 KB 2.23 KB -
metadata.json 8.59 KB - - -

stepper

Filename Head Minified Gzipped Compared to base
index.css 28.53 KB 27.46 KB 3.02 KB 🔴 ⬆ 0.50 KB
metadata.json 14.06 KB - - 🔴 ⬆ 0.14 KB

treeview

Filename Head Minified Gzipped Compared to base
index.css 17.53 KB 16.58 KB 2.40 KB -
metadata.json 8.40 KB - - -

tokens

Filename Head Minified Gzipped Compared to base
css/dark-vars.css 46.16 KB - - -
css/global-vars.css 86.41 KB - - 🟢 ⬇ 0.05 KB
css/index.css 267.52 KB - - 🟢 ⬇ 0.06 KB
css/large-vars.css 45.18 KB - - 🟢 ⬇ 0.01 KB
css/light-vars.css 46.15 KB - - -
css/medium-vars.css 45.36 KB - - 🟢 ⬇ 0.01 KB
json/raw.json 2.98 MB - - 🟢 ⬇ 0.05 KB
json/tokens.json 465.34 KB - - 🟢 ⬇ 0.13 KB
* Size is the sum of all main files for packages in the library.
* An ASCII character in UTF-8 is 8 bits or 1 byte.

Copy link
Contributor

github-actions bot commented Aug 6, 2025

📚 Branch preview

PR #4115 has been deployed to Azure Blob Storage: https://spectrumcss.z13.web.core.windows.net/pr-4115/index.html.

@aramos-adobe aramos-adobe self-assigned this Aug 6, 2025
Copy link
Member

@cdransf cdransf left a comment

Choose a reason for hiding this comment

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

Looks great! ✨

Copy link
Collaborator

@marissahuysentruyt marissahuysentruyt left a comment

Choose a reason for hiding this comment

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

Nice work on this. I feel like I still mainly have questions, so I left a few for you 😊

I might consider just updating the changeset heading to "Collapsed" instead of "Minimized." Just personal preference though.

Have you reached out to design to ask about some of the focus and keyboard focus behaviors? I found the collapsed usage section in Figma, and the "focus state" of this button is just...open? That feels odd to me for some reason. Like if I was tabbing along, does it make sense for me to tab to this action button, and then it just be a completely different component? Anyways, I think this is more along the lines that I would expect, where I'm tabbing along, and I have to trigger the rest of the search field to open. I may be wrong though. Is that worth bringing up with design?


### Anatomy

The collapsed state consists of a single action button that only has a hover and disabled state. This state is triggered by the `is-collapsed` class on the search component. When the search field is in this state, the textfield is hidden and the search button is displayed. The button can be hovered and focused, and will expand the search field when clicked.
Copy link
Collaborator

Choose a reason for hiding this comment

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

since we added keyboard focus back in, can we update this first sentence just a touch so that it doesn't say that it "only" has hover and disabled states? You mention focus later in the paragraph, even if you decide not to change it. 👍


/* Animation for collapsible search expansion */
&.is-collapsed {
transition: inline-size 0.3s cubic-bezier(0.4, 0, 0.2, 1);
Copy link
Collaborator

Choose a reason for hiding this comment

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

how would you feel about maybe using of any of the --spectrum-animation-duration-* tokens? Maybe we can use that here? Or was the 0.3 design directed? And just because I'm nosy, where did you find these timing curves?!

Should the cubic-beziers and even the transition-duration be set as custom props? Maybe it's not necessary, but we do use the same curve & durations twice 🤷‍♀️

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.

3 participants