feat(flutterbits): canonical Button + apps/gallery (first component slice)#45
Merged
Conversation
Adds ButtonVariant and ButtonSize enums, the minimal Button StatefulWidget skeleton (Semantics wrapper, no styling yet), and the first behavior test asserting label rendering and button/enabled semantics flags. Adapts plan's test to Flutter 3.41.9 API (flagsCollection on SemanticsData, Tristate from dart:ui — hasFlag was deprecated after v3.32.0). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add FocusableActionDetector with Enter/Space → ActivateIntent wiring so the Button activates from the keyboard. Adds focusNode param for external focus control (used by tests). Stores _hovered/_focused/_pressed state booleans; _stateProxy reads all three (Task 4 replaces the pass-through with real .tw styling). Adds two keyboard tests (Enter + Space) following the direct focus.requestFocus() harness pattern for test reliability. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- I-1 (false positive): onShowFocusHighlight is already focus-visible-aware (gates on _canShowHighlight which is false for FocusHighlightMode.touch). Added a comment at the ring site explaining this so a future reader does not add a redundant highlightMode check. - I-2: added one-sentence hover comment noting the /90 alpha is translucent and requires a background-coloured surface to avoid bleed-through. - M-1: collapsed the Center ternary to a single Center(widthFactor: ... ? null : 1.0). - M-2: replaced var isLink = false / isLink = true with final isLink = variant == link. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers all 6 ButtonVariant × 4 ButtonSize combinations in light and dark themes, plus a dedicated disabled row and a light-RTL mirror test that verifies EdgeInsetsDirectional padding/border layout is correctly flipped. Surface overflow avoided via UnconstrainedBox around the RepaintBoundary; find.byType(RepaintBoundary).first used as the stable capture target. Baselines generated on Windows (Flutter 3.41.9) for local verification. CI Linux is the authoritative golden platform (AGENTS.md §9) — regenerate with --update-goldens on CI when the apps/gallery CI job lands. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ants/sizes Reconciles charter 3.2 + AGENTS 4 with the implemented Button: 'default' is a Dart reserved word so it can't be an enum constant — shadcn's 'default' variant maps to 'primary' and 'default' size to 'md'; every other shadcn name verbatim. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First flutterbits component slice: the canonical
Button+ the newapps/gallerycomponent app. Executed task-by-task (TDD) fromdocs/superpowers/plans/2026-06-10-flutterbits-button-and-gallery.md, with spec + code-quality review after each task and a final whole-implementation review (Opus).What's here
apps/gallery— a new Material-free Flutter app + pub-workspace member; the flutterbits component golden/compile target (distinct from the engine'sapps/example). Its root is a temporaryWidgetsAppbootstrap, clearly labeled — the structure plan replaces it withLayout.Button(apps/gallery/lib/components/ui/button.dart) — Material-free, copy-paste source. 6 variants (primary/secondary/destructive/outline/ghost/link) × 4 sizes (sm/md/lg/icon), styled entirely throughflutterwindcss.twwith semantic tokens only. Sources its own hover/focus/pressed/disabled viaFocusableActionDetector+ a tap detector; keyboard activation (Enter/Space viaActivateIntent→CallbackAction); focus-visible ring (context.fw.colors.ring);Semantics(button:, enabled:, label:); directional layout.flutter analyze --fatal-infos --fatal-warningsclean,dart formatclean.defaultis a Dart reserved word, so shadcn'sdefaultvariant →primaryanddefaultsize →md; recorded in AGENTS.md §4 + the charter §3.2.Review status
Final Opus review: Ready to merge. Every AGENTS.md §6 "component done" item and §3 hard rule passes (no
material.dart,context.fwonly,Color.withValues, only-transparent literal, exhaustive switches). No leftover shims/TODOs. A code-quality finding ("ring fires on mouse focus") was verified against the SDK as a false positive —onShowFocusHighlightis already gated onFocusManager.highlightMode, so it's correctly focus-visible (a clarifying comment was added).Known follow-ups (explicitly out of this plan's scope)
apps/galleryyet —.github/workflows/ci.yamlcovers flutterwindcss/example/docs but not gallery. A job mirroring theapps/exampleone is needed to gate the component in CI.registry/button.dart+ the manifest JSON +tooling/build_registry.dartare deliberately deferred to the next (registry/CLI) plan, where the manifest's metadata-source is decided alongside the CLI.🤖 Generated with Claude Code