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 @@
## feat/stream-modal-dialog #226 +/- ##
============================================================
+ Coverage 73.49% 73.72% +0.23%
============================================================
Files 224 226 +2
Lines 9641 9703 +62
============================================================
+ Hits 7086 7154 +68
+ Misses 2555 2549 -6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
a58f847 to
257d7f5
Compare
|
/jeffery review |
638e78b to
9479cd3
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)
|
There was a problem hiding this comment.
✅ Approved 9479cd390221 after 1 round
Left open, your call:
- consider: Anchored menu hides an enclosing StreamContextMenuActionTheme (
packages/stream_core_flutter/lib/src/components/context_menu/stream_context_menu_anchor.dart:286)
xsahil03x
left a comment
There was a problem hiding this comment.
Reviewed against the style guide, Flutter's MenuAnchor / RawMenuAnchor, and Figma 1935:50496 (Web Menu Item). Anyone who knows MenuAnchor can pick this up: the controller, open(position:), the builder signature, alignmentOffset, onOpen/onClose, Esc and RTL all carry over. Row height, width, icons, gap, radius and colours match Figma. Since this is stacked on #225, the route fixes there come first.
Design questions (for the designers)
- Figma's Menu Item has a
State=Selected(background/utility/selected), ashowDescriptionshortcut slot, andshowLeadingSpacefor label alignment. None of these exist in code. Which do we need? - Is there a menu container spec? I couldn't find one, so panel padding, elevation and border are unverified. The row's 4 + 8 inset only matches the code if the panel has 0 padding.
- Figma rows are drawn 360 wide; the code caps the panel at 320 (
:81). Is there a real max width?
Withdrawing approval until a142a67 is reviewed.
There was a problem hiding this comment.
✅ Approved a142a670635e after 2 rounds · 1 fixed
Left open, your call:
- consider: Focus wrapper appears and disappears with childFocusNode (
packages/stream_core_flutter/lib/src/components/context_menu/stream_context_menu_anchor.dart:325) - consider: Menu height cap ignores space left by reservedPadding (
packages/stream_core_flutter/lib/src/components/context_menu/stream_context_menu_anchor.dart:333)
a142a67 to
54d4150
Compare
Withdrawing approval until 54d4150 is reviewed.
There was a problem hiding this comment.
✅ Approved 54d415012e3b after 3 rounds · 1 fixed
Left open, your call:
- consider: Focus wrapper appears and disappears with childFocusNode (
packages/stream_core_flutter/lib/src/components/context_menu/stream_context_menu_anchor.dart:325) - consider: Menu height cap ignores space left by reservedPadding (
packages/stream_core_flutter/lib/src/components/context_menu/stream_context_menu_anchor.dart:333)
Withdrawing approval until b40f4fa is reviewed.
820d561 to
62161f7
Compare
There was a problem hiding this comment.
✅ Approved 62161f703201 after 4 rounds · 3 fixed
Left open, your call:
- consider: Unfocused rows drop the border of a themed shape (
packages/stream_core_flutter/lib/src/components/context_menu/stream_context_menu_action.dart:489)
62161f7 to
f94312f
Compare
Withdrawing approval until f94312f is reviewed.
Graduates the context menu anchor from stream-video-flutter into the experimental video.dart barrel, with StreamContextMenuAnchorTheme on StreamTheme and a contextMenuAnchor factory hook. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…its in a dialog A menu opened by a tap left focus on the enclosing route, so Escape reached the route's DismissAction and popped the dialog along with the menu. The anchor now takes focus when the menu opens. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…to the screen - Add `side` to `StreamContextMenuActionStyle`; the action defaults draw the focus ring there, so a themed `shape` keeps it and inline menus get it too. - Keep the anchor's fallback `Focus` in the tree whatever `childFocusNode` is, so switching it does not remount the builder. - Cap the anchored menu at the height `reservedPadding` leaves, so the menu scrolls its rows instead of the panel scrolling the whole menu. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds headingStyle to StreamContextMenuAnchorThemeData and StreamContextMenuAnchor.defaultHeadingStyle, and wraps the menu in a StreamContextMenuHeadingTheme, so a heading shows caption text, a 16px icon and the md radius next to the 32px rows. An unfocused action row now keeps the border of a themed shape. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ec0621c to
415920b
Compare
Withdrawing approval until 415920b is reviewed.
What
StreamContextMenuAnchor: wrapsMenuAnchorso aStreamContextMenusupplies the whole surface. It neutralizes theMenuAnchorpanel (StreamContextMenuAnchor.menuStyle), turns off the panel clip (Clip.none) so the menu shadow isn't cut off, keeps the menu's scroll view off thePrimaryScrollController, bounds the panel withconstraints, and sizes rows to the design's denserWeb / Menu Item(32px rows, 200px minimum width, caption/emphasis labels, 16px icons). (Figma)StreamContextMenuAnchorTheme/StreamContextMenuAnchorThemeData:constraints,alignmentOffsetandactionStyle(aStreamContextMenuActionStylemerged over the design row). The theme is available asStreamTheme.contextMenuAnchorThemeandcontext.streamContextMenuAnchorTheme. A widget param wins over the theme, and the theme wins over the defaults.elevationon the anchor theme.StreamContextMenuStyle.elevationinStreamContextMenuThemealready covers it for anchored and inline menus, so the anchor'selevationparam passes straight toStreamContextMenu. A test covers that path.Public statics kept:
defaultConstraints,menuStyleanddefaultActionStyle(BuildContext).defaultActionStylenow returns the design row with the theme'sactionStylemerged over it.StreamContextMenuActionTheme.ofonly reads the nearest theme, so a caller that re-wraps a single row (asStreamAdaptiveMenuAnchordoes for its selected row) keeps the theme's values instead of quietly dropping them.Factory hook:
StreamComponentBuilders.contextMenuAnchorwithStreamContextMenuAnchorProps/DefaultStreamContextMenuAnchor. Apps use the anchor directly, not as a building block inside another component, so it gets a hook. That lets an integrator replace how menus are presented everywhere, for example with a sheet or a native menu.Gallery:
[Components]/Context Menu/StreamContextMenuAnchorPlayground (knobs for item count, long labels, destructive section, elevation, alignment offset, max width/height, row height) and Showcase (default, flat, long labels, scrolling, themed).Barrel:
video.dart(experimental), next toStreamSplitButton. The classes are marked@experimental.Headings:
StreamContextMenuAnchorThemeData.headingStyleandStreamContextMenuAnchor.defaultHeadingStyle(context)give aStreamContextMenuHeadingin an anchored menu the Web Menu Heading values (captionEmphasis, 16px icon,radius.md), merged with the heading theme and then the anchor theme the same way asdefaultActionStyle. The menu is wrapped in aStreamContextMenuHeadingThemenext to the action theme; the heading's row size and padding still come from the anchored rows.Focus ring:
StreamContextMenuActionStylegets aside, and the action defaults draw a 2pxborderFocusring there when the row is focused. Inline menus get the ring too, and a themedshapekeeps its border: unfocused rows leavesidenull. The anchor's default only sets theradius.mdshape.Figma
Why
This graduates the design-system candidate from stream-video-flutter, so the SDK can delete its copy and import this one. Source on v2:
stream_context_menu_anchor.dart, introduced in GetStream/stream-video-flutter#1311 and changed in #1320, #1332 and #1458.API changes compared with the candidate:
constraintsandalignmentOffsetare now nullable, so the theme can supply them. Leaving them out still resolves todefaultConstraints/Offset.zero, and passing a value works as before.const, because it buildspropsfor the factory, as every factory-backed component does. The candidate's own callers never build it asconst.props(anchor.props.constraintsrather thananchor.constraints).Differs from v2: Escape inside a dialog
In v2, pressing Escape with a menu open inside a dialog closed the menu and the dialog together, because a menu opened by a tap left focus on the dialog's route. The anchor now takes focus when its menu opens, so Escape closes only the menu. A second Escape still closes the dialog. Covered by
StreamContextMenuAnchor in a dialog closes only the menu on Escape.Verified
melos bootstrap,melos run generate:flutter(regeneratedstream_theme, the component factory and the gallery directories).melos run format:verify,melos run analyze(no issues),melos run check:barrels,melos run check:tokens: all pass.flutter test --exclude-tags goldeninstream_core_flutter: all 1057 tests pass after rebasing on feat(ui): add StreamModalDialog #225 andmain, including the anchor and theme tests and new ones for anchored headings and a themed shape's border. The candidate's three tests are ported withoutStreamSelectInputandStreamRadioIndicator. Two regression tests cover the shadow clip and the scroll controller: one checksClip.none, the other opens a scrolling menu on iOS. Both fail when their fix is reverted.dart analyze --fatal-infosinapps/design_system_gallery: no issues. I have not clicked through it in the running gallery.stream_context_menu_anchor_{light,dark,long_label,flat}) render the open menu inside a scenario-localOverlay, so the panel lands in the captured area. I checked the local macOS output by eye.goldens/ci/still needs theupdate_goldensworkflow dispatched on this branch.🤖 Generated with Claude Code