Repository navigation
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #225 +/- ##
==========================================
+ Coverage 73.13% 73.49% +0.35%
==========================================
Files 220 224 +4
Lines 9497 9641 +144
==========================================
+ Hits 6946 7086 +140
- Misses 2551 2555 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
f1fa760 to
e482190
Compare
|
/jeffery review |
e482190 to
0eb4b72
Compare
|
Thanks for asking Jeffery for review. I'll stay on this PR until I can approve it. How it works
Commands (each as a whole comment)
|
xsahil03x
left a comment
There was a problem hiding this comment.
Reviewed against the style guide, Flutter's showDialog / Dialog / AlertDialog, and Figma. The API follows showDialog, but routing through showGeneralDialog loses things showDialog gives for free. There are also a few gaps against the Figma Modal Window.
Design questions (for the designers)
- Figma's title wraps; the code clamps it to one line with an ellipsis. Which is intended?
- The Figma window is a fixed 720×640 with the footer pinned to the bottom; the code shrinks to its content. Fixed or content height?
- Naming: Figma calls it "Scrim Blur" (token
background/core/scrim), and Flutter, our sheet theme and this PR's ownbarrierDismissible/barrierLabelsay "barrier". I'd leanbarrierColor/barrierBlurSigmafor API consistency. Any objection?
Note on Figma: the "Dialog" nodes linked in the description (6836:77681, 19881:670034) are the alert dialog (304 wide, centred icon, stacked full-width buttons), not this component. The real counterparts are the Modal Window (944:65287) and the Modal Dialog Header/Footer (20616:557906 / 20616:557964). Please point the description there.
Withdrawing approval until 3521821 is reviewed.
1539f19 to
a0486b5
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #225 +/- ##
==========================================
+ Coverage 75.13% 75.56% +0.42%
==========================================
Files 220 225 +5
Lines 9563 9747 +184
==========================================
+ Hits 7185 7365 +180
- Misses 2378 2382 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
No open findings, but I'm not approving this head: changes requested by xsahil03x. |
xsahil03x
left a comment
There was a problem hiding this comment.
Follow-up round: I checked the patterns we raised on #221 (focus theming, effective* locals, .from, factory generics, animation parity, trailing commas) across the remaining PRs. The Mobile/Desktop switch is resolved cleanly as defaults. One question on the transition, plus nits.
xsahil03x
left a comment
There was a problem hiding this comment.
I ran the gallery for this PR on web and macOS. The dialog itself behaves well: it opens and closes with Esc, returns its value, stops at 640 with the body scrolling, and the dark surface outline shows. These comments are about the gallery examples.
xsahil03x
left a comment
There was a problem hiding this comment.
Two more notes on the Showcase from running it locally.
|
No open findings, but I'm not approving this head: changes requested by xsahil03x. |
Graduates the StreamModalDialog / showStreamModalDialog / StreamBlurScrim design-system candidate from stream-video-flutter, with a StreamModalDialogTheme on StreamTheme, a modalDialog factory hook, a gallery page and tests. Exported from the experimental video.dart barrel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
StreamModalSurface passed StreamColors.transparent (0x00FFFFFF) as the Dialog's surfaceTintColor. Material 3 only skips the tint for exactly Colors.transparent, so it blended white in at elevation level4 and the dark surface painted ~#383838 instead of backgroundElevation1 (#1c1c1c). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Material 3's dialog defaults to a transparent shadow color, so the level4 elevation drew nothing and an app's DialogTheme decided the shadow. Add a themed `shadowColor` and pass it explicitly. Mark the title with `namesRoute` so screen readers announce it on open. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- `contentPadding` now defaults to 24 (16 on mobile) at the sides and bottom, and the footer drops its top padding, so a dialog without a footer no longer ends on its body, as with `AlertDialog`. - `showStreamModalDialog` takes an `AnimationStyle`, and the scrim's blur grows with the transition. - Resolve `effective*` locals before building; trailing commas. - Gallery: open the Playground in the preview's navigator, outline the example panels, let them grow with the dialog, add a Mobile example and replace the alert-style "Discard changes?" with a task-style one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The body now pads itself on every side, as AlertDialog's content does, and the header has no bottom padding, so a dialog without a title, header actions or close button no longer starts with an empty 88px band. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4a19a30 to
650d780
Compare
|
No open findings, but I'm not approving this head: changes requested by xsahil03x. |
…actions Makes the header public as StreamModalDialogHeader, passed as StreamModalDialog.header, with leading, title, subtitle and trailing slots, the close button, a per-instance style and a component-factory entry. The body is now `content`. On desktop and the web the footer actions sit in an OverflowBar, so they stack instead of overflowing at large text scales. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| Widget build(BuildContext context) { | ||
| final theme = resolveStreamModalDialogTheme(context); | ||
| final effectiveContentPadding = props.contentPadding ?? theme.contentPadding!; | ||
| final label = props.semanticLabel ?? (props.header == null ? _fallbackLabel(context) : null); |
There was a problem hiding this comment.
consider: Dialog has no accessible name when its header cannot name it
The alertDialogLabel fallback only applies when header is null, so a header with excludeHeaderSemantics: true or no title and subtitle leaves the dialog unnamed on non-Apple platforms. Falling back whenever semanticLabel is null and the header cannot name the route keeps the documented behaviour.
Useful? React 👍 or 👎. Disagree? Reply here.
|
No open findings, but I'm not approving this head: changes requested by xsahil03x. |
What
StreamModalDialog: a centered modal surface with an optional header, a body and an optional footer row of actions. Props:header,content,contentPadding,actions,constraints,semanticLabel. The default constraints are 720 × 640 max. The header and footer stay pinned while the body scrolls.StreamModalDialogHeader: the header passed asheader. Slots:leading(e.g. a back button, never implied), a one-linetitleandsubtitle, andtrailing(aRowfor several actions). It also takesshowCloseButton,onClose(defaults toNavigator.maybePop),excludeHeaderSemanticsand a per-instancestyle. Its title names the route; the dialog falls back to its localized label only whenheaderis null.OverflowBar, as inAlertDialog, so they stack instead of overflowing at large text scales. On mobile they share the width equally.showStreamModalDialog<T>(): opens the dialog over aStreamBlurScrimwith the video SDK's fade + scale transition, in which the scrim's blur grows too;animationStyleoverrides its duration and curves, as inshowDialog. It captures theInheritedThemes between the caller and the navigator, so aStreamModalDialogTheme(orTheme) around the caller reaches the dialog and the scrim. On a folded window it anchors to the trailing top corner unlessanchorPointis given.StreamBlurScrim: the translucent fill over a backdrop blur.colorandblurSigma(0skips the blur).StreamModalDialogTheme/StreamModalDialogThemeData(@themeGen, onStreamTheme.modalDialogTheme,context.streamModalDialogTheme):backgroundColor,elevation,shadowColor,shape,insetPadding,constraintsheaderStyle: StreamModalDialogHeaderStylewithpadding,titleTextStyle,subtitleTextStyle,spacing(between leading, title and trailing) andactionsSpacing(trailing to the close button)footerStyle: StreamModalDialogFooterStylewithpaddingandactionsSpacingbarrierColor,barrierBlurSigmacontentPadding(24 on every side, or 16 on mobile). As withAlertDialog, the header has no bottom padding and the footer no top padding, so a dialog withheader: nullstarts with the body's own padding.colorScheme.backgroundElevation1/backgroundScrim/textPrimary,streamElevation.level4, Material'scolorScheme.shadow,streamRadius.xl,streamSpacing.{xxl,xl,md,xs}andtextTheme.headingSm. No hard-coded colors.StreamComponentFactory.modalDialog(StreamModalDialogProps/DefaultStreamModalDialog) andmodalDialogHeader(StreamModalDialogHeaderProps/DefaultStreamModalDialogHeader).StreamBlurScrimhas no hook because it is a building block of the modal and not a component on its own.StreamModalSurface,StreamModalCloseButton), the scope that stops the header naming the route when the dialog has asemanticLabel, andresolveStreamModalDialogThemelive incomponents/dialog/internal/stream_modal_parts.dart, which is added tocheck_barrels.yamlinternal_dirs. The follow-upStreamModalWindowwill reuse them, so it gets the same surface and header from this theme and only themes its own sidebar.trailingTopAnchorOfis ported intolib/src/utils/display_fold.dart. The rest of the video repo's fold utilities are left out because nothing here uses them yet.[Components]/Dialoghas a Playground with knobs for the header, back button, title, subtitle, header actions, close button, footer actions, long scrolling content, blur on/off and barrier dismissible, plus a Showcase.video.dart(experimental), next to the split button.StreamModalDialogis the first stream-core-flutter component with mobile-vs-web defaults. Android and iOS use the Figma Mobile metrics, while desktop and web share the Web ones, following theisDesktopOrWebsplit from feat(ui, samples): large-screen call app bar with participants and latency badges stream-video-flutter#1620.Figma
Why
This graduates the design-system candidate from stream-video-flutter so the video SDK can delete its copy and import this one instead:
StreamModalWindow)stream_modal_dialog.dart,stream_modal_parts.dart,display_fold.dartThe scrim reads from the modal dialog theme instead of getting a theme of its own. It is only ever drawn as a modal's barrier, and the later
StreamModalWindowopens throughshowStreamModalDialogtoo, so one theme covers both.API changes compared with the candidate:
The header is a slot:
title,headerActions,showCloseButtonandonClosemove ontoStreamModalDialogHeader, passed asheader:, andchildis nowcontent. The video SDK's call sites need that move when they switch to this dialog.The
StreamModalDialogconstructor is no longerconst, because it builds its factory props the same way every other component here does.const StreamModalDialog(...)call sites need to drop theconst. The video SDK's non-test code has none.StreamModalDialog.constraintsandStreamBlurScrim.blurSigmaare nullable now, so they can fall back to the theme. They default to the same values as before.The
showStreamModalDialogparameters are unchanged. They followshowDialog(routeSettings,barrierDismissible,useRootNavigator = true) rather thanshowStreamSheet(settings,isDismissible,useRootNavigator = false).anchorPointanduseRootNavigatorhave the same names in both.Verified
melos bootstrap,melos run generate:fluttermelos run format,melos run format:verify: cleanmelos run analyze: no issuesmelos run check:barrels: successflutter test --exclude-tags goldeninpackages/stream_core_flutter: all 1024 pass. This includes the ported video tests (fold placement, the scrim following a theme change, a theme around the caller reaching the dialog), new theme-override and widget-beats-theme tests, a test that aStreamModalDialogThemearound the caller is captured into the route, the factory hooks,trailingTopAnchorOf, the header slots, style and semantics, and the footer at a 2× text scale (which fails with the oldRow).dart analyze --fatal-infosinapps/design_system_gallery: no issuesstream_modal_dialog_golden_test.dartcovers the light/dark matrices. It passed locally (macOS output checked by eye), and thegoldens/ci/images are generated by theupdate_goldensworkflow on this branch.🤖 Generated with Claude Code