Skip to content

fix(ui): let a Select's and a DatePicker's Style reach their field's height and type - #721

Merged
houko merged 2 commits into
nsgo-dev:mainfrom
Session500:feat/select-size
Nov 18, 2026
Merged

houko merged 2 commits into
nsgo-dev:mainfrom
Session500:feat/select-size

Conversation

@Session500

@Session500 Session500 commented Nov 18, 2026 •

Copy link
Copy Markdown

Summary

Select.Style and DatePicker.Style are documented as "merges over the field's", but they only reached the view around the field. The field kept a fixed 28 pt height and the body's 13 pt type. So the way the docs give for a smaller Input, Style: core.Style{Height: core.Pt(ui.SizeSmall.Height()), FontSize: 12}, did nothing for a select. A select therefore could not line up with a SizeSmall button in a dense row, even though "controls line up without an app choosing" is the reason most components have one size (themes).

The picker's Style is now split the way an Input takes its own (pickerStyle):

  • its height, padding and type go to the field, merged over its look;
  • the rest lays out the view around it, still 200 pt wide unless it sets a width.

Select and DatePicker share the field (pickerField), so both are fixed. This adds no new API. Fields stay without a Size, as Input has none, and the change records that rule in themes.md.

The default look is unchanged. A caller that set Padding on a select's Style now pads the field instead of the view around it. That is what the documentation already said; no caller in this repository sets it.

Found in an app's settings: a select sits in a row's 11 pt subtitle line and could not be made smaller than the standard field.

Targets

  • Shared code (core, base, ui, tsx, the nsgo tool)
  • Docs or website only (the Select page in English and Chinese, themes.md)

Screenshots

None for the default look, which is unchanged. Only a Style that sets a height or type changes the field. TestPickerStyle measures it on desktop and phone, light and dark:

  • a 160 × 24 pt field with 12 pt text, where the same Style gave 160 × 28 with 13 pt text before;
  • a field with no style stays 28 pt with the body's type.

Verification

  • go tool nsgo check
  • go tool nsgo test: 2913 passed. 4 failed, all for Xcode tools this machine lacks, not this change: TestTVBrandAssets and TestCompileBrandAssets (xcrun actool --version exits 72), TestStoreKitCompile and TestWidgetsCompile (no iphonesimulator SDK).
  • go tool nsgo test -target <target>: not run on device targets. The change is shared ui layout, and the new test runs in each's desktop and phone environments.

Checklist

  • The title is a Conventional Commit.
  • Docs whose facts change are updated, and CHANGELOG.md's Unreleased has a line.
  • No new third-party code, assets or dependencies.

🤖 Generated with Claude Code

SenZhangAI and others added 2 commits November 19, 2026 03:04
…height and type

Their Style was documented as merging over the field's, but it only reached
the view around the field, which kept a fixed 28 pt height and the body's
type. The docs' way to make an Input smaller, a Style with SizeSmall's height
and 12 pt type, did nothing for a select, so a select could not line up with
a SizeSmall button in a dense row.

A picker's Style is now split as an Input takes its own: its height, padding
and type go to the field, and the rest lays out the view around it, still
200 pt wide unless it sets a width. Fields keep no Size, which themes.md now
says.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown

Thanks for your first pull request! Before it is merged:

  • Write the title as a Conventional Commit, such as fix(linux): ...; a squash merge uses it as the commit subject.
  • Run go tool nsgo check and go tool nsgo test, and say in the description what you ran on which targets and what you could not.
  • Making a change says what a pull request needs, and AGENTS.md and ARCHITECTURE.md how the code is organized.

@github-actions github-actions Bot added bug Something isn't working size/S documentation Improvements or additions to documentation ui labels Nov 18, 2026
@houko

houko commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Thanks, this looks right. Splitting the picker's Style the way Input takes its own matches the docs' "merges over the field's", and since TestID lands on the trigger, TestPickerStyle measures the field itself: on main the same Style gives a 28 pt field with 13 pt text, so the test catches the bug. The default look is unchanged, and moving Padding from the wrapper to the field is what the doc comment already promised.

The apple job failed on TestCanvasImageCacheKeepsAWidePass ("128 cached after later passes"), a known flake tracked in #715 that this change cannot reach; I re-ran it.

@houko
houko merged commit 5526c81 into nsgo-dev:main Nov 18, 2026
29 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation size/S ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants