fixes issues with selected email optimistic updates#1146
fixes issues with selected email optimistic updates#1146BlankParticle merged 1 commit intostagingfrom
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Merge activity
|
Improved mail list hotkey functionality by adding a `shouldUseHover` flag to determine when to use hover actions versus bulk selection actions. - Added a `shouldUseHover` flag that checks if bulk selection is empty - Updated hotkey handlers (markAsRead, markAsUnread, archiveEmail) to use this flag when determining whether to act on hovered email or selected emails - Removed unused imports and functions: - Removed `useQueryClient`, `useTRPC`, `useStats` imports - Removed `refetch`, `mutateStats`, `invalidateCount` functions - Removed a console.log statement in the selectAll function - Updated dependency arrays in useCallback hooks to include the new `shouldUseHover` flag 1. Test mail list hotkeys with no emails selected: - Hover over an email and use keyboard shortcuts to mark as read/unread or archive - Verify actions apply only to the hovered email 2. Test mail list hotkeys with emails selected: - Select multiple emails and use keyboard shortcuts - Verify actions apply to all selected emails regardless of hover state This change improves the user experience by making the hotkey behavior more predictable and intuitive. When users have explicitly selected emails, actions should apply to those selections. When no emails are selected, actions should apply to the currently hovered email. This creates a more consistent interaction model and prevents accidental operations on unintended emails.

TL;DR
Improved mail list hotkey functionality by adding a
shouldUseHoverflag to determine when to use hover actions versus bulk selection actions.What changed?
shouldUseHoverflag that checks if bulk selection is emptyuseQueryClient,useTRPC,useStatsimportsrefetch,mutateStats,invalidateCountfunctionsshouldUseHoverflagHow to test?
Test mail list hotkeys with no emails selected:
Test mail list hotkeys with emails selected:
Why make this change?
This change improves the user experience by making the hotkey behavior more predictable and intuitive. When users have explicitly selected emails, actions should apply to those selections. When no emails are selected, actions should apply to the currently hovered email. This creates a more consistent interaction model and prevents accidental operations on unintended emails.