feat(sidebar): add More unread floating buttons#771
Merged
Conversation
Add Slack-style floating pill buttons to the sidebar that appear when there are unread channels above or below the visible scroll area. Clicking scrolls to the next unread channel without selecting it. - New useUnreadOverflow hook using IntersectionObserver + MutationObserver to track which unread channel rows are above/below the SidebarContent scroll viewport - MoreUnreadButton component renders top/bottom pills with counts - Wraps SidebarContent in a relative container for absolute positioning - Matches existing Jump to latest button styling Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Collaborator
Author
The absolute-positioned pill with pointer-events-auto was overlapping channel rows at the bottom of the sidebar, causing E2E test failures (Playwright couldn't click channel-random because the pill intercepted). Fix: render pills as flex siblings above/below SidebarContent instead of absolute-positioned overlays. They take their natural height and the scroll content shrinks to accommodate, so they never overlap clickable channel rows. Signed-off-by: Wes <wesbillman@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Adds Slack-style "More unread" floating pill buttons to the sidebar. When unread channels are scrolled out of view above or below the visible area, a directional pill appears showing the count and scrolling to the nearest off-screen unread on click.
What changed
desktop/src/features/sidebar/lib/useUnreadOverflow.tsdesktop/src/features/sidebar/ui/MoreUnreadButton.tsxdesktop/src/features/sidebar/ui/AppSidebar.tsxBehavior
unreadChannelIdsNIT (not addressed — not worth the churn)
deriveCountsrecomputesgetRelativeTopfrom the element rather than caching — keeps logic simpler and avoids stale-position bugs.Testing
pnpm --dir desktop typecheck✅pnpm --dir desktop lint✅pnpm --dir desktop test✅