Skip to content

Commit 5073fed

Browse files
authored
fix(app): resolve workspace list reorder due to collapsible trigger (anomalyco#1711)
1 parent 96a92b5 commit 5073fed

1 file changed

Lines changed: 18 additions & 10 deletions

File tree

‎apps/app/src/react-app/domains/session/sidebar/app-sidebar.tsx‎

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,6 @@ function WorkspaceHeader({
575575
{isLoading ? (
576576
<Loader2 className="size-4 animate-spin text-muted-foreground transition-opacity group-hover/menu-item:opacity-0 group-hover/workspace-header:opacity-0" />
577577
) : null}
578-
<ChevronRight className="size-4 text-muted-foreground transition-transform duration-200 group-data-open/collapsible:rotate-90 hover:text-foreground" />
579578
</span>
580579
</SidebarMenuButton>
581580
);
@@ -664,15 +663,11 @@ function WorkspaceSidebarGroup({
664663
className="group/collapsible"
665664
>
666665
<div className="group/workspace-header relative">
667-
<CollapsibleTrigger
668-
render={
669-
<WorkspaceHeader
670-
workspace={workspace}
671-
statusLabel={statusLabel}
672-
isError={group.status === "error"}
673-
isLoading={group.status === "loading" || isConnecting}
674-
/>
675-
}
666+
<WorkspaceHeader
667+
workspace={workspace}
668+
statusLabel={statusLabel}
669+
isError={group.status === "error"}
670+
isLoading={group.status === "loading" || isConnecting}
676671
/>
677672
<div className="absolute right-8 top-1/2 flex -translate-y-1/2 items-center gap-1">
678673
<Button
@@ -695,6 +690,19 @@ function WorkspaceSidebarGroup({
695690
className="size-6 text-muted-foreground opacity-0 group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-popup-open:opacity-100"
696691
/>
697692
</div>
693+
<Button
694+
variant="ghost"
695+
size="icon"
696+
className="absolute right-1 top-1/2 size-6 -translate-y-1/2 text-muted-foreground hover:text-foreground"
697+
aria-label={isExpanded ? t("sidebar.collapse") : t("sidebar.expand")}
698+
aria-expanded={isExpanded}
699+
onClick={(e) => {
700+
e.stopPropagation();
701+
ctx.toggleWorkspaceExpanded(workspace.id);
702+
}}
703+
>
704+
<ChevronRight className={cn("size-4 transition-transform duration-200", isExpanded && "rotate-90")} />
705+
</Button>
698706
</div>
699707

700708
<CollapsibleContent className="pt-1">

0 commit comments

Comments
 (0)