+ // biome-ignore lint/a11y/noStaticElementInteractions: hover handlers drive a non-interactive popover, no new keyboard semantics
+
{(accentColor || isActive) && (
- }
isLocalWorkspace={hostType === "local-device"}
onCreateSection={handleCreateSection}
onMoveToSection={(targetSectionId) =>
@@ -153,30 +192,45 @@ export function DashboardSidebarWorkspaceItem({
onDeleted={handleDeleted}
/>
)}
+ {renameBranchTarget && (
+
{
+ if (!open) setRenameBranchTarget(null);
+ }}
+ onAfterRename={handleAfterBranchRename}
+ />
+ )}
>
);
}
const expandedContent = (
- setIsDeleteDialogOpen(true)
- }
- onRenameValueChange={setRenameValue}
- onSubmitRename={submitRename}
- onCancelRename={cancelRename}
- />
+ // biome-ignore lint/a11y/noStaticElementInteractions: hover handlers drive a non-interactive popover, no new keyboard semantics
+
+ setIsDeleteDialogOpen(true)}
+ onRenameValueChange={setRenameValue}
+ onSubmitRename={submitRename}
+ onCancelRename={cancelRename}
+ />
+
);
return (
@@ -189,15 +243,6 @@ export function DashboardSidebarWorkspaceItem({
projectId={projectId}
isInSection={isInSection}
isUnread={isUnread}
- onHoverCardOpen={
- hostType === "local-device" ? onHoverCardOpen : undefined
- }
- hoverCardContent={
-
- }
onCreateSection={handleCreateSection}
onMoveToSection={(targetSectionId) =>
moveWorkspaceToSection(id, projectId, targetSectionId)
@@ -227,6 +272,17 @@ export function DashboardSidebarWorkspaceItem({
onDeleted={handleDeleted}
/>
)}
+ {renameBranchTarget && (
+ {
+ if (!open) setRenameBranchTarget(null);
+ }}
+ onAfterRename={handleAfterBranchRename}
+ />
+ )}
>
);
}
diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarCollapsedWorkspaceButton/DashboardSidebarCollapsedWorkspaceButton.tsx b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarCollapsedWorkspaceButton/DashboardSidebarCollapsedWorkspaceButton.tsx
index 912b877884b..a1d029fe7fa 100644
--- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarCollapsedWorkspaceButton/DashboardSidebarCollapsedWorkspaceButton.tsx
+++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarCollapsedWorkspaceButton/DashboardSidebarCollapsedWorkspaceButton.tsx
@@ -1,12 +1,16 @@
import { cn } from "@superset/ui/utils";
import { type ComponentPropsWithoutRef, forwardRef } from "react";
import type { ActivePaneStatus } from "shared/tabs-types";
-import type { DashboardSidebarWorkspaceHostType } from "../../../../types";
+import type {
+ DashboardSidebarWorkspaceHostType,
+ DashboardSidebarWorkspaceType,
+} from "../../../../types";
import { DashboardSidebarWorkspaceIcon } from "../DashboardSidebarWorkspaceIcon";
interface DashboardSidebarCollapsedWorkspaceButtonProps
extends ComponentPropsWithoutRef<"button"> {
hostType: DashboardSidebarWorkspaceHostType;
+ workspaceType: DashboardSidebarWorkspaceType;
hostIsOnline: boolean | null;
isActive: boolean;
workspaceStatus?: ActivePaneStatus | null;
@@ -20,6 +24,7 @@ export const DashboardSidebarCollapsedWorkspaceButton = forwardRef<
(
{
hostType,
+ workspaceType,
hostIsOnline,
isActive,
workspaceStatus = null,
@@ -43,6 +48,7 @@ export const DashboardSidebarCollapsedWorkspaceButton = forwardRef<
>
void;
onDoubleClick?: () => void;
- onDeleteClick: () => void;
+ onCloseWorkspaceClick: () => void;
+ onRemoveFromSidebarClick: () => void;
onRenameValueChange: (value: string) => void;
onSubmitRename: () => void;
onCancelRename: () => void;
@@ -63,7 +64,8 @@ export const DashboardSidebarExpandedWorkspaceRow = forwardRef<
workspaceStatus = null,
onClick,
onDoubleClick,
- onDeleteClick,
+ onCloseWorkspaceClick,
+ onRemoveFromSidebarClick,
onRenameValueChange,
onSubmitRename,
onCancelRename,
@@ -105,9 +107,6 @@ export const DashboardSidebarExpandedWorkspaceRow = forwardRef<
const workspaceKindDescription = isMainWorkspace
? "Uses the repository checkout on this host"
: "Isolated copy for parallel development";
- const closeLabel = isMainWorkspace
- ? "Remove from sidebar"
- : "Close workspace";
return (
// biome-ignore lint/a11y/noStaticElementInteractions: Mirrors the legacy sidebar row UI, which includes nested action buttons.
@@ -167,6 +166,7 @@ export const DashboardSidebarExpandedWorkspaceRow = forwardRef<
>
)}
-
-
-
-
-
-
-
-
+ {isMainWorkspace ? (
+
+
+
+
+
+
+
+
+ ) : (
+
+
+
+
+
+
+
+
+ )}
>
)}
diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarWorkspaceContextMenu/DashboardSidebarWorkspaceContextMenu.tsx b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarWorkspaceContextMenu/DashboardSidebarWorkspaceContextMenu.tsx
index 8c74ff2ede4..c650ea308c1 100644
--- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarWorkspaceContextMenu/DashboardSidebarWorkspaceContextMenu.tsx
+++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarWorkspaceContextMenu/DashboardSidebarWorkspaceContextMenu.tsx
@@ -8,14 +8,8 @@ import {
ContextMenuSubTrigger,
ContextMenuTrigger,
} from "@superset/ui/context-menu";
-import {
- HoverCard,
- HoverCardContent,
- HoverCardTrigger,
-} from "@superset/ui/hover-card";
import { eq } from "@tanstack/db";
import { useLiveQuery } from "@tanstack/react-db";
-import { useState } from "react";
import {
LuArrowRightLeft,
LuArrowUp,
@@ -30,14 +24,13 @@ import {
LuX,
} from "react-icons/lu";
import { useCollections } from "renderer/routes/_authenticated/providers/CollectionsProvider";
+import { useDashboardSidebarHover } from "../../../../providers/DashboardSidebarHoverProvider";
interface DashboardSidebarWorkspaceContextMenuProps {
- hoverCardContent?: React.ReactNode;
projectId: string;
isInSection?: boolean;
isLocalWorkspace: boolean;
isUnread: boolean;
- onHoverCardOpen?: () => void;
onCreateSection: () => void;
onMoveToSection: (sectionId: string | null) => void;
onOpenInFinder: () => void;
@@ -55,8 +48,6 @@ export function DashboardSidebarWorkspaceContextMenu({
isInSection,
isLocalWorkspace,
isUnread,
- onHoverCardOpen,
- hoverCardContent,
onCreateSection,
onMoveToSection,
onOpenInFinder,
@@ -69,7 +60,7 @@ export function DashboardSidebarWorkspaceContextMenu({
children,
}: DashboardSidebarWorkspaceContextMenuProps) {
const collections = useCollections();
- const [isContextMenuOpen, setIsContextMenuOpen] = useState(false);
+ const { setContextMenuOpen } = useDashboardSidebarHover();
const { data: sections = [] } = useLiveQuery(
(q) =>
q
@@ -86,129 +77,100 @@ export function DashboardSidebarWorkspaceContextMenu({
[collections, projectId],
);
- const menuContent = (
-
event.preventDefault()}>
-
-
- Rename
-
- {isLocalWorkspace && (
- <>
-
-
-
- Open in Finder
-
-
-
- Copy Path
-
- >
- )}
- {!isLocalWorkspace && }
-
-
- Copy Branch Name
-
-
-
- {isUnread ? (
- <>
-
- Mark as Read
- >
- ) : (
+ return (
+
+ {children}
+ event.preventDefault()}>
+
+
+ Rename
+
+ {isLocalWorkspace && (
<>
-
- Mark as Unread
+
+
+
+ Open in Finder
+
+
+
+ Copy Path
+
>
)}
-
-
-
-
- New group from workspace
-
- {(sections.length > 0 || isInSection) && }
- {sections.length > 0 && (
-
-
-
- Move to group
-
-
- {sections.map((section) => (
- onMoveToSection(section.id)}
- >
- {section.color && (
-
- )}
- {section.name}
-
- ))}
-
-
- )}
- {isInSection && (
- onMoveToSection(null)}>
-
- Ungroup
+ {!isLocalWorkspace && }
+
+
+ Copy Branch Name
+
+
+
+ {isUnread ? (
+ <>
+
+ Mark as Read
+ >
+ ) : (
+ <>
+
+ Mark as Unread
+ >
+ )}
+
+
+
+
+ New group from workspace
- )}
-
-
-
- Remove from Sidebar
-
- {onDelete ? (
+ {(sections.length > 0 || isInSection) && }
+ {sections.length > 0 && (
+
+
+
+ Move to group
+
+
+ {sections.map((section) => (
+ onMoveToSection(section.id)}
+ >
+ {section.color && (
+
+ )}
+ {section.name}
+
+ ))}
+
+
+ )}
+ {isInSection && (
+ onMoveToSection(null)}>
+
+ Ungroup
+
+ )}
+
-
- Delete
+
+ Remove from Sidebar
- ) : null}
-
- );
-
- if (!hoverCardContent) {
- return (
-
- {children}
- {menuContent}
-
- );
- }
-
- return (
-
{
- if (open) {
- onHoverCardOpen?.();
- }
- }}
- >
-
-
- {children}
-
- {menuContent}
-
-
- {hoverCardContent}
-
-
+ {onDelete ? (
+
+
+ Delete
+
+ ) : null}
+
+
);
}
diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarWorkspaceHoverCardContent/DashboardSidebarWorkspaceHoverCardContent.tsx b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarWorkspaceHoverCardContent/DashboardSidebarWorkspaceHoverCardContent.tsx
index 667b816e84e..e3dffa07be2 100644
--- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarWorkspaceHoverCardContent/DashboardSidebarWorkspaceHoverCardContent.tsx
+++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarWorkspaceHoverCardContent/DashboardSidebarWorkspaceHoverCardContent.tsx
@@ -2,7 +2,12 @@ import { Button } from "@superset/ui/button";
import { Kbd, KbdGroup } from "@superset/ui/kbd";
import { formatDistanceToNow } from "date-fns";
import { FaGithub } from "react-icons/fa";
-import { LuExternalLink, LuGlobe, LuTriangleAlert } from "react-icons/lu";
+import {
+ LuExternalLink,
+ LuGlobe,
+ LuPencil,
+ LuTriangleAlert,
+} from "react-icons/lu";
import type { DiffStats } from "renderer/hooks/host-service/useDiffStats";
import { useHotkeyDisplay } from "renderer/hotkeys";
import type { DashboardSidebarWorkspace } from "../../../../types";
@@ -14,11 +19,13 @@ import { ReviewStatus } from "./components/ReviewStatus";
interface DashboardSidebarWorkspaceHoverCardContentProps {
workspace: DashboardSidebarWorkspace;
diffStats: DiffStats | null;
+ onEditBranchClick?: (branchName: string) => void;
}
export function DashboardSidebarWorkspaceHoverCardContent({
workspace,
diffStats,
+ onEditBranchClick,
}: DashboardSidebarWorkspaceHoverCardContentProps) {
const {
name,
@@ -59,23 +66,37 @@ export function DashboardSidebarWorkspaceHoverCardContent({
Branch
- {repoUrl && branchExistsOnRemote ? (
-
- {branch}
-
-
- ) : (
-
- {branch}
-
- )}
+
+ {onEditBranchClick ? (
+
+ ) : (
+
+ {branch}
+
+ )}
+ {repoUrl && branchExistsOnRemote && (
+
e.stopPropagation()}
+ >
+
+
+ )}
+