Skip to content

perf(ui): eliminate speculative layout overhead from IntrinsicWidth in QueryaTabStrip #1342

Description

@ZhuchkaTriplesix

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

  1. Avoid wrapping in IntrinsicWidth when the parent provides bounded horizontal constraints (constraints.hasBoundedWidth), using a LayoutBuilder or relying on parent Expanded / Flexible.
  2. Alternatively, use a custom layout delegate or flexible row sizing without speculative layout passes.

Acceptance Criteria

  • Speculative intrinsic layout pass is eliminated for tab strips inside bounded parents (SqlQueryTabBar, GenericTableView, etc.).
  • test/widgets/querya_tab_strip_test.dart passes without flex overflows or layout regressions.

Activity

  1. added
    frontendTheme parser epic label: frontend
    performanceTheme parser epic label: performance
    uiUser interface components and widgets
    P2Medium priority / Parity & Refactoring
    on Oct 10, 2026
  2. ZhuchkaTriplesix commented on Oct 11, 2026

    @ZhuchkaTriplesix
    MemberAuthor

    Done in #1428.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium priority / Parity & RefactoringfrontendTheme parser epic label: frontendperformanceTheme parser epic label: performanceuiUser interface components and widgets

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions