Skip to content

feat: support inputFont on inputs#545

Open
hcopp wants to merge 4 commits intomasterfrom
hunter/input-inputFont
Open

feat: support inputFont on inputs#545
hcopp wants to merge 4 commits intomasterfrom
hunter/input-inputFont

Conversation

@hcopp
Copy link
Contributor

@hcopp hcopp commented Mar 25, 2026

What changed? Why?

This PR enables extra customization of our inputs through

  • Custom font via inputFont
  • borderRadius on SearchInput
  • Updating heights to support more dynamic functionality based on font size

UI changes

iOS Old iOS New
image image
Web Old Web New
image 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

@hcopp hcopp self-assigned this Mar 25, 2026
@cb-heimdall
Copy link
Collaborator

cb-heimdall commented Mar 25, 2026

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/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 1/1
Denominator calculation
Additional CODEOWNERS Requirement
Show calculation
Sum 0
0
From CODEOWNERS 1
Sum 1

end,
startIconAccessibilityLabel = 'Back',
clearIconAccessibilityLabel = 'Clear text',
borderRadius = 1000,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also unlocking custom border radius for search input

export const scales = {
regular: 56,
compact: 40,
};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

SearchInput (at least on web) is still hardcoded with height, I believe this is already fixed in v9

@hcopp hcopp marked this pull request as ready for review March 25, 2026 18:36

return typeof singleValueContent === 'string' ? (
<Text align={align} color={hasValue ? 'fg' : 'fgMuted'} ellipsize="tail" font="body">
<Text align={align} color={hasValue ? 'fg' : 'fgMuted'} ellipsize="tail" font={inputFont}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Feels slightly funky to use inputFont here but this matches visually with the same spot on TextInput and Combobox.

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm yeah def funky naming for Select specifically - makes sense in the context of combobox

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could call it controlFont for Select and then map the property for combobox's NativeInput, any thoughts there?

Copy link
Contributor

Choose a reason for hiding this comment

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

@hcopp what about just font for Select? Could that work for Combobox too and we just document that it maps to both the values and text input elements? If they needed to break from that convention (seems uncommon) they could provide a custom component


return typeof singleValueContent === 'string' ? (
<Text align={align} color={hasValue ? 'fg' : 'fgMuted'} ellipsize="tail" font="body">
<Text align={align} color={hasValue ? 'fg' : 'fgMuted'} ellipsize="tail" font={inputFont}>
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm yeah def funky naming for Select specifically - makes sense in the context of combobox

* Typography font token used for typed search input text in select controls that render inputs.
* @default body
*/
inputFont?: ThemeVars.Font;
Copy link
Contributor

Choose a reason for hiding this comment

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

when should we be using ResponsiveProps? I'm worried we're kind of forgetting about this pattern. I believe font on its own as a styled prop is responsive

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could switch NativeInput from to which would unlock responsive props, however one nuance is that a few html built in props (like color) would have gone from accepting any normal CSS color value to ThemeColor. I don't see any uses of this in SourceGraph but could be an issue.

Do you think that is worth doing?

Copy link
Contributor

Choose a reason for hiding this comment

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

probably not worth the hassle - good call out on potentially breaking type change, but why can't you just do:

inputFont?: ResponsiveProps<ThemeVars.Font>; // i forgot the actual type name sorry!

Copy link
Contributor

Choose a reason for hiding this comment

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

tbh its not super important to me right now, im fine if youw ant to keep it as is but we should return to this topic in eng sync: props of type ThemeVars.X on web that dont match the behavior of their associated Style props

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.

3 participants