Skip to content

Optimize conversation unread message selectors#993

Draft
onuraycicek wants to merge 1 commit intoeigenwallet:masterfrom
onuraycicek:optimize-conversation-selectors
Draft

Optimize conversation unread message selectors#993
onuraycicek wants to merge 1 commit intoeigenwallet:masterfrom
onuraycicek:optimize-conversation-selectors

Conversation

@onuraycicek
Copy link
Copy Markdown

@onuraycicek onuraycicek commented May 10, 2026

Summary

  • Avoid constructing Set instances and wrapper objects inside useAppSelector for unread conversation counts.
  • Memoize unread-count calculations from stable Redux slices instead, so unrelated store updates do not force these consumers to re-render.
  • Reuse a stable empty messages array for missing conversations to avoid creating a fresh [] selector result.

Why

This targets the UI performance bounty in #727. The previous selectors returned new references on every Redux update even when conversations and seenMessages were unchanged, which makes React-Redux treat the selected value as changed and re-render subscribers unnecessarily.

Testing

  • corepack yarn tsc
  • corepack yarn eslint src/store/hooks.ts src/renderer/components/pages/help/ConversationsBox.tsx --quiet

@Einliterflasche
Copy link
Copy Markdown

Per our AI policy we require all communication to be exclusively human written. Until this requirement is met, we can't spare the effort to review this.

@Einliterflasche Einliterflasche marked this pull request as draft May 11, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants