Skip to content

Conversation

@haoruikun-cb
Copy link
Contributor

What changed? Why?

Refactor Select to use theme token for min height, so it can react to ThemeProvider changes like TextInput.

Root cause (required for bugfixes)

UI changes

iOS Old iOS New
old screenshot image
Android Old Android New
old screenshot new screenshot
Web Old Web New
old screenshot image

Testing

How has it been tested?

  • Unit tests
  • Interaction tests
  • Pseudo State tests
  • Manual - Web
  • Manual - Android (Emulator / Device)
  • Manual - iOS (Emulator / Device)

Testing instructions

Illustrations/Icons Checklist

Required if this PR changes files under packages/illustrations/** or packages/icons/**

  • verified visreg changes with Terran (include link to visreg run/approval)
  • all illustration/icons names have been reviewed by Dom and/or Terran

Change management

type=routine
risk=low
impact=sev5

automerge=false

@cb-heimdall
Copy link
Collaborator

cb-heimdall commented Jan 21, 2026

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 1
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1
CODEOWNERS 🟡 See below

🟡 CODEOWNERS

Code Owner Status Calculation
ui-systems-eng-team 🟡 0/1
Denominator calculation
Additional CODEOWNERS Requirement
Show calculation
Sum 0
0
From CODEOWNERS 1
Sum 1

const LABEL_VARIANT_INSIDE_HEIGHT = 32;
const COMPACT_HEIGHT = 40;
const DEFAULT_HEIGHT = 56;
const LABEL_VARIANT_INSIDE_HEIGHT = 'var(--space-4)';
Copy link
Contributor

Choose a reason for hiding this comment

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

@haoruikun-cb won't the values be string instead of number now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is fine since HStack minHeight props takes in either number or string

const DEFAULT_HEIGHT = 56;
const LABEL_VARIANT_INSIDE_HEIGHT = 'var(--space-4)';
const COMPACT_HEIGHT = 'var(--space-5)';
const DEFAULT_HEIGHT = 'var(--space-7)';
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm nervous for how this approach would act in cases where spacing is increased.

If their unit spacing = 12px but their fonts stay the same the input would be too large now.

It still could very well likely be an improvement over the current approach, I'm not sure how the current min height code would act.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Having larger spacing works. They can also have larger font size for theme. It will be up to the customer what config they want. I added a larger Select theme example and ut
image

Copy link
Contributor

Choose a reason for hiding this comment

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

Image

This example with spacing is smaller (1 space = 4px) our min height is 28px but we get 36px. So even though our min height doesn't match it is still the correct size.

When we have larger spacing (1 space = 16px) our min height is 112px but yet it should be 72 based on this inner Select sizing.

Image Image

So we are off however the output isn't too bad I suppose

Image

When comparing this with TextInput though, they only align correctly at the default spacing (and when labelVariant does not equal inside hmm)

Image

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe we should get rid of minHeight and focus on the intrinsic size of the component, even setting min height to 0 didn't work in my tests, the padding seemed too small for default case.

Image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah you are right. Let me investigate how we can refactor this to fix the intrinsic height.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants