Repository navigation
feat(ui): control metrics and tokens shared by buttons, dropdowns, search fields and tab strips - #1404
Merged
Conversation
Add QueryaControlSize (sm 28 / md 32 / lg 36 with font, icon, padding, gap and one radius) and QueryaControlScope. QueryaIconButton, QueryaToolbarButton, QueryaDropdown, QueryaSearchField and QueryaTabStrip take their height, radius and font from it; the dropdown tokens, the legacy density names and the tab height are expressed through the same numbers, so a row of one size has one height. Closes #1333.
This was referenced Oct 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1333 (part of epic #1331; implements the scale of #1332)
Problem
Control heights were defined in four places that did not agree:
QueryaIconButtonDensity(28 / 32),QueryaDropdownTokens(36 / compact 26),QueryaTabStrip(dense4 px vs 8 px vertical padding) andQueryaSearchField(a literal 32). A toolbar row had no common height by construction.Change
lib/core/ui/querya_control_tokens.dart:QueryaControlSizesm 28 / md 32 / lg 36withheight,horizontalPadding,fontSize,iconSize,iconGap, oneradius, andscaled*(context)throughuiScale;QueryaControlMetrics(the raw constants);QueryaControlScope, so a toolbar sets its size once.QueryaIconButton/QueryaToolbarButton: newsize;densitystays (nullable, no deprecation so existing call sites do not light up) and maps tosm/md. Without either: nearest scope, thenmd.QueryaDropdown: newsize;compactmeanssm; defaultlg.QueryaDropdownTokensconstants are expressed through the scale (triggerHeightis still 36, the compact trigger and rows go 26 -> 28).QueryaSearchField:heightis now optional, newsize; height, font, icon and radius from the scale (defaultmd= the old 32).QueryaTabStrip: newsize;densemeanssm; defaultlg. A tab isminHeightof its size and centres its content, instead of padding that depended on the font.Visible differences (intended)
QueryaToolbarButtonfont 11 / 12 -> 12 / 13 and padding 10 -> 12 atmd.uiScale(they did not before).Tests
test/core/ui/querya_control_tokens_test.dart: the numbers, monotonic growth, legacy density mapping, dropdown tokens built from the scale, scope resolution anduiScale.test/shared/widgets/querya_control_row_height_test.dart: a row of icon button, dropdown, search field and tab strip has one height for every size atuiScale1 and 1.25; a scope sets the size for children without one.Not run locally; CI is the check. Text-scale cases of the acceptance list are not covered yet.