Skip to content

Commit 22db997

Browse files
committed
Open terminal to worktree folder by default + add version to status bar
1 parent 47d0110 commit 22db997

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

apps/twig/src/renderer/components/StatusBarMenu.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import { Button, Code } from "@radix-ui/themes";
2+
import { trpcReact } from "@renderer/trpc";
23

34
export function StatusBarMenu() {
5+
const { data: appVersion } = trpcReact.os.getAppVersion.useQuery();
6+
47
return (
58
<Button size="1" variant="ghost">
69
<Code size="1" color="gray" variant="ghost">
7-
TWIG
10+
TWIG{appVersion ? ` v${appVersion}` : ""}
811
</Code>
912
</Button>
1013
);

apps/twig/src/renderer/features/task-detail/components/TaskShellPanel.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ export function TaskShellPanel({
2020
const stateKey = shellId ? `${taskId}-${shellId}` : taskId;
2121
const tabId = shellId || "shell";
2222

23-
const folderPath = useWorkspaceStore(
24-
(state) => state.workspaces[taskId]?.folderPath,
25-
);
23+
const workspacePath = useWorkspaceStore((state) => {
24+
const workspace = state.workspaces[taskId];
25+
return workspace?.worktreePath ?? workspace?.folderPath;
26+
});
2627

2728
const processName = useTerminalStore(
2829
(state) => state.terminalStates[stateKey]?.processName,
@@ -42,9 +43,13 @@ export function TaskShellPanel({
4243
}
4344
}, [processName, taskId, tabId, updateTabLabel]);
4445

46+
if (!workspacePath) {
47+
return null;
48+
}
49+
4550
return (
4651
<Box height="100%">
47-
<ShellTerminal cwd={folderPath} stateKey={stateKey} taskId={taskId} />
52+
<ShellTerminal cwd={workspacePath} stateKey={stateKey} taskId={taskId} />
4853
</Box>
4954
);
5055
}

0 commit comments

Comments
 (0)