feat: add FlowConfirmation, the approval card, and its message part - #40
Merged
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit cb21256. Configure here.
8 tasks
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.

Summary
Adds
FlowConfirmation, roadmap item 19: the approval card for gated actions.padding/borderRadiusoverrides.FlowConfirmationPartjoins the sealed part model and renders the card in a turn. The decision reports throughFlowThread.onConfirmationRespondwith the message, the part, and the decision;approveLabel/rejectLabel/approvedLabel/rejectedLabelthread like the error card's strings. The package ships no strings.FlowConfirmationStylejoins the component styles with aFlowTheme.confirmationStyledefault. The three state accents recolor a state's marks (asterisk, settled glyph, settled wash) with one override.lib/src/utils/flow_asterisk_painter.dart(internal, not exported) so both marks stay one drawing; behavior unchanged._redirectsline, and changelog entry included.Reviewer notes:
_ConfirmationButton), like the error card's retry pill, until the design system's Button lands and absorbs them.successContainer/errorContainer).onSurfaceVariant,onSurface), not the accent. In the light preset the accents on the card measure 2.47:1 (warning), 3.53:1 (success on its wash) and 4.45:1 (error), all under WCAG AA for text; the ink pairings measure 8.6:1 and 17:1. The accent still carries the state on the asterisk, the settled glyph and the wash.Screenshots
New component, so no before column.
How this was verified
confirmationstage: all four variants, light and dark. Tapping Approve or Reject settles the live card and the thread card in place; the card's height does not move across states and the thread does not scroll-jump.?embed=confirmation&variant=...&theme=...) compared against the Figma frame at 480 wide./playground/thinking-indicatorchecked after the painter extraction; the mark is unchanged.flutter analyzeclean at the root and inexample/andplayground/;dart format .applied.Checklist
flutter analyze libandflutter analyzeinexample/andplayground/are cleandart format .applieddependencies:inpubspec.yaml(Flutter SDK and flutter.dev packages only)lib/flow_ui.dartand documented indocs/and the README tableCHANGELOG.mdupdated for user-facing changes, with breaking changes called outfeat:,fix:,refactor:,docs:,chore:)Note
Low Risk
Additive UI API and optional thread callbacks; no auth, networking, or breaking changes to existing message rendering paths.
Overview
Ships
FlowConfirmation, an approval card for gated actions: pending shows host-localized title, message (live region), and optional approve/reject buttons; approved/rejected collapse actions into a fixed-height settled row with success/error accents. The widget is stateless—taps report intent and the host re-renders withFlowConfirmationStatus.Adds
FlowConfirmationPartto the message part model and wires it throughFlowMessage/FlowThreadviaonConfirmationRespond(message, part, approved)plus thread-level button labels, mirroring the error-card pattern.FlowConfirmationStyleandFlowTheme.confirmationStylesupport theming; public exports and docs/playground/changelog/README/roadmap mark Confirmation as shipped.Refactors the thinking indicator’s asterisk into shared internal
FlowAsteriskPainter(behavior unchanged).Reviewed by Cursor Bugbot for commit 748579d. Bugbot is set up for automated code reviews on this repo. Configure here.