From ad0a9b8d3ebf4b8615ef3e5b322cfb65a81bda3a Mon Sep 17 00:00:00 2001 From: Kiet Ho Date: Tue, 13 Jan 2026 23:50:00 -0800 Subject: [PATCH] fix(desktop): restore OpenInMenuButton to TopBar The OpenInMenuButton was accidentally removed in commit aeaed2d5 ("Router Part 3: Rewrite the workspace handling"). This restores the button using the new workspace query pattern with useParams. --- .../screens/main/components/TopBar/index.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/apps/desktop/src/renderer/screens/main/components/TopBar/index.tsx b/apps/desktop/src/renderer/screens/main/components/TopBar/index.tsx index c75ac938a3a..1e8e24ddc29 100644 --- a/apps/desktop/src/renderer/screens/main/components/TopBar/index.tsx +++ b/apps/desktop/src/renderer/screens/main/components/TopBar/index.tsx @@ -1,9 +1,16 @@ +import { useParams } from "@tanstack/react-router"; import { trpc } from "renderer/lib/trpc"; +import { OpenInMenuButton } from "./OpenInMenuButton"; import { SupportMenu } from "./SupportMenu"; import { WindowControls } from "./WindowControls"; export function TopBar() { const { data: platform } = trpc.window.getPlatform.useQuery(); + const { workspaceId } = useParams({ strict: false }); + const { data: workspace } = trpc.workspaces.get.useQuery( + { id: workspaceId ?? "" }, + { enabled: !!workspaceId }, + ); // Default to Mac layout while loading to avoid overlap with traffic lights const isMac = platform === undefined || platform === "darwin"; @@ -19,6 +26,12 @@ export function TopBar() {
+ {workspace?.worktreePath && ( + + )} {!isMac && }