diff --git a/packages/app/src/components/workspace-setup-dialog.tsx b/packages/app/src/components/workspace-setup-dialog.tsx index af7ca6cf5..3656df4fb 100644 --- a/packages/app/src/components/workspace-setup-dialog.tsx +++ b/packages/app/src/components/workspace-setup-dialog.tsx @@ -1,6 +1,5 @@ -import { useCallback, useEffect, useMemo, useState, type ComponentType } from "react"; +import { useCallback, useEffect, useMemo, useState } from "react"; import { ActivityIndicator, Pressable, Text, View } from "react-native"; -import { ChevronLeft, MessagesSquare, SquareTerminal } from "lucide-react-native"; import { StyleSheet, useUnistyles } from "react-native-unistyles"; import { createNameId } from "mnemonic-id"; import { AdaptiveModalSheet } from "@/components/adaptive-modal-sheet"; @@ -28,7 +27,6 @@ export function WorkspaceSetupDialog() { const mergeWorkspaces = useSessionStore((state) => state.mergeWorkspaces); const setHasHydratedWorkspaces = useSessionStore((state) => state.setHasHydratedWorkspaces); const setAgents = useSessionStore((state) => state.setAgents); - const [step, setStep] = useState<"choose" | "chat">("choose"); const [errorMessage, setErrorMessage] = useState(null); const [createdWorkspace, setCreatedWorkspace] = useState { - setStep("choose"); setErrorMessage(null); setCreatedWorkspace(null); setPendingAction(null); @@ -265,142 +262,59 @@ export function WorkspaceSetupDialog() { {workspacePath} - {step === "choose" ? ( - - What do you want to open? - - { - setErrorMessage(null); - setStep("chat"); - }} - /> - { - void handleCreateTerminal(); - }} - /> - - - ) : null} + + + - {step === "chat" ? ( - - { - setErrorMessage(null); - setStep("choose"); - }} - /> - - Start with a prompt and optional images. The workspace is created first, then the agent launches, then navigation happens. - - - - - - ) : null} + void handleCreateTerminal()} + style={[ + styles.terminalLink, + pendingAction !== null && pendingAction !== "terminal" ? { opacity: 0.5 } : undefined, + ]} + > + {pendingAction === "terminal" ? ( + + ) : null} + {"\u2192"} Open terminal + {errorMessage ? {errorMessage} : null} ); } -function StepHeader({ title, onBack }: { title: string; onBack: () => void }) { - const { theme } = useUnistyles(); - - return ( - - - - - {title} - - ); -} - -function ChoiceCard({ - title, - description, - Icon, - disabled, - pending = false, - onPress, -}: { - title: string; - description: string; - Icon: ComponentType<{ size: number; color: string }>; - disabled: boolean; - pending?: boolean; - onPress: () => void; -}) { - const { theme } = useUnistyles(); - - return ( - [ - styles.choiceCard, - (hovered || pressed) && !disabled ? styles.choiceCardHovered : null, - disabled ? styles.cardDisabled : null, - ]} - > - - {pending ? ( - - ) : ( - - )} - - - {title} - {description} - - - ); -} - const styles = StyleSheet.create((theme) => ({ header: { gap: theme.spacing[1], }, workspaceTitle: { fontSize: theme.fontSize.base, - fontWeight: theme.fontWeight.semibold, + fontWeight: theme.fontWeight.medium, color: theme.colors.foreground, }, workspacePath: { @@ -409,78 +323,17 @@ const styles = StyleSheet.create((theme) => ({ }, section: { gap: theme.spacing[3], + marginHorizontal: -theme.spacing[6], }, - sectionTitle: { - fontSize: theme.fontSize.sm, - fontWeight: theme.fontWeight.medium, - color: theme.colors.foregroundMuted, - }, - helper: { - fontSize: theme.fontSize.sm, - color: theme.colors.foregroundMuted, - lineHeight: 20, - }, - choiceGrid: { - gap: theme.spacing[2], - }, - choiceCard: { - flexDirection: "row", - alignItems: "center", - gap: theme.spacing[3], - borderWidth: 1, - borderColor: theme.colors.border, - borderRadius: theme.borderRadius.lg, - backgroundColor: theme.colors.surface1, - paddingVertical: theme.spacing[3], - paddingHorizontal: theme.spacing[3], - }, - choiceCardHovered: { - backgroundColor: theme.colors.surface2, - }, - cardDisabled: { - opacity: theme.opacity[50], - }, - choiceIconWrap: { - width: 32, - height: 32, - borderRadius: theme.borderRadius.md, - alignItems: "center", - justifyContent: "center", - backgroundColor: theme.colors.surface2, - }, - choiceBody: { - flex: 1, - gap: 2, - }, - choiceTitle: { - fontSize: theme.fontSize.sm, - fontWeight: theme.fontWeight.medium, - color: theme.colors.foreground, - }, - choiceDescription: { - fontSize: theme.fontSize.xs, - color: theme.colors.foregroundMuted, - }, - composerCard: { - minHeight: 180, - borderWidth: 1, - borderColor: theme.colors.border, - borderRadius: theme.borderRadius.lg, - backgroundColor: theme.colors.surface0, - overflow: "hidden", - }, - stepHeader: { + terminalLink: { flexDirection: "row", alignItems: "center", + alignSelf: "flex-end", gap: theme.spacing[2], }, - backButton: { - width: 28, - height: 28, - borderRadius: theme.borderRadius.md, - alignItems: "center", - justifyContent: "center", - backgroundColor: theme.colors.surface2, + terminalLinkText: { + fontSize: theme.fontSize.sm, + color: theme.colors.foregroundMuted, }, errorText: { fontSize: theme.fontSize.sm, diff --git a/scripts/dev.sh b/scripts/dev.sh index d4e8426de..8bcef241f 100755 --- a/scripts/dev.sh +++ b/scripts/dev.sh @@ -5,11 +5,21 @@ set -e SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" export PATH="$SCRIPT_DIR/../node_modules/.bin:$PATH" -# Use a temporary PASEO_HOME to avoid conflicts between dev instances +# Derive PASEO_HOME: stable name for worktrees, temporary dir otherwise if [ -z "${PASEO_HOME}" ]; then export PASEO_HOME - PASEO_HOME="$(mktemp -d "${TMPDIR:-/tmp}/paseo-dev.XXXXXX")" - trap "rm -rf '$PASEO_HOME'" EXIT + GIT_DIR="$(git rev-parse --git-dir 2>/dev/null || true)" + GIT_COMMON_DIR="$(git rev-parse --git-common-dir 2>/dev/null || true)" + if [ -n "$GIT_DIR" ] && [ -n "$GIT_COMMON_DIR" ] && [ "$GIT_DIR" != "$GIT_COMMON_DIR" ]; then + # Inside a worktree — derive a stable home from the worktree name + WORKTREE_ROOT="$(git rev-parse --show-toplevel)" + WORKTREE_NAME="$(basename "$WORKTREE_ROOT" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9-]/-/g; s/--*/-/g; s/^-//; s/-$//')" + PASEO_HOME="$HOME/.paseo-${WORKTREE_NAME}" + mkdir -p "$PASEO_HOME" + else + PASEO_HOME="$(mktemp -d "${TMPDIR:-/tmp}/paseo-dev.XXXXXX")" + trap "rm -rf '$PASEO_HOME'" EXIT + fi fi echo "══════════════════════════════════════════════════════"