Skip to content

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

Merged
ZhuchkaTriplesix merged 3 commits into
devfrom
issue/1334-querya-button
Oct 11, 2026
Merged

ZhuchkaTriplesix merged 3 commits into
devfrom
issue/1334-querya-button

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Closes #1334 (part of epic #1331)

Replaces #1406, which was merged into the #1404 branch after #1404 had already gone to dev, so the button never reached dev and never ran CI (the workflow only runs for PRs into main / dev). Same commit, now targeting dev.

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)
  • Parameters: size (default from QueryaControlScope, then md), icon, trailing, shortcutHint, loading, tooltip, isActive, compact, autofocus, semanticLabel, tone.
  • States: hover / pressed tints, keyboard-only focus ring (foreground decoration, no layout shift), disabled, loading (width kept, not pressable), selected.
  • Enter / Space activate; semantics button, label, enabled, selected.
  • One-line ellipsizing label, square icon-only, sizes from QueryaControlSize, colours from the workbench, motion from QueryaMotion.

Not in this PR

QueryaActionButton is untouched (own tests, 17 call sites; swapped during the migration), QueryaSplitButton / QueryaMenuButton / QueryaDialogActions are #1335.

Tests

test/shared/widgets/querya_button_test.dart: activation by tap / Enter / Space, disabled and loading do not fire, height per size, icon-only square, compact tooltip, loading keeps width, long label without overflow, tooltip delay, semantics, and a 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
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