feat: add FlowToast, the floating notice, and showFlowToast - #42
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 dd093f9. Configure here.
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 the toast from the Flow UI Figma frames: a floating notice with a glyph, one wrapping line and a close cross on a frosted card.
FlowToast: the card. Host-supplied glyph, one line that wraps, a close cross;surfaceBrightat 80% under the firm hairline on a 12px corner, the theme's shadow at a 24 blur,labelMediumEmphasisedin ink. The glyph and the cross centre on the first line; the cross disc is pinned from outside the row, so the card keeps the design's height whether the line wraps or not.showFlowToastandFlowToastHandle: float the card in the nearestOverlaywith no setup. 358 wide, 24 in from the top end corner from 600px; full width inside 16 below that. Stacked as a deck: newest in front, older cards peeking out above it, three at most. Hover fans the deck out and pauses every clock; under assistive navigation it stays fanned out with no auto-dismiss. 4s dwell,duration: nullstays. The handle dismisses early or awaitsclosed.FlowToastStylewith aFlowTheme.toastStyleslot. The failure form isiconColor: colors.error; no tone enum, the host owns the glyph.BackdropFilterunder anOpacitysamples the fade's own layer, not the page (the preview's rule).Overlay.wrap, so toasts land at the pane's top end corner on the web canvas and at the top of the screen in the phone frame. The stage now reports its floating variant pills to stage-filling demos as a 56px top inset so top-anchored chrome lands under them; this also insets the attachments Drop variant's chat surface.Reviewer notes:
handle.dismiss(); documented on the page.Screenshots
SnackBar('Copied')How this was verified
flutter analyze lib,flutter analyzeinexample/andplayground/;dart format ..test/stays empty: 4s dismissal, hover pause, cross and handle, eviction past three, dismiss before mount, overlay teardown under live toasts, reduced motion, accessible navigation, wide and compact placement, RTL./components/toast, in the sidebar after Confirmation.Checklist
flutter analyze libandflutter analyzeinexample/andplayground/are cleandart format .applieddependencies:inpubspec.yamlis flutter.dev-published, forces no configuration on hosts that never use the feature, and is argued in this PRlib/flow_ui.dartand documented indocs/and the README tableCHANGELOG.mdupdated for user-facing changes, with breaking changes called outfeat:,fix:,refactor:,docs:,chore:)Note
Medium Risk
New overlay lifecycle (~800 lines) affects global UI stacking, timers, and accessibility behavior; integration risk is moderate but localized to optional toast calls rather than core chat paths.
Overview
Adds Toast as a shipped surface: a frosted floating notice with host icon, wrapping message, and dismiss control, plus
showFlowToastto mount it in the nearestOverlaywith no host wiring.FlowToastis the card-only widget (live region, optional dismiss).showFlowToastowns placement (wide vs compact), a three-deep stacked deck with hover fan-out and paused timers, default 4s auto-dismiss (duration: nullfor sticky work),FlowToastHandlefor early dismiss/closed, and a 3px page blur drawn behind the fade (not inside the card).FlowToastStyleandFlowTheme.toastStylefollow the existing component-style pattern.The example app swaps the copy SnackBar for a toast. Docs, changelog, roadmap, and README list the API; the playground adds toast variants and bumps top inset for stage-filling demos so toasts sit under variant pills.
Reviewed by Cursor Bugbot for commit 1f05090. Bugbot is set up for automated code reviews on this repo. Configure here.