Skip to content

refactor unread into controller - #2908

Merged
renefloor merged 3 commits into
worktree-unread-bannersfrom
refactor/extract-unread-controller
Aug 21, 2026
Merged

refactor unread into controller#2908
renefloor merged 3 commits into
worktree-unread-bannersfrom
refactor/extract-unread-controller

Conversation

@renefloor

Copy link
Copy Markdown
Contributor

Submit a pull request

FLU-672

CLA

  • I have signed the Stream CLA (required).
  • The code changes follow best practices
  • Code changes are tested (add some information if not applicable)

Description of the pull request

This is a follow up on #2871

That PR already has reviews, but unread logic was getting spread on a lot of places. Here we try to make the MLV clean again by extracting all the unread logic.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4b1e9e93-aaf3-409a-9f0f-221304f57d9e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@renefloor
renefloor marked this pull request as ready for review August 20, 2026 13:51
Iterable<ItemPosition> itemPositions, {
required bool isAtBottom,
}) {
_hasLaidOut.value = true;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we maybe have the if (itemPositions.isEmpty) return; guard here as well? We currently only have this guard before calling handleItemPositionsChanged in the message_list_view, but maybe we could introduce it here as an additional safeguard in case we introduce a new scenario where this method is called.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed: 1092b9d

bool get needsAnchorResolution => _unreadBaseline != null && _unreadDivider.value.anchorId == null;

/// Debounced channel mark-read.
late final debouncedMarkRead = debounce(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this can be private? (also debouncedMarkThreadRead)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed: 1092b9d

@renefloor
renefloor merged commit 07a0fbf into worktree-unread-banners Aug 21, 2026
7 of 11 checks passed
@renefloor
renefloor deleted the refactor/extract-unread-controller branch August 21, 2026 08:05
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