Skip to content

Conversation

@AleksandrLarin-Ardas
Copy link
Contributor

@AleksandrLarin-Ardas AleksandrLarin-Ardas commented Oct 21, 2025

CLA

  • I have signed the Stream CLA (required).
  • The code changes follow best practices
  • Code changes are tested

Description of the pull request

Summary by CodeRabbit

  • New Features
    • StreamMessageListView now supports an optional customization for the floating date divider, letting apps supply a custom widget for the floating divider.
    • If no custom floating divider is provided, the control falls back to the existing date divider appearance to preserve backward compatibility.
    • The change is exposed through the component's public API so it can be configured by consumers.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 21, 2025

Walkthrough

Adds a new public builder parameter floatingDateDividerBuilder to StreamMessageListView, stores it as a public field, and forwards it to FloatingDateDivider, falling back to dateDividerBuilder when not provided.

Changes

Cohort / File(s) Summary
Message List View Enhancement
packages/stream_chat_flutter/lib/src/message_list_view/message_list_view.dart
Added public floatingDateDividerBuilder parameter (Widget Function(DateTime)?) to StreamMessageListView constructor and corresponding public field; forwarded it into FloatingDateDivider and used dateDividerBuilder as fallback when absent.
Changelog
packages/stream_chat_flutter/CHANGELOG.md
Documented new public API StreamMessageListView.floatingDateDividerBuilder in release notes.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant App as App / Widget tree
    participant ListView as StreamMessageListView
    participant Floating as FloatingDateDivider

    Note over ListView: new field\nfloatingDateDividerBuilder
    App->>ListView: build()
    ListView->>Floating: instantiate(floatingDateDividerBuilder, dateDividerBuilder)
    alt floatingDateDividerBuilder provided
        Floating->>Floating: render using floatingDateDividerBuilder(DateTime)
    else fallback
        Floating->>Floating: render using dateDividerBuilder(DateTime)
    end
    Floating-->>ListView: widget
    ListView-->>App: composed UI
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • renefloor

Poem

🐰 A builder hops into view,
Floating dates wear something new,
Supply a style and watch it glide,
Or let the default still preside,
Hooray — the list is dressed anew!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "feat(ui): Add floating date divider builder" directly and accurately describes the main change in the changeset. The pull request adds a new public constructor parameter and field floatingDateDividerBuilder to StreamMessageListView to allow customization of the floating date divider, which is exactly what the title conveys. The title is concise, specific, and uses clear language without vague terms or noise, making it immediately understandable to someone reviewing the git history.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ 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.

Copy link
Contributor

@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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between fe326e7 and aff514d.

📒 Files selected for processing (2)
  • packages/stream_chat_flutter/lib/src/message_list_view/floating_date_divider.dart (3 hunks)
  • packages/stream_chat_flutter/lib/src/message_list_view/message_list_view.dart (3 hunks)
🔇 Additional comments (2)
packages/stream_chat_flutter/lib/src/message_list_view/floating_date_divider.dart (1)

21-21: LGTM! Consistent parameter rename.

The rename from dateDividerBuilder to floatingDateDividerBuilder improves clarity and distinguishes this builder from the regular date divider builder. The change is applied consistently across the constructor, field declaration, and usage site.

Also applies to: 46-46, 70-70

packages/stream_chat_flutter/lib/src/message_list_view/message_list_view.dart (1)

98-98: LGTM! New parameter added correctly.

The floatingDateDividerBuilder parameter is properly declared with clear documentation distinguishing it from the regular dateDividerBuilder. The separation of concerns between regular and floating date dividers is well-designed.

Also applies to: 245-247

@AleksandrLarin-Ardas AleksandrLarin-Ardas changed the title Add floating date divider builder. feat (ui): Add floating date divider builder. Oct 21, 2025
@AleksandrLarin-Ardas AleksandrLarin-Ardas changed the title feat (ui): Add floating date divider builder. feat(ui): Add floating date divider builder. Oct 21, 2025
Copy link
Contributor

@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: 0

🧹 Nitpick comments (1)
packages/stream_chat_flutter/test/src/message_list_view/floating_date_divider_test.dart (1)

142-143: Update test description to match renamed parameter.

The test description references "dateDividerBuilder" but the parameter was renamed to "floatingDateDividerBuilder". Update the description for consistency.

Apply this diff:

