From 0d4322249aea3604cd0cf24f8b38e335d03ef8b9 Mon Sep 17 00:00:00 2001 From: Martin Laporte Date: Mon, 13 Apr 2026 06:41:48 +0000 Subject: [PATCH] refactor(LaunchButtons): replace Pippin shell button with copy path to clipboard --- .../src/components/LaunchButtons.tsx | 43 ++++--------------- 1 file changed, 8 insertions(+), 35 deletions(-) diff --git a/packages/treebeard/src/components/LaunchButtons.tsx b/packages/treebeard/src/components/LaunchButtons.tsx index d5c91be..64d4a9a 100644 --- a/packages/treebeard/src/components/LaunchButtons.tsx +++ b/packages/treebeard/src/components/LaunchButtons.tsx @@ -1,6 +1,5 @@ -import { useEffect, useState } from 'react' import { ActionIcon, Group, Tooltip } from '@mantine/core' -import { IconGhost, IconPrison } from '@tabler/icons-react' +import { IconCopy, IconGhost } from '@tabler/icons-react' import { IdeIcon } from './IdeIcon' import { IDE_REGISTRY } from '../shared/ide-registry' import { rpc } from '../rpc' @@ -13,30 +12,6 @@ interface LaunchButtonsProps { export function LaunchButtons({ worktreePath, defaultIde }: LaunchButtonsProps) { const ide = IDE_REGISTRY[defaultIde] - const [pippinPath, setPippinPath] = useState(null) - - useEffect(() => { - let cancelled = false - - const loadPippinPath = async () => { - try { - const result = await rpc().request['system:pippinPath']({}) - if (!cancelled) { - setPippinPath(result) - } - } catch { - if (!cancelled) { - setPippinPath(null) - } - } - } - - void loadPippinPath() - - return () => { - cancelled = true - } - }, []) const handleIde = async () => { await rpc().request['launch:ide']({ ideId: defaultIde, worktreePath }) @@ -46,8 +21,8 @@ export function LaunchButtons({ worktreePath, defaultIde }: LaunchButtonsProps) await rpc().request['launch:ghostty']({ worktreePath }) } - const handlePippinShell = async () => { - await rpc().request['launch:pippinShell']({ worktreePath }) + const handleCopyPath = () => { + void navigator.clipboard.writeText(worktreePath) } return ( @@ -62,13 +37,11 @@ export function LaunchButtons({ worktreePath, defaultIde }: LaunchButtonsProps) - {pippinPath && ( - - - - - - )} + + + + + ) }