Skip to content

restyle facet dropdown to match figma#409

Open
sagrimson wants to merge 4 commits into
datacommonsorg:mainfrom
madebypxlp:scott/facet-design
Open

restyle facet dropdown to match figma#409
sagrimson wants to merge 4 commits into
datacommonsorg:mainfrom
madebypxlp:scott/facet-design

Conversation

@sagrimson

Copy link
Copy Markdown
Contributor

Overview

  • Updates the styles for the facet selector in chart cards.
  • adds tokens for facet selector colors
Screenshot 2026-07-16 at 3 23 25 PM Screenshot 2026-07-16 at 3 23 19 PM

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@sagrimson

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@sagrimson

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@nick-nlb nick-nlb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It looks good. Some comments (most small, but the biggest one, besides cross-component token usage, is about the possibility of a more generic select (with generic select tokens), that is worth discussion with Paulo, etc. Let me know what you think.

Another consideration is that when we have a single facet (and therefore an "inert" select box, it still looks like the select box should be clickable. This might be a discussion for design, but I think this should look and feel more "readonly" in this case.

@@ -28,14 +28,15 @@ export const FacetSelector = ({
if (!currentFacet || facets.length <= 1) {
return currentFacet ? (
<div className={clsx(s.label, s.container)}>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If there is only one facet, this combines label and container together on the same container, and so the container gets the transparent background intended for the label (rather than the container).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah very true, thanks!

&:not([data-is-selected="true"]) {
@include hover {
background: rgb(var(--color-control-accent) / 6%);
background: rgb(var(--color-button-accent-subtle-base-hover));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Here we are using the button token directly in another component (see the line in AGENTS.md).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed!

overflow: hidden;
background: rgb(var(--color-card-surface));
border-radius: var(--border-radius-small);
background: rgb(var(--color-facet-selector-surface));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

While this component is a facet selector, it feels like the underlying component is a custom select box that could be used more generally in other contexts.

What do you think of converting this into a generic Select (with the styling applied to it), and then FacetSelector would be a wrapping component that uses Select internally?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Totally agree, done!


"facet-selector-surface": "$card-surface",
"facet-selector-border": [196, 199, 197],
"facet-selector-color": "$card-content",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The token here is aliasing another components tokens.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed!

width: 100%;
padding: 12px 16px;
color: rgb(var(--color-facet-selector-color));
background: none;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is worth double-checking (i.e. are these already reset this way upstream), but are these restates of already existing resets? (see the frontend style guide about restating the reset)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done!

@sagrimson

Copy link
Copy Markdown
Contributor Author

It looks good. Some comments (most small, but the biggest one, besides cross-component token usage, is about the possibility of a more generic select (with generic select tokens), that is worth discussion with Paulo, etc. Let me know what you think.

Another consideration is that when we have a single facet (and therefore an "inert" select box, it still looks like the select box should be clickable. This might be a discussion for design, but I think this should look and feel more "readonly" in this case.

Thanks Nick, all feedback addressed! Totally agree on the select box, also sorry about all the token stuff, a little bit of a RTFM issue on my part 😳

I'll run the design question past Matt & see what he thinks. I agree it does seem like the single facet could use something to differentiate from the interactive dropdown

@sagrimson
sagrimson requested a review from nick-nlb July 17, 2026 18:50
@miss-o-soup

Copy link
Copy Markdown

I was not able to check on the facet new additions, but what I was hoping to have is the text centered with the facet info, and when there are many more facets to have a chevron (with the proper hover over behaviour and all that).
34cpUE5puLH4XV4

@sagrimson
sagrimson force-pushed the scott/facet-design branch from a670c82 to fa59581 Compare July 17, 2026 22:16
@sagrimson
sagrimson force-pushed the scott/facet-design branch from fa59581 to a3fbca5 Compare July 17, 2026 22:28
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