Skip to content

feat(ui): QueryaMenuButton, QueryaSplitButton and QueryaDialogActions - #1417

Merged
ZhuchkaTriplesix merged 3 commits into
devfrom
issue/1335-split-menu-dialog-actions
Oct 11, 2026
Merged

ZhuchkaTriplesix merged 3 commits into
devfrom
issue/1335-split-menu-dialog-actions

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Part of #1335 / epic #1331. Builds on QueryaButton (#1408, in dev) and the control scale (#1404).

What

The compositions the review found hand-assembled, all without a shadcn_flutter import:

  • QueryaMenuButton<T>: a QueryaButton with a trailing chevron that opens a menu; isActive while open; the same popup surface as QueryaDropdown (shared in querya_menu_surface.dart). Replaces the trigger of QueryaActionMenu / ExportMenuButton.
  • QueryaSplitButton<T>: a main action and a chevron half as one control: one clip and radius, equal height, a 1 px divider instead of a gap, a tooltip per half, loading disables both. A secondary variant draws one outline around both halves.
  • QueryaDialogActions: the footer of the standard: cancel (ghost) first, secondary actions, then one main action (primary or destructive), lg, 8 apart, right-aligned under a divider. Debug asserts: not both main actions, and each slot has its variant. Esc runs cancel inside the footer; QueryaDialogActions.bindings(...) gives the Esc / Enter map for a dialog-level CallbackShortcuts.

QueryaButton gets what they need: a public general constructor (variant: as a parameter), a borderRadius override (the halves of a split button square their inner corners), and an IconTheme so a trailing icon takes the button's colour and size.

Not in this PR

Tests

  • querya_menu_and_split_button_test.dart: open and pick, same height as a button, disabled does not open, Enter on the focused trigger opens; split: main runs, chevron opens and picks (main not run), both halves have the control height, loading disables both, only a 1 px divider between halves.
  • querya_dialog_actions_test.dart: order, lg height and 8 px spacing, right alignment, Esc runs cancel, bindings for Esc / Enter and not for a disabled or loading main action, both-main-actions assertion, wrong-variant cancel rejected in debug.

Not run locally; CI is the check.

Compositions of QueryaButton that the review found hand-assembled: a button
that opens a menu, a primary action with a menu chevron as one control (one
outline, equal height, divider instead of a gap), and the dialog footer with
the standard order, spacing, lg size and a single main action enforced in
debug. QueryaButton gets a public general constructor and a radius override.
Closes #1335 (without QueryaButtonGroup).
@github-actions github-actions Bot added enhancement New feature or request frontend Theme parser epic label: frontend ui User interface components and widgets ux User experience, keyboard shortcuts and interactions P2 Medium priority / Parity & Refactoring labels Oct 11, 2026
…no scope

QueryaButton asserted on a missing QueryaThemeScope, which dialogs built under
a bare app (and their tests) do not have. workbenchOrDefault falls back to the
defaults for the ambient brightness; the scheme comes from context.colors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request frontend Theme parser epic label: frontend P2 Medium priority / Parity & Refactoring ui User interface components and widgets ux User experience, keyboard shortcuts and interactions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant