feat(video): theme the call control badge from its design tokens - #1338
feat(video): theme the call control badge from its design tokens#1338renefloor wants to merge 3 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (9)
📒 Files selected for processing (14)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe PR replaces ChangesCall button badge theming
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant CallControlButton
participant StreamCallButtonBadge
participant StreamVideoTheme
participant StreamCallButtonBadgeTheme
participant StreamErrorBadge
CallControlButton->>StreamCallButtonBadge: build call-control child
StreamCallButtonBadge->>StreamVideoTheme: read callButtonBadgeTheme
StreamCallButtonBadge->>StreamCallButtonBadgeTheme: merge local theme and style
StreamCallButtonBadge->>StreamErrorBadge: render resolved badge
StreamCallButtonBadge-->>CallControlButton: return child or badge Stack
Merge Risk: ⚪ Minimal · up to This change themes the call-control badge with design-system tokens and renames the internal badge widget to a public 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v2 #1338 +/- ##
=====================================
Coverage ? 31.23%
=====================================
Files ? 375
Lines ? 28824
Branches ? 0
=====================================
Hits ? 9002
Misses ? 19822
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
b369e03 to
bbb9bba
Compare
The design system gave the call control badge its own tokens,
control/call-control-error-badge/bg -> {accent.warning} and /text ->
{base.black}. The badge was drawing the shared error style: red with a
dark border, which disappears into a red control and loses its edge
over video in either mode. It now defaults to the warning style with
no border, which separates from whatever sits underneath.
Adds StreamCallButtonBadgeTheme, ThemeData and Style, served from
StreamVideoTheme.callButtonBadgeTheme, carrying the severity, size,
border and overhang. Colors are not repeated here — they resolve from
core's StreamErrorBadgeTheme, so an app retheming the badge does it in
one place.
Having its own token makes the badge part of the design-system
surface, so CallButtonBadge becomes StreamCallButtonBadge and is
exported again. That reverses the de-export on this branch, whose
changelog entry is rewritten accordingly.
Repoints the stream_core_flutter override at the core commit adding
StreamErrorBadge's warning style. stream_core stays on its existing
pin: it is a separate git dependency, and moving it would pull in
unrelated error-layer changes from core main.
Tests are +269 -34, identical to clean v2 — those 34 pre-date this
branch.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
bdfd8d0 to
1d0a033
Compare
…rhang Moves `StreamCallButtonBadgeStyleDefaults` into the widget file as a private `_StreamCallButtonBadgeStyleDefaults`, per the convention that defaults live in the widget. It had one consumer, unlike the three standalone defaults files that are each shared with a second widget. Private also puts the defaults out of reach of a theme, where the generated `runtimeType`-gated equality would report every rebuild as a change. Renames `StreamCallButtonBadgeStyle.alignmentOffset` to `overhang`: the badge's position is pinned by `PositionedDirectional` and the style cannot move it, and `alignmentOffset` elsewhere in this package is an `Offset` on a menu anchor. Trims the field docs to what the code does — "if null, X" rather than a constructor default the constructor does not have — and drops the claim that the error badge's border is dark in either mode, which is not so in light mode and does not apply while `showBorder` is false. Drops `showBorder: true` from the theme snippet, which contradicted the doc twelve lines below it. Adds tests for the three resolution paths the theme introduced: the `StreamVideoTheme` wiring through `copyWith`, `merge` and `lerp`, local-over- global precedence in `of`, and `style` beating the theme per property. Also pins the defaults and the RTL overhang. Drops a no-op `??` in the `StreamVideoTheme` factory, and records the badge repaint and the `accentWarning` token change in the changelog. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The design system gave the call control badge its own tokens —
control/call-control-error-badge/bg→{accent.warning}and/text→{base.black}(design-system-tokens#73).The badge was drawing the shared error style: red with a dark border, which disappears into a red control and loses its edge over video in either mode. It now defaults to the warning style with no border, which separates from whatever sits underneath.
What's here
StreamCallButtonBadgeTheme,StreamCallButtonBadgeThemeDataandStreamCallButtonBadgeStyle, served fromStreamVideoTheme.callButtonBadgeTheme, carrying the severity, size, border and overhang.Colors are deliberately not repeated here — they resolve from core's
StreamErrorBadgeTheme, so an app retheming the badge does it in one place rather than two that can disagree.🚩 This reverses a decision on this branch
CallButtonBadgeis nowStreamCallButtonBadgeand exported again. TheUpcomingchangelog onv2argued the opposite:The reasoning for reversing it: having its own design token makes the badge part of the design-system surface, not only an internal detail of the two call buttons — so it takes the
Streamprefix and ships with a theme. I have rewritten that changelog entry, but whoever wrote it should weigh in, since this undoes their change deliberately rather than by accident.Dependency override
stream_core_flutteris repointed at a commit on the core companion PR, which addsStreamErrorBadge's warning style. So that PR merges first, and this override then wants repointing at the resultingmaincommit.stream_core's git override is gone from the lockfile. The rootpubspec.yamlonv2no longer declares one, sov2's lock was stale; regenerating it resolves the publishedstream_core 0.5.0. A freshflutter pub getreproduces the committed lock byte for byte.The core bump also moves the
accentWarningtoken:#F26D10 → #F6BF57light,#FA922B → #FCD579dark. That repaints the fair bars onStreamConnectionQualityIndicatoras well as the badge, which is why its goldens changed too.Tests
449 pass. Three goldens fail on a macOS host — 1px, 59px and 66px, ±1 per channel — which is Linux-vs-host rasterization against the committed
goldens/ciPNGs, not a regression; they fail identically on a cleanv2worktree. Analyze and format are clean.Summary by CodeRabbit
StreamCallButtonBadgewidget for displaying call error badges.CallButtonBadgename withStreamCallButtonBadge.