Skip to content

feat(ui): add StreamModalWindow - #229

Open
renefloor wants to merge 8 commits into
feat/stream-adaptive-menu-anchorfrom
feat/stream-modal-window
Open

renefloor wants to merge 8 commits into
feat/stream-adaptive-menu-anchorfrom
feat/stream-modal-window

Conversation

@renefloor

@renefloor renefloor commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked PR (stack #232: #225 → #226 → #227 → #229). This PR targets #227 (feat/stream-adaptive-menu-anchor), which brings in #225's modal parts through #226, so the diff shows only the modal window.

What

  • StreamModalWindow + StreamModalWindowTab: a modal with a sidebar of tabs. It shows one tab at a time, under a header with the tab's label and a close button, in a scroll view. Below 560 wide the sidebar collapses to icons, unless collapsed (like NavigationRail.extended) forces either layout. Each icon gets a tooltip, and its label stays in the tree for screen readers. The sidebar is a SemanticsRole.tabBar and each row a SemanticsRole.tab reading "Tab N of M". semanticLabel names and scopes the route as the dialog's does. onTabChanged reports only the user's selections. The window wraps tab content in a StreamAdaptiveMenuAnchorTheme(useSheet: false), so a menu in a tab stays anchored on phones too. It is opened with showStreamModalDialog.
  • It reuses feat(ui): add StreamModalDialog #225's internal StreamModalSurface and draws its header with feat(ui): add StreamModalDialog #225's public StreamModalDialogHeader (the tab's label as the title, plus showCloseButton and onClose). The window gets the dialog's shape, elevation, inset padding, constraints and header style from StreamModalDialogTheme, and its own theme covers only the sidebar and the content area.
  • StreamModalWindowTheme / StreamModalWindowThemeData { style } / StreamModalWindowStyle. This is the video theme, wired to StreamTheme.modalWindowTheme and context.streamModalWindowTheme. Fields: sidebarWidth, sidebarBackgroundColor, sidebarBorderColor, navItemStyle (a StreamListTileThemeData layered over StreamListTileTheme.of(context) and the defaults; labels default to captionDefault), contentPadding. New fields for values the candidate hard-coded: sidebarPadding, navItemMinHeight, navItemIconSize, navItemSpacing.
    • Surface color: from StreamModalDialogThemeData.backgroundColor (the window's own backgroundColor duplicated it and is gone); sidebarBackgroundColor defaults to it.
    • sidebarBackgroundColor defaults to the window's effective surface color (so backgroundElevation1 unless themed), so the sidebar follows a themed surface instead of going two-tone.
    • constraints precedence: widget param → StreamModalDialogThemeData.constraints → StreamModalDialog.defaultConstraints.
    • contentPadding defaults to 24 at the start, top and end and 32 at the bottom. feat(ui): add StreamModalDialog #225's header has no bottom padding, so the gap below it belongs to the content, as it does to the dialog's body.
  • Factory hook: StreamComponentFactory.modalWindow with StreamModalWindowProps / DefaultStreamModalWindow.
  • Gallery: [Components]/Dialog/StreamModalWindow. The Playground opens a window, and its first tab holds a StreamAdaptiveMenuAnchor. Knobs: number of tabs, initial tab, close button, long labels, narrow window, collapsed (auto, true, false). The Showcase draws the wide and collapsed layouts in place.
  • Barrel: video.dart (experimental), added to the "move to core when stable" list.

Figma

Figma has no component called "Modal Window".

Why

Graduates the StreamModalWindow design-system candidate from stream-video-flutter, so that the video SDK can delete its copy and import this one. The candidate was added in GetStream/stream-video-flutter#1457 and fixed in GetStream/stream-video-flutter#1458. Source on v2: stream_modal_window.dart and modal_window_theme.dart.

API changes vs. the candidate:

  • The StreamModalWindow constructor is no longer const, because it builds props for the factory. This matches StreamModalDialog in feat(ui): add StreamModalDialog #225.
  • constraints is now nullable (BoxConstraints?) and falls back to the modal dialog theme, then to StreamModalDialog.defaultConstraints. Callers that pass a value are unaffected.
  • StreamModalWindowStyle.sidebarBackgroundColor defaulted to backgroundElevation1. It now defaults to the window's surface color. Untouched themes get the same value; it only differs when the surface color is themed.
  • Added the 4 style fields listed above. StreamModalWindowTheme.of reads StreamTheme instead of StreamVideoTheme.

Verified

  • melos bootstrap, melos run generate:flutter: the merge of feat(ui): add StreamModalDialog #225 regenerated with no diff, and the new theme and factory regenerated cleanly.
  • melos run format / melos run format:verify: clean.
  • melos run analyze: clean.
  • melos run check:barrels: pass.
  • cd packages/stream_core_flutter && flutter test --exclude-tags golden: all 1212 pass after rebasing onto feat(ui): add StreamAdaptiveMenuAnchor #227, including a test that the content starts 24 below the header. This includes the ported video tests (stream_modal_window_test.dart) plus new theme tests (stream_modal_window_theme_test.dart) covering defaults, StreamTheme values, local override and inheritance, a theme reaching a window opened as a dialog, navItemStyle merging, the surface/header coming from the modal dialog theme, sidebar and surface painting one color in dark mode (Material 2 and 3), the constraints param beating the theme, a list tile theme around the window reaching the rows, semanticLabel, the tab roles and keyboard traversal, and collapsed on both sides of 560.
  • cd apps/design_system_gallery && dart analyze --fatal-infos: no issues.
  • stream_modal_window_golden_test.dart covers wide and collapsed layouts in light and dark, the same scenarios as the video goldens. I checked the macOS output locally: after feat(ui): add StreamModalDialog #225's dark-surface fix, the dark surface and sidebar are one color, matching the video goldens. goldens/ci/ is regenerated by the update_goldens workflow on this branch after the rebase.

🤖 Generated with Claude Code
settings_window_captions_tab_dark
settings_window_captions_tab_light
settings_window_device_tab_dark
settings_window_device_tab_light
settings_window_recordings_tab_dark
settings_window_recordings_tab_light

@coderabbitai

coderabbitai Bot commented Nov 10, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@renefloor
renefloor added this pull request to stack #228 November 10, 2026 13:54
@codecov

codecov Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.70130% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.38%. Comparing base (03cabfd) to head (5f3be15).

Files with missing lines Patch % Lines
...rc/theme/components/stream_modal_window_theme.dart 85.71% 2 Missing ⚠️
Additional details and impacted files
@@                         Coverage Diff                          @@
##           feat/stream-adaptive-menu-anchor     #229      +/-   ##
====================================================================
+ Coverage                             76.04%   76.38%   +0.34%     
====================================================================
  Files                                   232      234       +2     
  Lines                                 10098    10252     +154     
====================================================================
+ Hits                                   7679     7831     +152     
- Misses                                 2419     2421       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@renefloor
renefloor removed this pull request from stack #228 November 10, 2026 15:28
@renefloor
renefloor added this pull request to stack #232 November 10, 2026 15:28
@renefloor
renefloor force-pushed the feat/stream-modal-window branch from 8b0b66f to ba71d81 Compare November 24, 2026 14:24
@renefloor
renefloor force-pushed the feat/stream-modal-window branch from ba71d81 to dacf669 Compare November 24, 2026 14:40
@renefloor
renefloor force-pushed the feat/stream-modal-window branch from 456763d to 4f7bf37 Compare December 1, 2026 11:13
@renefloor
renefloor marked this pull request as ready for review December 1, 2026 11:35
@renefloor
renefloor requested a review from a team as a code owner December 1, 2026 11:35
@getstream-metis

getstream-metis Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

👋 Thanks, Rene! I'm on it.

How to work with me

  • 💬 Disagree with a finding? Reply in its thread and tell me why. I'll withdraw it, or answer with evidence.
  • 🔁 Fixed it? Just push. The next round checks your fix and resolves the thread.
  • 👍 👎 Rate my findings. I learn what your team doesn't want flagged.
  • ✅ I approve once nothing blocking is left: must-fix always blocks, should-fix only in the first two rounds. CI isn't part of that; branch protection still holds the merge until it's green. On repos that require a human approval, a teammate still has to approve too.
Commands

Comment any of these on the PR:

  • /jeffery review · start a review
  • /jeffery next-round · start the next round now
  • /jeffery pause · /jeffery resume · stop or restart reviews on this PR
  • /jeffery status · where things stand
  • /jeffery help · all commands

@github-actions github-actions Bot added the ready Pull request ready to be reviewed label Dec 1, 2026
@renefloor

Copy link
Copy Markdown
Collaborator Author

/jeffery review

@getstream-metis getstream-metis Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 1 · 🆕 2 new · nothing blocking

➡️ Round 2 started on 6229f18.

getstream-metis[bot]
getstream-metis Bot previously approved these changes Dec 1, 2026

@getstream-metis getstream-metis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Approved · round 1

Nice work, Rene! Nothing blocking is left on 9cb7b5da7f69. Ship it 🚀

Left open, your call:

@xsahil03x xsahil03x left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sidebar matches Figma (200 wide, row metrics, 16px icon with a 12 gap), and collapsing by width below 560 makes sense for a layout. Most comments are about building on #225's parts instead of beside them. The header comment depends on #225's header API; the rest can be done now.

child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
StreamModalHeader(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After #225: Once #225 lands the header API, use the public StreamModalHeader(title: tab.label, showCloseButton: props.showCloseButton, onClose: props.onClose). That also styles the header through StreamModalHeaderTheme rather than the dialog theme.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done when #225 landed its header API: the window draws StreamModalDialogHeader(title: tab.label, showCloseButton: props.showCloseButton, onClose: props.onClose). The public widget ended up named StreamModalDialogHeader, and its style comes from StreamModalDialogThemeData.headerStyle, the same as the dialog's header. There is no separate header theme.

// over the default.
final backgroundColor = style?.backgroundColor ?? resolveStreamModalDialogTheme(context).backgroundColor!;

return StreamModalSurface(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unlike DefaultStreamModalDialog, the window doesn't scope or name its route. Add a semanticLabel prop and the same Semantics(scopesRoute, namesRoute, explicitChildNodes, label) wrap, with the same platform fallback.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added semanticLabel in 9acba32. When it is set, the window is wrapped in the same Semantics(scopesRoute, namesRoute, explicitChildNodes, label) as the dialog, and the header is told not to name the route. I left out the platform fallback: the window always has a title (the selected tab's label), which names it. The dialog only falls back when it has no header. Tests cover both cases.

final states = {if (selected) WidgetState.selected};
final iconColor = listTileTheme.iconColor?.resolve(states) ?? colorScheme.textSecondary;
final labelColor = listTileTheme.titleColor?.resolve(states) ?? colorScheme.textPrimary;
final labelStyle = listTileTheme.titleTextStyle ?? context.streamTextTheme.bodyDefault;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sidebar labels fall back to bodyDefault. Figma's sidebar rows use caption/default on text/primary. Default the nav item's titleTextStyle to captionDefault.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 9acba32. The rows' titleTextStyle defaults to captionDefault, and the color stays the list tile's textPrimary. A test checks it.

Widget build(BuildContext context) {
final props = widget.props;
final style = context.streamModalWindowTheme.style;
final defaults = _StreamModalWindowStyleDefaults(context);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The style?.x ?? defaults.x fallbacks are spread through build and _Sidebar. Resolve every value once at the top of build as effective* locals, as in StreamCheckbox, and pass resolved values down instead of style and defaults.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 9acba32. build resolves every value once as an effective* local and passes the resolved values to the sidebar and rows. The sidebar no longer sees style or defaults.

child: tab.icon,
);

Widget item = StreamListTileContainer(

@xsahil03x xsahil03x Dec 1, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: rows announce as buttons with selected. Give the sidebar SemanticsRole.tabBar and each row SemanticsRole.tab, as NavigationBar does, plus the "Tab 2 of 4" index hint from localizations.tabLabel, as NavigationRail does. Add a test that keyboard traversal moves between tabs.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 9acba32. Each row now reads as "Device, Tab 1 of 3", with localizations.tabLabel added as in NavigationRail, and is still marked selected. A new test moves focus to the second tab with Tab and selects it with Enter.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following your edit: in 2453e89 the sidebar is a SemanticsRole.tabBar node and each row a SemanticsRole.tab with its selected state, as NavigationBar does. Rows still read "Tab N of M" from localizations.tabLabel. A new test checks that the tab bar's children are all tabs, and the keyboard test still moves between tabs and selects one.

/// A collapsed sidebar shows only the icon.
final Widget icon;

/// The tab's name: drawn in the sidebar and as the title of the header.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Use one-line summaries without the colon: "The tab's name, shown in the sidebar and as the header title." / "The visual style of a [StreamModalWindow]'s sidebar and content area." Shorten :157 to "Defaults to [backgroundColor]."

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 9acba32: "The tab's name, shown in the sidebar and as the header title." and "The visual style of a [StreamModalWindow]'s sidebar and content area.". sidebarBackgroundColor now says "Defaults to [StreamModalDialogThemeData.backgroundColor].", since the window's own backgroundColor is gone.

///
/// * [StreamModalWindow], which uses these properties.
/// * [DefaultStreamModalWindow], the default implementation.
@experimental

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: StreamModalWindowProps lacks @immutable; StreamModalWindowTab and #227's props class have it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added @immutable in 9acba32.


/// Called when the close button is pressed.
///
/// Defaults to popping the window with no value.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: It doesn't default to anything, so say "If null, the close button pops the window."

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 9acba32: "If null, the close button pops the window."

child: tab.icon,
);

Widget item = StreamListTileContainer(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Return the Tooltip from inside the if and the bare item otherwise, instead of reassigning item.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 9acba32. The Tooltip is returned from inside the if.

expect(tester.getTopLeft(find.text('Device content')).dy - header.bottom, 24);
});

testWidgets('selecting a tab shows it and reports it', (tester) async {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: - One behaviour per test: split :135-151; re-selecting being a no-op is a separate test.

  • Private helpers: :7, :42 and :61 use ///; use //.
  • Helper placement: move the helpers below main, per TESTING.md.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 9acba32. Re-selecting is its own test, the helpers use // and sit below main.

@github-actions github-actions Bot added pending Review comments waiting to be addressed and removed ready Pull request ready to be reviewed labels Dec 1, 2026
@renefloor
renefloor force-pushed the feat/stream-modal-window branch from 9cb7b5d to 8146981 Compare December 1, 2026 12:48
@getstream-metis
getstream-metis Bot dismissed their stale review December 1, 2026 12:48

Withdrawing approval until 8146981 is reviewed.

@xsahil03x xsahil03x left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more from checking against the video SDK's Modal Window design and NavigationRail.

child: SizedBox.expand(
child: LayoutBuilder(
builder: (context, constraints) {
final collapsed = constraints.maxWidth < _collapseBelowWidth;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 560 breakpoint has no design behind it: Figma has no icon-only sidebar. Confirm it with design, or let the caller decide, as NavigationRail.extended does (for example bool? collapsed, which falls back to the width check when null).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 2453e89: StreamModalWindow(collapsed:), like NavigationRail.extended. True shows only icons, false shows icons and labels, and null keeps the width check (collapsed while the window is narrower than 560). Tests cover all three, including both sides of the 560 boundary, and the gallery has a Collapsed knob.

getstream-metis[bot]
getstream-metis Bot previously approved these changes Dec 1, 2026

@getstream-metis getstream-metis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 2 · 🎉 Approved

Nice work, Rene! Nothing blocking is left on 6229f188f27b. Ship it 🚀

Left open, your call:

@renefloor
renefloor force-pushed the feat/stream-modal-window branch from 6229f18 to 9acba32 Compare December 1, 2026 13:12
@getstream-metis
getstream-metis Bot dismissed their stale review December 1, 2026 13:12

Withdrawing approval until 9acba32 is reviewed.

@xsahil03x

Copy link
Copy Markdown
Member

Sorry for the churn: I withdrew two of my comments after checking against the video SDK's Modal Window design, and deleted them without saying so. Please revert both:

  • Content padding: keep 24/24/24 with 32 at the bottom. The video Modal Window's content area is px 24, pt 0, pb 32.
  • Sidebar rows: keep the hand-built rows and the navItemMinHeight / navItemIconSize / navItemSpacing fields. StreamListTile can't draw the Figma row: its gap is fixed at 8 (Figma has 12), it has no icon size, and its 40 minimum applies inside the padding.

The rest of the review stands.

getstream-metis[bot]
getstream-metis Bot previously approved these changes Dec 1, 2026

@getstream-metis getstream-metis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 3 · ✅ 2 fixed · 🎉 Approved

Nice work, Rene! Nothing blocking is left on 0868bfccfda9. Ship it 🚀

renefloor and others added 7 commits December 1, 2026 14:32
Graduates the StreamModalWindow design-system candidate from
stream-video-flutter: a modal with a sidebar of tabs that collapses to
icons below 560 wide, built on the shared modal surface and header, with
StreamModalWindowTheme on StreamTheme and a component factory hook.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Now that the modal surface paints exactly its background color in dark
mode, the sidebar is an opaque Material again, defaulting to the window's
effective surface color (backgroundElevation1 unless themed), as in the
candidate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The modal header no longer pads its bottom, so the gap below it now belongs
to the window's contentPadding, as it does to StreamModalDialog's body.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gHeader

The internal StreamModalHeader is now the public StreamModalDialogHeader, so
the window uses it with its tab's label as the title.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Builds the sidebar rows as StreamListTiles that announce their tab
position, adds semanticLabel, pads the content like a dialog's body and
drops the style fields the dialog theme or the list tile already cover.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s and collapsed

Goes back to the hand-built sidebar rows, with navItemMinHeight,
navItemIconSize and navItemSpacing, and to the 24/24/24/32 content padding.
The rows keep the caption label style and the layered list tile theme.

The sidebar is a tab bar of tabs for screen readers, and `collapsed` lets
the caller force the icon-only or the labelled sidebar instead of the width
check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…l window

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@renefloor
renefloor force-pushed the feat/stream-modal-window branch from 0868bfc to c960643 Compare December 1, 2026 13:34
@getstream-metis
getstream-metis Bot dismissed their stale review December 1, 2026 13:34

Withdrawing approval until c960643 is reviewed.

@getstream-metis

Copy link
Copy Markdown

👀 New commits spotted.

⏳ I'll re-review at 13:47 UTC, once nothing has been pushed for 10 minutes. A new push restarts the wait. Comment /jeffery review to skip it.

@renefloor renefloor added the ready Pull request ready to be reviewed label Dec 1, 2026
@github-actions github-actions Bot removed the pending Review comments waiting to be addressed label Dec 1, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jeffery:review ready Pull request ready to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants