Skip to content

fix(sidebar): non-selectable channel names + copy/leave context menu actions#1260

Open
tellaho wants to merge 2 commits into
mainfrom
tho/sidebar-select-none-context-menu
Open

fix(sidebar): non-selectable channel names + copy/leave context menu actions#1260
tellaho wants to merge 2 commits into
mainfrom
tho/sidebar-select-none-context-menu

Conversation

@tellaho

@tellaho tellaho commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Category: improvement
User Impact: Sidebar channel names no longer highlight when you drag across them, and right-clicking a channel now offers Copy channel name, Copy channel ID, and Leave channel (with a confirmation step).

Problem: Channel names in the sidebar were text-selectable, so dragging the cursor across them highlighted the text — a small but persistent annoyance. There was also no quick path to copy a channel name or ID, or to leave a channel, from the sidebar.

Solution: Added select-none to the channel-name span to stop the highlight-on-drag. Extended the shared channel context menu with three new actions — Copy channel name, Copy channel ID, and a destructive Leave channel that confirms via the standard shadcn AlertDialog before acting. Copy actions render unconditionally; Leave is gated on an onLeaveChannel prop and wired only to stream sections (DMs get copy-only, forums get neither). Leave state/mutation/dialog were extracted into a useLeaveChannelDialog() hook to keep AppSidebar under the 1000-line file-size limit.

File changes

desktop/src/features/sidebar/ui/SidebarSection.tsx
Added select-none to the channel-name truncate span so dragging no longer selects the text.

desktop/src/features/sidebar/ui/CustomChannelSection.tsx
Added Copy channel name, Copy channel ID, and Leave channel items to the shared ChannelContextMenuItems. Copy actions are always present; Leave is gated on onLeaveChannel.

desktop/src/features/sidebar/ui/ChannelSectionDialogs.tsx
New useLeaveChannelDialog() hook owning the leave target state, useLeaveChannelMutation, and the shadcn confirm dialog. Returns { requestLeaveChannel, dialog }.

desktop/src/features/sidebar/ui/AppSidebar.tsx
Wired the leave dialog hook in and passed onLeaveChannel to stream sections. Stays under the file-size cap (994 lines).

Reproduction Steps

  1. Run the desktop app.
  2. In the sidebar, drag your cursor across a channel name — the text should no longer highlight.
  3. Right-click a stream channel — you should see Copy channel name, Copy channel ID, and Leave channel.
  4. Click Leave channel — a shadcn confirmation dialog with destructive styling appears before anything happens.
  5. Right-click a DM (copy actions only, no Leave) and a forum entry (neither) to confirm gating.

Screenshots/Demos

Screen.Recording.2026-06-24.at.6.08.30.PM.mov

Context menu with the three new actions:
9f59317a06285f6ffc909589f5ff85e3a6c54172fc50a09a1a96114101d88306

Leave-channel shadcn AlertDialog confirm (destructive styling):
462d24325f080f3c6d0bc3ff1efbcf0933d6a59e110743bc168ad9584449ee6b

tellaho and others added 2 commits June 24, 2026 17:30
… actions

Add select-none to the sidebar channel-name span so dragging no longer highlights names. Extend the shared channel context menu with Copy channel name, Copy channel ID, and a destructive Leave channel action (standard shadcn confirm dialog). Leave logic extracted into a useLeaveChannelDialog hook to keep AppSidebar under the file-size limit. Copy actions render unconditionally; leave is gated on the onLeaveChannel prop and wired only to stream sections.

Co-authored-by: npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w <52a228d6edf316ec6812ac3c9fc0d696ab59fc7954d77e7be31eedcddf91335b@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Hoist select-none onto the three sidebar SidebarGroup containers so section/group headers, unread count + dot badges, and DM participant-count badges no longer highlight on cursor-drag. Drops the now-redundant per-span select-none on the channel-name span (the container covers it everywhere ChannelMenuButton renders).

Co-authored-by: npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w <52a228d6edf316ec6812ac3c9fc0d696ab59fc7954d77e7be31eedcddf91335b@sprout-oss.stage.blox.sqprod.co>
Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
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.

1 participant