Skip to content

feat(ui): QueryaButton on Flutter primitives, no shadcn - #1406

Merged
ZhuchkaTriplesix merged 1 commit into
issue/1333-control-metrics-tokensfrom
issue/1334-querya-button
Oct 10, 2026
Merged

ZhuchkaTriplesix merged 1 commit into
issue/1333-control-metrics-tokensfrom
issue/1334-querya-button

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Closes #1334 (part of epic #1331)

Stacked on #1404 (control metrics, issue/1333-control-metrics-tokens): this PR targets that branch so the diff shows only the button. Once #1404 is merged, retarget to dev (or merge #1404 first and GitHub will do it).

What

lib/shared/widgets/querya_button.dart, exported from widgets.dart, with no shadcn_flutter import:

QueryaButton.primary(label: 'Save', onPressed: _save)
QueryaButton.secondary(label: 'Explain', icon: Icons.account_tree_outlined, onPressed: _explain)
QueryaButton.ghost(label: 'Cancel', onPressed: _close)
QueryaButton.destructive(label: 'Delete', onPressed: _delete)
QueryaButton.secondary(label: 'Rollback', tone: QueryaButtonTone.destructive, ...)  // red text
QueryaButton.icon(icon: Icons.refresh, tooltip: 'Refresh', onPressed: _reload)

Common parameters: size (default from QueryaControlScope, then md), icon, trailing, shortcutHint, loading, tooltip, isActive, compact, autofocus, semanticLabel.

  • States: hover / pressed tints, keyboard-only focus ring (FocusableActionDetector.onShowFocusHighlight, drawn as a foreground decoration so it never shifts layout), disabled (50 %), loading (spinner in the icon's place, or over the hidden label, width kept; not pressable), selected (isActive).
  • Colours from context.workbench and the theme foreground; transitions use QueryaMotion (instant under reduced motion).
  • Keyboard: Enter and Space activate; semantics: button, label, enabled, selected, hint while loading.
  • Layout: the label is one line and ellipsizes; icon-only is square; height / padding / font / icon from QueryaControlSize.

Not in this PR

Tests

test/shared/widgets/querya_button_test.dart: tap, disabled and loading do not fire, Enter / Space activate, height per size, icon-only is square, compact keeps the label as tooltip, loading keeps width, long label ellipsizes without overflow, tooltip delay is kQueryaTooltipWait, semantics flags, and a source guard that the file imports no shadcn_flutter.

Not run locally; CI is the check.

primary / secondary / ghost / destructive plus an icon-only constructor,
sized by QueryaControlSize, with hover / pressed / keyboard-focus ring /
disabled / loading states from the workbench, Enter and Space activation,
non-wrapping label, and button semantics. Closes #1334.
@github-actions github-actions Bot added enhancement New feature or request frontend Theme parser epic label: frontend accessibility Reduced motion, OS accessibility preferences ui User interface components and widgets ux User experience, keyboard shortcuts and interactions P1 High priority / Core capability labels Oct 10, 2026
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit a0016d2 into issue/1333-control-metrics-tokens Oct 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility Reduced motion, OS accessibility preferences enhancement New feature or request frontend Theme parser epic label: frontend P1 High priority / Core capability 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