Skip to content

feat(ui): QueryaButton: primary / secondary / ghost / destructive on Flutter primitives, no shadcn #1334

Closed

Description

@ZhuchkaTriplesix

Part of #1331. Needs the standard and the metrics issues.

Scope

lib/shared/widgets/querya_button.dart, exported from widgets.dart:

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)                       // filled
QueryaButton.secondary(label: 'Rollback', tone: QueryaButtonTone.destructive, ...)  // red text
QueryaButton.icon(icon: Icons.refresh, tooltip: 'Refresh', onPressed: _reload)      // = QueryaIconButton

Common parameters: size (sm / md / lg, default from QueryaControlScope), icon, trailing, shortcutHint, loading, tooltip, isActive, compact (icon-only on narrow toolbars, label becomes the tooltip), autofocus, semanticLabel.

  • Built on Focus + MouseRegion + GestureDetector / InkResponse, no shadcn_flutter import.
  • States and colours exactly as in the standard (hover / pressed / keyboard focus ring / disabled / loading / selected); colours from context.workbench; motion from QueryaMotion, instant under reduced motion.
  • Loading reserves the width of the label; the spinner is QueryaSpinner of the matching size.
  • Keyboard: Enter and Space activate, focus ring only for keyboard focus; semantics: button, label, enabled, busy.
  • QueryaActionButton stays as a thin deprecated wrapper so the migration can go file by file.

Acceptance

  • All variants x sizes x states render per the standard in every built-in theme and in a VS Code-imported one.
  • Label never wraps; at 150 % text scale it ellipsizes without overflow; icon-only is square.
  • No shadcn type in the file's imports.
  • Widget tests: activation by pointer / Enter / Space, disabled and loading do not fire, tooltip delay is kQueryaTooltipWait.

Activity

  1. added
    enhancementNew feature or request
    frontendTheme parser epic label: frontend
    accessibilityReduced motion, OS accessibility preferences
    uiUser interface components and widgets
    uxUser experience, keyboard shortcuts and interactions
    P1High priority / Core capability
    on Oct 10, 2026
  2. ZhuchkaTriplesix commented on Oct 11, 2026

    @ZhuchkaTriplesix
    MemberAuthor

    Done in dev: QueryaButton and its variants (#1417 onwards), QueryaActionButton wrapper removed in #1454.

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

    P1High priority / Core capabilityaccessibilityReduced motion, OS accessibility preferencesenhancementNew feature or requestfrontendTheme parser epic label: frontenduiUser interface components and widgetsuxUser experience, keyboard shortcuts and interactions

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions