Problem
In lib/shared/widgets/querya_tab_strip.dart, the entire tab strip is wrapped in an IntrinsicWidth:
return material.IntrinsicWidth(
child: material.Listener(
...
child: material.ScrollConfiguration(
behavior: const material.ScrollBehavior().copyWith(scrollbars: false),
child: material.SingleChildScrollView(
controller: _effectiveScrollController,
scrollDirection: material.Axis.horizontal,
child: stripContent,
),
),
),
);
IntrinsicWidth forces Flutter to execute a speculative pre-pass layout over every tab label, key, icon, and button to calculate their intrinsic min/max widths. When nested or placed in deep component hierarchies (e.g. inside Expanded in SqlQueryTabBar, GenericTableView, ResultsTab, ErdView), this creates redundant (N)$ layout passes on every frame and rebuild.
Code Location
lib/shared/widgets/querya_tab_strip.dart (lines 370–398)
UI Kit Relationship
Proposed Solution
- Avoid wrapping in
IntrinsicWidth when the parent provides bounded horizontal constraints (constraints.hasBoundedWidth), using a LayoutBuilder or relying on parent Expanded / Flexible.
- Alternatively, use a custom layout delegate or flexible row sizing without speculative layout passes.
Acceptance Criteria
Problem
In
lib/shared/widgets/querya_tab_strip.dart, the entire tab strip is wrapped in anIntrinsicWidth:IntrinsicWidthforces Flutter to execute a speculative pre-pass layout over every tab label, key, icon, and button to calculate their intrinsic min/max widths. When nested or placed in deep component hierarchies (e.g. insideExpandedinSqlQueryTabBar,GenericTableView,ResultsTab,ErdView), this creates redundant (N)$ layout passes on every frame and rebuild.Code Location
lib/shared/widgets/querya_tab_strip.dart(lines 370–398)UI Kit Relationship
QueryaTabStripis an exported UI Kit component (lib/shared/widgets/widgets.dart,docs/ui-kit.md).feat(ui): control metrics and tokens shared by buttons, dropdowns, search fields and tab stripsunder epic epic(ui): buttons in the Querya UI kit: one control scale, our own button family, no shadcn buttons #1331), which standardizesQueryaControlSizeacross tab strips.IntrinsicWidthwas originally introduced in fix(tabs): wrap QueryaTabStrip in horizontal scrollable and preserve GlobalKeys on tab count change #898 / PR fix(tabs): wrap QueryaTabStrip in horizontal scrollable and preserve GlobalKeys on tab count change #957 to prevent unbounded horizontal scroll flex overflow when placed inside unconstrained rows. However, wrapping the entire scrollable inIntrinsicWidtheven when parent constraints are already bounded introduces an unnecessary layout performance penalty.Proposed Solution
IntrinsicWidthwhen the parent provides bounded horizontal constraints (constraints.hasBoundedWidth), using aLayoutBuilderor relying on parentExpanded/Flexible.Acceptance Criteria
SqlQueryTabBar,GenericTableView, etc.).test/widgets/querya_tab_strip_test.dartpasses without flex overflows or layout regressions.