From d2ad1aabe09662162297f83abf77e10eb8eb195e Mon Sep 17 00:00:00 2001 From: Wes Date: Fri, 8 May 2026 09:19:38 -0700 Subject: [PATCH 1/2] fix(desktop): clean up channel management sidebar layout and UX - Remove redundant section labels ("Details", "Topic and Purpose", etc.) - Fix member count to use actual members query data - Move canvas section to top of sidebar - Convert topic/purpose to single-line inputs - Move leave button to bottom row: [Leave] [Archive] [spacer] [Delete] - Move create workflow button from top bar into sidebar - Remove redundant section descriptions throughout - Right-align delete button in danger zone row Co-Authored-By: Claude Opus 4.6 --- .../channels/ui/ChannelManagementSheet.tsx | 563 ++++++++---------- .../channels/ui/ChannelMembersBar.tsx | 26 +- 2 files changed, 258 insertions(+), 331 deletions(-) diff --git a/desktop/src/features/channels/ui/ChannelManagementSheet.tsx b/desktop/src/features/channels/ui/ChannelManagementSheet.tsx index 6685fb580..94fe032c9 100644 --- a/desktop/src/features/channels/ui/ChannelManagementSheet.tsx +++ b/desktop/src/features/channels/ui/ChannelManagementSheet.tsx @@ -8,6 +8,7 @@ import { Lock, MessageSquare, Users, + Zap, } from "lucide-react"; import * as React from "react"; @@ -24,6 +25,7 @@ import { useUpdateChannelMutation, } from "@/features/channels/hooks"; import { compareMembersByRole } from "@/features/channels/lib/memberUtils"; +import { CreateWorkflowDialog } from "@/features/workflows/ui/CreateWorkflowDialog"; import type { Channel } from "@/shared/api/types"; import { AlertDialog, @@ -56,27 +58,6 @@ type ChannelManagementSheetProps = { open: boolean; }; -function Section({ - title, - description, - children, -}: React.PropsWithChildren<{ - title: string; - description?: string; -}>) { - return ( -
-
-

{title}

- {description ? ( -

{description}

- ) : null} -
- {children} -
- ); -} - function MetadataPill({ icon: Icon, label, @@ -138,17 +119,15 @@ export function ChannelManagementSheet({ detail?.channelType !== "dm" && !isArchived && selfMember !== null; - const showAccessSection = - canJoin || - canLeave || - joinChannelMutation.error instanceof Error || - leaveChannelMutation.error instanceof Error; + const memberCount = + members.length || detail?.memberCount || channel?.memberCount || 0; const [nameDraft, setNameDraft] = React.useState(""); const [descriptionDraft, setDescriptionDraft] = React.useState(""); const [topicDraft, setTopicDraft] = React.useState(""); const [purposeDraft, setPurposeDraft] = React.useState(""); const [isDeleteDialogOpen, setIsDeleteDialogOpen] = React.useState(false); + const [isCreateWorkflowOpen, setIsCreateWorkflowOpen] = React.useState(false); // Sync drafts from server only when the sheet opens or the channel changes — // not on every background refetch, which would clobber in-flight edits. @@ -158,6 +137,7 @@ export function ChannelManagementSheet({ // Reset on close so the next open re-syncs from server. syncedForRef.current = null; setIsDeleteDialogOpen(false); + setIsCreateWorkflowOpen(false); return; } if (!detail) { @@ -214,13 +194,11 @@ export function ChannelManagementSheet({ side="right" > -
- {channel.name} - - Manage channel settings, membership, and access. - -
-
+ {channel.name} + + Channel settings + +
- + {isArchived ? ( ) : null} @@ -258,29 +233,177 @@ export function ChannelManagementSheet({

) : null} - {showAccessSection ? ( -
+ + {joinChannelMutation.error instanceof Error ? ( +

+ {joinChannelMutation.error.message} +

+ ) : null} +
+ ) : null} + + + +
{ + event.preventDefault(); + void updateChannelMutation.mutateAsync({ + description: descriptionDraft.trim() || undefined, + name: nameDraft.trim() || undefined, + }); + }} + > +
+ + setNameDraft(event.target.value)} + value={nameDraft} + /> +
+
+ +