-    testWidgets(
-      'renders custom dateDividerBuilder when provided',
-      (tester) async {
+    testWidgets(
+      'renders custom floatingDateDividerBuilder when provided',
+      (tester) async {
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between aff514d and 978ec07.

📒 Files selected for processing (1)
  • packages/stream_chat_flutter/test/src/message_list_view/floating_date_divider_test.dart (1 hunks)
🔇 Additional comments (1)
packages/stream_chat_flutter/test/src/message_list_view/floating_date_divider_test.dart (1)

163-169: LGTM! Builder parameter rename is correct.

The parameter rename from dateDividerBuilder to floatingDateDividerBuilder aligns with the PR objectives, and the test correctly verifies that the custom builder is used instead of the default StreamDateDivider.

@codecov
Copy link

codecov bot commented Oct 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.93%. Comparing base (fe326e7) to head (ab25375).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2422   +/-   ##
=======================================
  Coverage   63.93%   63.93%           
=======================================
  Files         413      413           
  Lines       25925    25926    +1     
=======================================
+ Hits        16575    16576    +1     
  Misses       9350     9350           

☔ 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.

Copy link
Contributor

@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: 0

🧹 Nitpick comments (1)
packages/stream_chat_flutter/lib/src/message_list_view/message_list_view.dart (1)

245-247: LGTM! Consider enhancing documentation (optional).

The field declaration is correct and type-consistent with dateDividerBuilder. For improved developer experience, consider adding a brief note about the fallback behavior (e.g., "Defaults to dateDividerBuilder when not provided").

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 33367b6 and 051480d.

📒 Files selected for processing (2)
  • packages/stream_chat_flutter/CHANGELOG.md (1 hunks)
  • packages/stream_chat_flutter/lib/src/message_list_view/message_list_view.dart (3 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/stream_chat_flutter/CHANGELOG.md
🔇 Additional comments (2)
packages/stream_chat_flutter/lib/src/message_list_view/message_list_view.dart (2)

98-98: LGTM!

The parameter is correctly positioned and follows the established pattern for builder parameters in this widget.


860-861: LGTM! Backward compatibility handled correctly.

The fallback to dateDividerBuilder ensures existing code continues to work without modification, as suggested in previous review feedback.

Copy link
Contributor

@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: 0

🧹 Nitpick comments (1)
packages/stream_chat_flutter/lib/src/message_list_view/message_list_view.dart (1)

98-98: Consider adding test coverage for the new parameter.

The implementation is correct and follows best practices. However, as noted in previous reviews, test coverage for the floatingDateDividerBuilder parameter is still missing. Consider adding widget tests that verify:

  • Custom builder is invoked when provided
  • Falls back to dateDividerBuilder when floatingDateDividerBuilder is null
  • Falls back to default StreamDateDivider when both are null

Also applies to: 245-249, 862-865

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 9adfbdb and ab25375.

📒 Files selected for processing (2)
  • packages/stream_chat_flutter/CHANGELOG.md (1 hunks)
  • packages/stream_chat_flutter/lib/src/message_list_view/message_list_view.dart (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/stream_chat_flutter/CHANGELOG.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: analyze_legacy_versions
  • GitHub Check: stream_chat_localizations
  • GitHub Check: stream_chat_flutter_core
  • GitHub Check: stream_chat
  • GitHub Check: stream_chat_persistence
  • GitHub Check: stream_chat_flutter
  • GitHub Check: build (ios)
  • GitHub Check: test
  • GitHub Check: build (android)
  • GitHub Check: format
  • GitHub Check: analyze
🔇 Additional comments (3)
packages/stream_chat_flutter/lib/src/message_list_view/message_list_view.dart (3)

98-98: Parameter addition looks good.

The new floatingDateDividerBuilder parameter is correctly added to the constructor and follows the existing pattern for optional builder parameters.


245-249: Well-documented parameter.

The documentation clearly explains the purpose and fallback behavior of the floatingDateDividerBuilder parameter. The type signature is consistent with dateDividerBuilder.


862-865: Fallback implementation is correct.

The switch expression properly implements the fallback behavior to dateDividerBuilder when floatingDateDividerBuilder is not provided, ensuring backward compatibility. This addresses the feedback from the previous review.

@xsahil03x xsahil03x merged commit 5351be6 into GetStream:master Oct 22, 2025
19 checks passed
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