Skip to content

feat(desktop): unify sidebar section actions into a per-section ⋮ menu#1577

Merged
wesbillman merged 4 commits into
mainfrom
kennylopez-section-actions-v2
Jul 7, 2026
Merged

feat(desktop): unify sidebar section actions into a per-section ⋮ menu#1577
wesbillman merged 4 commits into
mainfrom
kennylopez-section-actions-v2

Conversation

@klopez4212

Copy link
Copy Markdown
Contributor

What

Re-applies the sidebar section-actions work from #1424 (which was silently clobbered when #1428 merged an un-rebased stale copy) and extends it per Kenny's request: a single reusable SectionActionsMenu (⋮) component is now the rightmost action on every sidebar section — Channels, Forums, Direct messages, Starred, and custom sections.

Changes

  • Unified menu: New exported SectionActionsMenu renders items conditionally (mark-all-read, new message, browse, create, rename/move/delete section) and always appends a Sort radio group when a sort mode is supplied.
  • Folded in the Sort dropdown (feat(channel list): add persistent channel sort toggle #1505): deleted the standalone ChannelSortDropdown; sort now lives in the ⋮ menu.
  • Moved header actions into the menu: Browse channels / New channel / New forum / New message no longer render as standalone header icon buttons.
  • Removed the visible GripVertical grip from custom sections — dragHandleProps are retained, so drag-to-reorder still works.
  • deferMenuAction (setTimeout 0) runs a selected item on the next tick, avoiding the modal/pointer-events: none freeze from Tighten sidebar section actions #1424 when a menu item opens a dialog.
  • Keeps the feat(desktop): restore section icon/emoji picker #1516 emoji/icon picker on custom sections.
  • e2e: new bridge helpers openCreateChannelDialog / openNewDirectMessageDialog; updated channel-sort, channels, and identity-archive-hide specs to drive the menu.

Testing

  • just desktop-check (biome + typecheck + file-size + px-text guards) — clean
  • pnpm test — 1922/1922 unit tests pass
  • pnpm build (desktop frontend) — clean
  • channel-sort.spec e2e (4) + targeted create/DM e2e — pass

Notes

  • just ci currently fails on clean origin/main for reasons unrelated to this PR: pre-existing Tauri clippy errors (clippy 1.95.0) in src-tauri/src/archive/mod_tests.rs, personas/writeback.rs, managed_agents/config_bridge/claude.rs — none touched here. Verified identical failure on a fresh main build.
  • e2e channels.spec "scrollable channel … hides intro actions until top" also fails identically on clean origin/main (intro element stays in the DOM when scrolled away) — pre-existing, not a regression from this change.
  • Reconciles with feat(desktop): restore section icon/emoji picker #1516 (emoji picker retained).

Requested a code-checks review of the diff before merge.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f8fb74ca38

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread desktop/src/features/sidebar/ui/AppSidebar.tsx
npub13fn4ahfnvaa2qwylvegdgeajqs0mph6v4qsw4jcqnw4mjh3hzh2quuucm5 added 3 commits July 7, 2026 13:21
Re-applies the section-actions work from #1424 (silently clobbered by
#1428) and extends it: a single reusable SectionActionsMenu component now
renders the rightmost action for every sidebar section (Channels, Forums,
Direct messages, Starred, and custom sections).

- Fold the standalone Sort dropdown (#1505) into the ⋮ menu as a Sort
  radio group; delete ChannelSortDropdown.
- Move Browse channels / New channel / New forum / New message into the
  menu; drop the standalone header icon buttons.
- Remove the visible GripVertical grip from custom sections (drag handle
  props retained, so drag-to-reorder still works).
- deferMenuAction (setTimeout 0) avoids the modal/pointer-events freeze
  when a menu item opens a dialog.
- Keep the #1516 emoji/icon picker on custom sections.

Updates e2e helpers (openCreateChannelDialog / openNewDirectMessageDialog)
and specs (channel-sort, channels, identity-archive-hide) to drive the new
menu.

Signed-off-by: npub13fn4ahfnvaa2qwylvegdgeajqs0mph6v4qsw4jcqnw4mjh3hzh2quuucm5 <8a675edd33677aa0389f6650d467b2041fb0df4ca820eacb009babb95e3715d4@sprout-oss.stage.blox.sqprod.co>
…ns menu

Signed-off-by: npub13fn4ahfnvaa2qwylvegdgeajqs0mph6v4qsw4jcqnw4mjh3hzh2quuucm5 <8a675edd33677aa0389f6650d467b2041fb0df4ca820eacb009babb95e3715d4@sprout-oss.stage.blox.sqprod.co>
…into modules

CustomChannelSection.tsx had grown past the 1000-line file-size guard after
the section-actions and context-menu-formatting work. Extract two focused
modules so it drops back to ~450 lines:

- sidebarMenuHelpers.tsx: deferMenuAction (setTimeout-0 to avoid the Radix
  modal/pointer-events freeze) and ContextMenuIconSlot (fixed-width leading
  slot keeping context-menu labels left-aligned).
- ChannelContextMenu.tsx: ChannelContextMenuItems plus its MoveToSection and
  CopyChannel submenus, ported from #1424's right-click menu formatting.

SidebarSection.tsx now imports ChannelContextMenuItems from the new module.
No behavior change; typecheck, biome, and the file-size guard all pass.

Signed-off-by: npub13fn4ahfnvaa2qwylvegdgeajqs0mph6v4qsw4jcqnw4mjh3hzh2quuucm5 <8a675edd33677aa0389f6650d467b2041fb0df4ca820eacb009babb95e3715d4@sprout-oss.stage.blox.sqprod.co>
@klopez4212 klopez4212 force-pushed the kennylopez-section-actions-v2 branch from 79e2d98 to f070daf Compare July 7, 2026 12:29

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f070daf629

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread desktop/tests/e2e/channel-sort.spec.ts
…ort e2e

The section-actions work converted the inline Sort radio group into a
DropdownMenuSub flyout. The channel-sort smoke spec still clicked the ⋮
trigger and immediately asserted the sort menuitemradios were visible,
which now fails because the radios live behind the "Sort" submenu trigger.

Open the Sort submenu (`getByRole("menuitem", { name: "Sort" }).click()`)
in tests 02 and 04 before asserting/selecting the radio items. All four
channel-sort smoke tests pass locally.

Signed-off-by: npub13fn4ahfnvaa2qwylvegdgeajqs0mph6v4qsw4jcqnw4mjh3hzh2quuucm5 <8a675edd33677aa0389f6650d467b2041fb0df4ca820eacb009babb95e3715d4@sprout-oss.stage.blox.sqprod.co>
klopez4212 pushed a commit that referenced this pull request Jul 7, 2026
@klopez4212

Copy link
Copy Markdown
Contributor Author

Screenshots — sidebar section actions

Captured via just desktop-screenshot (mock bridge) on 0b76ec056.

Channels — per-section ⋮ menu

Mark all as read, Browse channels, and New channel folded into the menu;
Sort is now a submenu flyout (chevron). The hover-only + quick action sits
next to the ⋮.

01-channels-menu

Direct messages — per-section ⋮ menu

New message uses the Plus icon (was the compose glyph). Sort is a submenu
here too.

02-dm-menu

Sort submenu (flyout)

Opening Sort reveals the Recent / A–Z radio group as a flyout rather than
an inline group.

04-sort-submenu

Right-click channel context menu

Restored #1424 formatting: aligned icon slots, grouped Copy and
Move to section submenus, plus Mark unread / Mute channel / Star channel
/ Leave channel.

03-right-click-context-menu

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed on behalf of Wes — full notes in the Buzz review thread.

Verified: no stale references to deleted symbols/testids (ChannelSortDropdown, new-dm-trigger, channel-sort-trigger) anywhere on the branch head; dragHandleProps retained so custom-section drag-to-reorder still works with the grip glyph removed; ChannelContextMenuItems extraction is a faithful move with deliberate upgrades (onSelect + deferMenuAction, Copy submenu, aligned icon slots); per-section behavior parity holds for Starred/Channels/Forums/DMs/custom sections; e2e specs migrated via shared bridge helpers; merge-base only 1 commit behind main with no file overlap; CI fully green.

Non-blocking notes:

  1. MoveToSectionSubmenu callers pass ?? (() => {}) fallbacks after showMove already proved the handlers non-null — a narrowing guard would avoid the no-op lambdas.
  2. The ⋮ trigger keeps the hover-visibility class; while its portaled menu is open and the pointer moves into the menu, the trigger can fade out. A data-[state=open]:opacity-100 variant would pin it.

@wesbillman wesbillman merged commit d945617 into main Jul 7, 2026
44 of 47 checks passed
@wesbillman wesbillman deleted the kennylopez-section-actions-v2 branch July 7, 2026 14:29
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.

2 participants