Skip to content

feat(ui): add StreamMediaViewer and StreamBottomAppBar#113

Merged
xsahil03x merged 5 commits into
mainfrom
feat/media-viewer
May 15, 2026
Merged

feat(ui): add StreamMediaViewer and StreamBottomAppBar#113
xsahil03x merged 5 commits into
mainfrom
feat/media-viewer

Conversation

@xsahil03x
Copy link
Copy Markdown
Member

@xsahil03x xsahil03x commented May 12, 2026

Summary

  • StreamMediaViewer — full-screen media chrome controller. Composes an optional header, footer, and edge-to-edge child; animates chrome in/out via showChrome and fades to an immersive background when hidden. Theme carries scoped appBarStyle / bottomAppBarStyle so descendant chrome bars can be tinted (e.g. light-on-dark over dark media) without touching app-wide themes.
  • StreamBottomAppBar — bottom counterpart to StreamAppBar. Same three-slot layout (leading / heading / trailing), supports title + subtitle, top hairline border, SafeArea(top: false) when primary, and the same per-slot button style propagation.
  • RefactorStreamHeaderToolbarStreamToolbar and components/header/components/toolbar/ across lib, gallery, and tests. The shared layout primitive is now consistently named with the directory and used by all three toolbar widgets.
  • Doc fix — dropped the "48×48 slot for symmetry" claim from StreamAppBar / StreamBottomAppBar / StreamSheetHeader. StreamToolbar actually mirrors the wider of leading / trailing on the opposite side; the 48×48 appearance comes from StreamButton.icon's kMinInteractiveDimension, not the bar.

Test plan

  • melos run analyze clean across stream_core, stream_core_flutter, design_system_gallery.
  • flutter test test/components/toolbar/ — 29 tests pass (7 app bar, 16 sheet header, 6 new bottom app bar).
  • flutter build macos --debug succeeds for the gallery.
  • Visual check Widgetbook: StreamMediaViewer Playground + Showcase render correctly; StreamBottomAppBar Playground + Showcase render correctly.
  • Cross-platform spot-check: Android, iOS, web.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Fullscreen Media Viewer with animated header/footer, configurable chrome, and gallery playground/showcase.
    • Bottom App Bar with title/subtitle, leading/trailing slots, SafeArea handling, and theming support.
  • Refactor

    • Unified toolbar primitive and reorganized gallery entries under a Toolbar category.
  • Tests

    • Added and updated widget tests for bottom app bar and toolbar styling/behavior.
  • Documentation

    • CHANGELOG updated to reflect new toolbar, bottom app bar, and media viewer entries.

Review Change Stack

Introduces two new components and consolidates the toolbar family:

- StreamMediaViewer: full-screen media chrome controller. Composes an
  optional header, footer, and edge-to-edge child; animates the chrome
  in/out via showChrome and fades to an immersive background when
  hidden. Theme carries optional scoped appBarStyle / bottomAppBarStyle
  so descendant chrome bars can be tinted (e.g. light-on-dark over
  dark media) without touching app-wide themes.

- StreamBottomAppBar: bottom counterpart to StreamAppBar. Same
  three-slot layout (leading / heading / trailing), supports
  title + subtitle, top hairline border, SafeArea(top: false) when
  primary, and the same per-slot button style propagation.

Refactors:

- Rename StreamHeaderToolbar -> StreamToolbar — it's the shared layout
  primitive behind StreamAppBar, StreamBottomAppBar, and
  StreamSheetHeader, not specifically a "header" widget.
- Rename components/header/ -> components/toolbar/ (lib, gallery,
  tests) to match the unifying name.
- Drop the "48×48 slot for symmetry" claim from the toolbar widgets'
  docs. StreamToolbar actually mirrors the wider of leading / trailing
  on the opposite side — the 48×48 appearance comes from
  StreamButton.icon's kMinInteractiveDimension, not the bar.

Tests:

- New stream_bottom_app_bar_test.dart with slot, SafeArea, and
  three-level style precedence coverage modelled on the app bar test.

Widgetbook:

- New StreamMediaViewer Playground + Showcase following the
  StreamSheet launcher / section pattern.
- New StreamBottomAppBar Playground + Showcase with primary toggle
  and per-slot style propagation demo.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@xsahil03x xsahil03x requested a review from a team as a code owner May 12, 2026 02:05
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 12, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c535311e-38b2-4313-b9e5-2265dbc0b480

📥 Commits

Reviewing files that changed from the base of the PR and between 6ad76d2 and 5a11bb0.

📒 Files selected for processing (1)
  • packages/stream_core_flutter/CHANGELOG.md

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


📝 Walkthrough

<review_stack_artifact>

