@@ -16,6 +16,8 @@ import { useState } from "react";
1616import { useMutationActivateWorkspace } from "../hooks/use-mutation-activate-workspace" ;
1717import clsx from "clsx" ;
1818import { useActiveWorkspaceName } from "../hooks/use-active-workspace-name" ;
19+ import { hrefs } from "@/lib/hrefs" ;
20+ import { twMerge } from "tailwind-merge" ;
1921
2022export function WorkspacesSelection ( ) {
2123 const queryClient = useQueryClient ( ) ;
@@ -46,7 +48,7 @@ export function WorkspacesSelection() {
4648 < ChevronDown />
4749 </ Button >
4850
49- < Popover className = "w-1/4 p-4 " placement = "bottom left" >
51+ < Popover className = "w-[32rem] p-3 " placement = "bottom left" >
5052 < div >
5153 < div >
5254 < SearchField
@@ -65,7 +67,7 @@ export function WorkspacesSelection() {
6567 onAction = { ( v ) => {
6668 handleWorkspaceClick ( v ?. toString ( ) ) ;
6769 } }
68- className = "py-2 pt-3 max-h-80 overflow-auto"
70+ className = "-mx-1 my-2 max-h-80 overflow-auto"
6971 renderEmptyState = { ( ) => (
7072 < p className = "text-center" > No workspaces found</ p >
7173 ) }
@@ -74,16 +76,36 @@ export function WorkspacesSelection() {
7476 < ListBoxItem
7577 id = { item . name }
7678 key = { item . name }
79+ textValue = { item . name }
7780 data-is-selected = { item . name === activeWorkspaceName }
7881 className = { clsx (
79- "cursor-pointer py-2 m-1 text-base hover:bg-gray-300 " ,
82+ "grid grid-cols-[auto_1.5rem] group/selector cursor-pointer py-2 m-1 text-base hover:bg-gray-200 rounded-sm " ,
8083 {
8184 "!bg-gray-900 hover:bg-gray-900 !text-gray-25 hover:!text-gray-25" :
8285 item . is_active ,
8386 } ,
8487 ) }
8588 >
86- { item . name }
89+ < span className = "block truncate" > { item . name } </ span >
90+
91+ < LinkButton
92+ href = { hrefs . workspaces . edit ( item . name ) }
93+ onPress = { ( ) => setIsOpen ( false ) }
94+ isIcon
95+ variant = "tertiary"
96+ className = { twMerge (
97+ "ml-auto size-6 group-hover/selector:opacity-100 opacity-0 transition-opacity" ,
98+ item . is_active
99+ ? "hover:bg-gray-800 pressed:bg-gray-700"
100+ : "hover:bg-gray-50 hover:text-primary" ,
101+ ) }
102+ >
103+ < Settings
104+ className = { twMerge (
105+ item . is_active ? "text-gray-25" : "text-secondary" ,
106+ ) }
107+ />
108+ </ LinkButton >
87109 </ ListBoxItem >
88110 ) }
89111 </ ListBox >
@@ -92,7 +114,7 @@ export function WorkspacesSelection() {
92114 href = "/workspaces"
93115 onPress = { ( ) => setIsOpen ( false ) }
94116 variant = "tertiary"
95- className = "text-secondary h-8 pl-2 gap-2 flex mt-2 justify-start"
117+ className = "text-secondary h-10 pl-2 gap-2 flex mt-2 justify-start"
96118 >
97119 < Settings />
98120 Manage Workspaces
0 commit comments