Skip to content

Phase 7: add reaction-only chat list notifications#1235

Merged
osyed merged 18 commits intomainfrom
phase7-reaction-chat-list-notifications
Apr 9, 2026
Merged

Phase 7: add reaction-only chat list notifications#1235
osyed merged 18 commits intomainfrom
phase7-reaction-chat-list-notifications

Conversation

@dnlbui
Copy link
Copy Markdown
Collaborator

@dnlbui dnlbui commented Apr 8, 2026

Summary

  • add reaction-only unread bookkeeping to the chats flow so incoming reactions can affect chat-list badges and ordering without creating standalone message bubbles
  • update reaction storage/rendering to keep per-reaction timestamp metadata and use that to recompute chat-list state
  • add reaction target preview handling for calls and keep the chats tab notification bubble in sync with combined message + reaction unread counts

Why

Issue #1232 asks for reaction-only incoming updates to behave like edit-only updates for unread and chat-list notifications.

Impact

Users see reaction activity reflected in unread counts, the chats-tab notification dot, and chat-list ordering even when no new chat bubble is created.

Root Cause

Reaction control messages previously updated message reaction chips, but they did not fully participate in the chat-list unread/notification bookkeeping path.

Validation

  • reviewed the branch diff against main
  • no automated tests were run in this pass

Closes #1232

dnlbui added 10 commits April 8, 2026 09:24
…eactions

- Introduced functions to retrieve stored reaction emojis and timestamps, enhancing the management of user reactions.
- Updated the `applyIncomingReaction` function to accommodate optional timestamps for reactions.
- Refactored the chat modal to utilize the new emoji retrieval logic, improving clarity and consistency in reaction displays.
- Enhanced the `rebuildChatReactionPreview` function to ensure accurate representation of the latest reactions in chat.
…larity

- Updated the logic for determining the latest activity timestamp in chat reactions, ensuring accurate representation of user interactions.
- Simplified the handling of reaction previews by removing unnecessary action checks and enhancing the clarity of reaction text generation.
- Improved the `clearChatReactionPreview` function to manage timestamps more effectively, ensuring proper updates to chat states.
- Enhanced overall readability and maintainability of the chat reaction handling code.
- Simplified the logic for reading and managing stored reactions, enhancing the clarity of reaction data retrieval.
- Updated the `syncChatReactionPreview` and `rebuildChatReactionPreview` functions to streamline the process of updating chat reaction previews.
- Improved the handling of reaction timestamps and emoji retrieval, ensuring more accurate representation of user interactions.
- Enhanced overall readability and maintainability of the chat reaction handling code.
…agement

- Removed the `readStoredReaction` function to simplify reaction data retrieval, directly accessing reaction properties.
- Updated the `syncChatReactionPreview` function to compute the latest reaction state from message data, enhancing accuracy.
- Improved handling of emoji trimming and timestamp management across various functions, ensuring consistent representation of user interactions.
- Enhanced overall code clarity and maintainability in chat reaction processing.
… code clarity and maintainability. This cleanup enhances the overall readability of the `app.js` file by eliminating unnecessary explanations that are no longer relevant to the current implementation.
- Introduced comprehensive documentation for several functions related to chat reactions, including `applyIncomingReaction`, `getReactionTargetPreviewText`, `syncChatReactionPreview`, `getContactTotalUnread`, and `syncChatTabNotificationBubble`.
- Enhanced code clarity and maintainability by providing clear descriptions of function purposes and parameters, aiding future development and understanding of the chat reaction system.
…saction timestamp. This change ensures that the correct sent timestamp is used for both adding and removing reactions, enhancing the accuracy of reaction state updates.
- Updated the `getReactionTargetPreviewText` function to include a case for messages of type 'call', returning 'call' as the preview text.
- Removed redundant 'call' handling logic from the previous position in the function to streamline the code.
- Cleaned up comments in the `processChats` function to enhance clarity regarding notification handling for unread reactions.
- Simplified the handling of existing chats by using a single variable to manage chat updates.
- Enhanced timestamp management for chat updates, ensuring the latest message timestamp is accurately reflected.
- Cleaned up the logic for inserting chats to maintain proper order based on timestamps, improving overall clarity and maintainability of the chat processing code.
@dnlbui dnlbui marked this pull request as ready for review April 8, 2026 22:53
@dnlbui dnlbui marked this pull request as draft April 9, 2026 15:49
dnlbui added 5 commits April 9, 2026 11:28
- Introduced a one-time migration to ensure all stored contacts have a reaction array, enhancing data consistency.
- Refactored the `applyIncomingReaction` function to work with the new contact-level reactions structure.
- Updated related functions to utilize the new reaction management system, improving clarity and maintainability of the code.
- Enhanced the handling of reactions in chat processing, ensuring accurate updates and representation of user interactions.
- Added a flag to indicate changes in the reaction preview when a message is deleted, improving the accuracy of UI updates.
- Enhanced the logic for refreshing the upcoming calls UI based on deleted call messages, ensuring timely updates for users.
- Added logic to accurately count and adjust unread reaction notifications when a message is deleted, improving user experience in active chats.
- Updated the handling of contact reactions to ensure proper synchronization of reaction previews, enhancing the clarity of chat interactions.
- Updated the handling of chat reaction previews to ensure the latest valid reaction activity is displayed, enhancing user experience in chats.
- Simplified the logic for determining when to show reaction previews, improving clarity and maintainability of the code.
- Enhanced timestamp management for chat updates, ensuring accurate representation of the latest interactions.
- Adjusted the calculation of the latest item timestamp to prioritize the reaction preview timestamp when applicable, improving the accuracy of chat updates.
- Enhanced the clarity of the logic determining when to display the latest reaction activity, contributing to a better user experience in chats.
@dnlbui dnlbui marked this pull request as ready for review April 9, 2026 17:33
dnlbui added 3 commits April 9, 2026 12:50
… clarity

- Updated the function name to better reflect its purpose of synchronizing the latest activity timestamp in chat interactions.
- Adjusted all references to the renamed function throughout the codebase to maintain consistency and improve code readability.
…arrays

- Removed the one-time migration function for ensuring stored contacts have a reaction array, simplifying the codebase.
- Updated reaction handling to ensure proper checks for reaction arrays, enhancing robustness in chat interactions.
- Improved clarity in the logic for filtering and applying reactions, ensuring accurate updates in chat previews and interactions.
- Updated the payload assignment in the reaction handling logic to improve clarity and ensure the correct timestamp is used for reactions.
- Enhanced the destructuring of variables from the asynchronous function to streamline the code and maintain consistency in chat updates.
@osyed osyed merged commit 2896d9b into main Apr 9, 2026
1 check 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.

Phase 7: Add reaction-only chat list notifications like edit updates

2 participants