</review_stack_artifact>

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(ui): add StreamMediaViewer and StreamBottomAppBar' clearly and concisely describes the two primary new components being added, which aligns with the main changes in the changeset.
Description check ✅ Passed The PR description follows the template structure with a comprehensive Summary section covering the main changes, a detailed Test plan section with completion status, and clear explanations of the StreamMediaViewer, StreamBottomAppBar additions, the refactor work, and documentation fixes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/media-viewer

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
apps/design_system_gallery/lib/components/media_viewer/stream_media_viewer.dart (1)

1-360: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Fix formatting to unblock CI

dart format --set-exit-if-changed is failing on this file in the pipeline. Please run formatter and commit the formatted output.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@apps/design_system_gallery/lib/components/media_viewer/stream_media_viewer.dart`
around lines 1 - 360, The file fails dart format; run the Dart formatter and
commit the formatted file to satisfy CI. Open the file containing _sampleImages,
the _PlaygroundMediaViewer class (and its State _PlaygroundMediaViewerState),
and the top-level function _push, run `dart format .` (or `dart format
--set-exit-if-changed` locally) to apply the formatting changes, then stage and
commit the updated file so the pipeline passes.
apps/design_system_gallery/lib/components/toolbar/stream_bottom_app_bar.dart (1)

1-255: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Fix formatting to unblock CI

dart format --set-exit-if-changed is failing on this file in the pipeline. Please run formatter and commit the result so format:verify passes.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/design_system_gallery/lib/components/toolbar/stream_bottom_app_bar.dart`
around lines 1 - 255, This file fails dart format checks; run the Dart formatter
and commit the formatted changes so CI's format:verify passes. Specifically, run
`dart format .` (or `dart format --set-exit-if-changed
apps/design_system_gallery/lib/components/toolbar/stream_bottom_app_bar.dart`)
and commit the updated file; ensure formatting touches the top-level use cases
and widget classes such as buildStreamBottomAppBarPlayground,
buildStreamBottomAppBarShowcase, and class _BarExample so the file matches the
project's dartfmt rules.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@apps/design_system_gallery/lib/components/media_viewer/stream_media_viewer.dart`:
- Around line 19-23: The `@widgetbook.UseCase` annotations for the
StreamMediaViewer use cases incorrectly set path to '[Components]/Media Viewer';
update both occurrences of the annotation (the one above the StreamMediaViewer
use case and the second instance around the other use case) to use
component-specific paths like '[Components]/StreamMediaViewer' so the
StreamMediaViewer use cases are categorized correctly; locate the annotations by
the `@widgetbook.UseCase` decorator for the StreamMediaViewer component and change
the path value accordingly.
- Around line 255-259: The BoxDecoration used for the media viewer currently
sets a border via the border property which can cause rounded-corner clipping;
update the widget that uses BoxDecoration (the Container/decoration block
referencing colorScheme.backgroundSurface, BorderRadius.all(radius.lg), and
colorScheme.borderSubtle) by removing the border from that BoxDecoration and
instead add a foregroundDecoration property that uses a BoxDecoration containing
the Border.all(color: colorScheme.borderSubtle) and the same
BorderRadius.all(radius.lg), keeping the background color and radius in the
original decoration but moving the border to foregroundDecoration to avoid
clipping issues.

In
`@apps/design_system_gallery/lib/components/toolbar/stream_bottom_app_bar.dart`:
- Around line 10-14: Update the `@widgetbook.UseCase` annotations for the
StreamBottomAppBar use cases to use a component-specific path: change path:
'[Components]/Toolbar' (and the other occurrence at the block around the
StreamBottomAppBar use case near lines 94-98) to path:
'[Components]/StreamBottomAppBar'; locate the annotations attached to the
StreamBottomAppBar `@widgetbook.UseCase` declarations and replace the shared
bucket path with the component-specific string.
- Around line 244-248: The BoxDecoration in StreamBottomAppBar is currently
applying the border via the decoration property which can cause clipping
artifacts with rounded corners; remove the border from the decoration and
instead add a foregroundDecoration on the same widget (use BoxDecoration with
the same border color and the same BorderRadius) while leaving
colorScheme.backgroundSurface and the borderRadius in the original decoration;
this moves the border painting to the foreground and prevents clipping issues.

---

Outside diff comments:
In
`@apps/design_system_gallery/lib/components/media_viewer/stream_media_viewer.dart`:
- Around line 1-360: The file fails dart format; run the Dart formatter and
commit the formatted file to satisfy CI. Open the file containing _sampleImages,
the _PlaygroundMediaViewer class (and its State _PlaygroundMediaViewerState),
and the top-level function _push, run `dart format .` (or `dart format
--set-exit-if-changed` locally) to apply the formatting changes, then stage and
commit the updated file so the pipeline passes.

