Skip to content

fix(ui): modify closed captions and recording options to use partial call state builder#1180

Open
mboyamike wants to merge 3 commits intoGetStream:mainfrom
mboyamike:main
Open

fix(ui): modify closed captions and recording options to use partial call state builder#1180
mboyamike wants to merge 3 commits intoGetStream:mainfrom
mboyamike:main

Conversation

@mboyamike
Copy link

@mboyamike mboyamike commented Mar 1, 2026

🎯 Goal

Options like the ToggleCameraOption use the partial call state builder. This helps them be reactive to the state of the call.
The recording option and closed captions option check the state at build. This has the potential to show stale information after some time. The goal of this change is to have both use the partial call state builder to be consistent with the other options and ensure they are reactive

🛠 Implementation details

Uses the callstatebuilder to check for recording and closed captions

🎨 UI Changes

No UI change.

🧪 Testing

Generally use the streamcallcontainer on a call, and have its call controls include a recording/closed captions option.
Change any of those states from a different device and see them also react to the change

☑️Contributor Checklist

General

  • Assigned a person / code owner group (required)
  • Thread with the PR link started in a respective Slack channel (#flutter-team) (required)
  • PR is linked to the GitHub issue it resolves

☑️Reviewer Checklist

  • Sample runs & works
  • UI Changes correct (before & after images)
  • Bugs validated (bugfixes)
  • New feature tested and works
  • All code we touched has new or updated Documentation

Summary by CodeRabbit

  • Refactor
    • Improved state management efficiency for closed captions and recording toggle controls to ensure responsive updates.

This makes the call recording option button be more consistent with the other buttons.
It also has the benefit of making it reactive to changes in state of recording
This makes the closed captions option button consisted with the other control options, as well as making it more reactive to the call state
@mboyamike mboyamike requested a review from a team as a code owner March 1, 2026 16:57
@coderabbitai
Copy link

coderabbitai bot commented Mar 1, 2026

📝 Walkthrough

Walkthrough

Two call control widgets refactored to use PartialCallStateBuilder pattern, replacing direct synchronous state access with reactive state subscription through selectors. Functionality and public APIs remain unchanged.

Changes

Cohort / File(s) Summary
State Access Refactoring
packages/stream_video_flutter/lib/src/call_controls/controls/toggle_closed_captions_option.dart, toggle_recording_option.dart
Replaced direct state access with PartialCallStateBuilder to enable reactive subscription to isCaptioning and isRecording state changes via selectors. Icon, colors, callbacks, and control logic remain functionally identical.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 State flows now smooth like carrot juice,
Builder patterns keep things loose,
Reactive whiskers twitch with glee,
Direct access? No more we see!
Refactored hops, a cleaner way. 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description covers all critical sections: goal, implementation details, UI changes, and testing instructions. While contributor and reviewer checklists are incomplete, core content is comprehensive.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately describes the main change: modifying closed captions and recording options to use PartialCallStateBuilder for reactive state updates.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@mboyamike mboyamike changed the title stream_video_flutter: Modify Closed captions option and recording option to use the partial call state builder fix: (stream_video_flutter) Modify Closed captions option and recording option to use the partial call state builder Mar 1, 2026
@mboyamike mboyamike changed the title fix: (stream_video_flutter) Modify Closed captions option and recording option to use the partial call state builder fix(ui): modify closed captions and recording options to use partial call state builder Mar 2, 2026
@mboyamike
Copy link
Author

Semantic changelog update is failing, but I'm not sure if that's something I should change as an outside contributor

@Brazol
Copy link
Contributor

Brazol commented Mar 6, 2026

Hi @mboyamike, thanks for taking the time to contribute this! The change you propose makes sense.

If you’re okay spending a bit more time on it, please run dart format to fix the formatting and add a short description of the change in the stream_video_flutter/CHANGELOG.md.

If you’d prefer not to spend any more time on this, just let us know. We can open a separate PR that builds on your changes. Thanks again!

@mboyamike
Copy link
Author

Thanks for checking it out @Brazol

Yeah I can do so. Should the changelog entry be in version 1.3.0 or should I start a 1.3.1?

@mboyamike
Copy link
Author

Cause of the latency in communication, I think it'll be faster if you just did it from your side

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