In
`@apps/design_system_gallery/lib/components/toolbar/stream_bottom_app_bar.dart`:
- Around line 1-255: This file fails dart format checks; run the Dart formatter
and commit the formatted changes so CI's format:verify passes. Specifically, run
`dart format .` (or `dart format --set-exit-if-changed
apps/design_system_gallery/lib/components/toolbar/stream_bottom_app_bar.dart`)
and commit the updated file; ensure formatting touches the top-level use cases
and widget classes such as buildStreamBottomAppBarPlayground,
buildStreamBottomAppBarShowcase, and class _BarExample so the file matches the
project's dartfmt rules.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 12fd7ff3-8c86-4351-8eb7-02d588a5ce7b

📥 Commits

Reviewing files that changed from the base of the PR and between da615a2 and 697b428.

📒 Files selected for processing (24)
  • apps/design_system_gallery/lib/app/gallery_app.directories.g.dart
  • apps/design_system_gallery/lib/components/media_viewer/stream_media_viewer.dart
  • apps/design_system_gallery/lib/components/toolbar/stream_app_bar.dart
  • apps/design_system_gallery/lib/components/toolbar/stream_bottom_app_bar.dart
  • apps/design_system_gallery/lib/components/toolbar/stream_sheet_header.dart
  • packages/stream_core_flutter/lib/src/components.dart
  • packages/stream_core_flutter/lib/src/components/media_viewer/stream_media_viewer.dart
  • packages/stream_core_flutter/lib/src/components/toolbar/stream_app_bar.dart
  • packages/stream_core_flutter/lib/src/components/toolbar/stream_bottom_app_bar.dart
  • packages/stream_core_flutter/lib/src/components/toolbar/stream_sheet_header.dart
  • packages/stream_core_flutter/lib/src/components/toolbar/stream_toolbar.dart
  • packages/stream_core_flutter/lib/src/factory/stream_component_factory.dart
  • packages/stream_core_flutter/lib/src/factory/stream_component_factory.g.theme.dart
  • packages/stream_core_flutter/lib/src/theme.dart
  • packages/stream_core_flutter/lib/src/theme/components/stream_bottom_app_bar_theme.dart
  • packages/stream_core_flutter/lib/src/theme/components/stream_bottom_app_bar_theme.g.theme.dart
  • packages/stream_core_flutter/lib/src/theme/components/stream_media_viewer_theme.dart
  • packages/stream_core_flutter/lib/src/theme/components/stream_media_viewer_theme.g.theme.dart
  • packages/stream_core_flutter/lib/src/theme/stream_theme.dart
  • packages/stream_core_flutter/lib/src/theme/stream_theme.g.theme.dart
  • packages/stream_core_flutter/lib/src/theme/stream_theme_extensions.dart
  • packages/stream_core_flutter/test/components/toolbar/stream_app_bar_test.dart
  • packages/stream_core_flutter/test/components/toolbar/stream_bottom_app_bar_test.dart
  • packages/stream_core_flutter/test/components/toolbar/stream_sheet_header_test.dart

The constant is shared by StreamAppBar, StreamBottomAppBar, and
StreamSheetHeader — none of which are headers in isolation. The new
name matches StreamToolbar, the underlying layout primitive.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

❌ Patch coverage is 44.05594% with 80 lines in your changes missing coverage. Please review.
✅ Project coverage is 34.03%. Comparing base (da615a2) to head (5a11bb0).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...c/components/media_viewer/stream_media_viewer.dart 0.00% 54 Missing ⚠️
...rc/theme/components/stream_media_viewer_theme.dart 9.09% 10 Missing ⚠️
.../theme/components/stream_bottom_app_bar_theme.dart 42.85% 8 Missing ⚠️
.../src/components/toolbar/stream_bottom_app_bar.dart 90.90% 5 Missing ⚠️
...tream_core_flutter/lib/src/theme/stream_theme.dart 0.00% 2 Missing ⚠️
...flutter/lib/src/theme/stream_theme_extensions.dart 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #113      +/-   ##
==========================================
+ Coverage   33.04%   34.03%   +0.99%     
==========================================
  Files         171      172       +1     
  Lines        6595     6588       -7     
==========================================
+ Hits         2179     2242      +63     
+ Misses       4416     4346      -70     

☔ View full report in Codecov by Sentry.
📢 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.

Pads the child by the header / footer preferred sizes (plus top / bottom
safe-area insets) so the content area never sits behind the chrome.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Comment thread packages/stream_core_flutter/lib/src/components/toolbar/stream_toolbar.dart Outdated
xsahil03x and others added 2 commits May 13, 2026 15:50
…_toolbar.dart

Co-authored-by: Rene Floor <rene.floor@getstream.io>
…mToolbar rename

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@xsahil03x xsahil03x merged commit 333f7b7 into main May 15, 2026
6 of 7 checks passed
@xsahil03x xsahil03x deleted the feat/media-viewer branch May 15, 2026 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants