@atercates/claude-deck 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +123 -0
- package/app/api/claude/hidden/route.ts +66 -0
- package/app/api/claude/projects/[name]/sessions/route.ts +71 -0
- package/app/api/claude/projects/route.ts +44 -0
- package/app/api/code-search/available/route.ts +12 -0
- package/app/api/code-search/route.ts +47 -0
- package/app/api/dev-servers/[id]/logs/route.ts +23 -0
- package/app/api/dev-servers/[id]/restart/route.ts +20 -0
- package/app/api/dev-servers/[id]/route.ts +51 -0
- package/app/api/dev-servers/[id]/stop/route.ts +20 -0
- package/app/api/dev-servers/detect/route.ts +39 -0
- package/app/api/dev-servers/route.ts +48 -0
- package/app/api/exec/route.ts +60 -0
- package/app/api/files/content/route.ts +76 -0
- package/app/api/files/route.ts +37 -0
- package/app/api/files/upload-temp/route.ts +41 -0
- package/app/api/git/check/route.ts +54 -0
- package/app/api/git/clone/route.ts +99 -0
- package/app/api/git/commit/route.ts +75 -0
- package/app/api/git/discard/route.ts +38 -0
- package/app/api/git/file-content/route.ts +64 -0
- package/app/api/git/history/[hash]/diff/route.ts +38 -0
- package/app/api/git/history/[hash]/route.ts +34 -0
- package/app/api/git/history/route.ts +27 -0
- package/app/api/git/multi-status/route.ts +46 -0
- package/app/api/git/pr/route.ts +164 -0
- package/app/api/git/push/route.ts +64 -0
- package/app/api/git/stage/route.ts +40 -0
- package/app/api/git/status/route.ts +51 -0
- package/app/api/git/unstage/route.ts +46 -0
- package/app/api/groups/[...path]/route.ts +136 -0
- package/app/api/groups/route.ts +93 -0
- package/app/api/orchestrate/spawn/route.ts +45 -0
- package/app/api/orchestrate/workers/[id]/route.ts +89 -0
- package/app/api/orchestrate/workers/route.ts +31 -0
- package/app/api/projects/[id]/detect/route.ts +27 -0
- package/app/api/projects/[id]/dev-servers/[dsId]/route.ts +66 -0
- package/app/api/projects/[id]/dev-servers/route.ts +51 -0
- package/app/api/projects/[id]/repositories/[repoId]/route.ts +67 -0
- package/app/api/projects/[id]/repositories/route.ts +74 -0
- package/app/api/projects/[id]/route.ts +108 -0
- package/app/api/projects/detect/route.ts +33 -0
- package/app/api/projects/route.ts +59 -0
- package/app/api/sessions/[id]/claude-session/route.ts +42 -0
- package/app/api/sessions/[id]/fork/route.ts +74 -0
- package/app/api/sessions/[id]/mcp-config/route.ts +34 -0
- package/app/api/sessions/[id]/messages/route.ts +60 -0
- package/app/api/sessions/[id]/pr/route.ts +188 -0
- package/app/api/sessions/[id]/preview/route.ts +42 -0
- package/app/api/sessions/[id]/route.ts +229 -0
- package/app/api/sessions/[id]/send-keys/route.ts +119 -0
- package/app/api/sessions/[id]/summarize/route.ts +331 -0
- package/app/api/sessions/init-script/route.ts +84 -0
- package/app/api/sessions/route.ts +209 -0
- package/app/api/sessions/status/route.ts +237 -0
- package/app/api/system/route.ts +9 -0
- package/app/api/tmux/kill-all/route.ts +57 -0
- package/app/api/tmux/rename/route.ts +30 -0
- package/app/globals.css +174 -0
- package/app/icon.svg +11 -0
- package/app/layout.tsx +122 -0
- package/app/page.tsx +629 -0
- package/components/ChatMessage.tsx +65 -0
- package/components/ChatView.tsx +276 -0
- package/components/ClaudeProjects/ClaudeProjectCard.tsx +195 -0
- package/components/ClaudeProjects/ClaudeProjectsSection.tsx +89 -0
- package/components/ClaudeProjects/ClaudeSessionCard.tsx +100 -0
- package/components/ClaudeProjects/index.ts +1 -0
- package/components/CodeSearch/CodeSearchResults.tsx +177 -0
- package/components/ConductorPanel.tsx +256 -0
- package/components/DevServers/DevServerCard.tsx +311 -0
- package/components/DevServers/DevServersSection.tsx +91 -0
- package/components/DevServers/ServerLogsModal.tsx +151 -0
- package/components/DevServers/StartServerDialog.tsx +359 -0
- package/components/DevServers/index.ts +4 -0
- package/components/DiffViewer/DiffModal.tsx +151 -0
- package/components/DiffViewer/UnifiedDiff.tsx +185 -0
- package/components/DiffViewer/index.tsx +2 -0
- package/components/DirectoryPicker.tsx +355 -0
- package/components/FileExplorer/FileEditor.tsx +276 -0
- package/components/FileExplorer/FileTabs.tsx +118 -0
- package/components/FileExplorer/FileTree.tsx +214 -0
- package/components/FileExplorer/HtmlRenderer.tsx +16 -0
- package/components/FileExplorer/MarkdownRenderer.tsx +18 -0
- package/components/FileExplorer/index.tsx +520 -0
- package/components/FilePicker.tsx +339 -0
- package/components/FolderPicker.tsx +201 -0
- package/components/GitDrawer/FileEditDialog.tsx +400 -0
- package/components/GitDrawer/index.tsx +464 -0
- package/components/GitPanel/CommitForm.tsx +205 -0
- package/components/GitPanel/CommitHistory.tsx +174 -0
- package/components/GitPanel/CommitItem.tsx +196 -0
- package/components/GitPanel/FileChanges.tsx +414 -0
- package/components/GitPanel/GitPanelTabs.tsx +39 -0
- package/components/GitPanel/index.tsx +817 -0
- package/components/MessageInput.tsx +82 -0
- package/components/NewClaudeSessionDialog.tsx +166 -0
- package/components/NewSessionDialog/AdvancedSettings.tsx +78 -0
- package/components/NewSessionDialog/AgentSelector.tsx +37 -0
- package/components/NewSessionDialog/CreatingOverlay.tsx +94 -0
- package/components/NewSessionDialog/NewSessionDialog.types.ts +136 -0
- package/components/NewSessionDialog/ProjectSelector.tsx +146 -0
- package/components/NewSessionDialog/WorkingDirectoryInput.tsx +55 -0
- package/components/NewSessionDialog/WorktreeSection.tsx +92 -0
- package/components/NewSessionDialog/hooks/useNewSessionForm.ts +370 -0
- package/components/NewSessionDialog/index.tsx +106 -0
- package/components/NotificationSettings.tsx +127 -0
- package/components/PRCreationModal.tsx +272 -0
- package/components/Pane/DesktopTabBar.tsx +353 -0
- package/components/Pane/MobileTabBar.tsx +210 -0
- package/components/Pane/OpenInVSCode.tsx +69 -0
- package/components/Pane/PaneSkeletons.tsx +57 -0
- package/components/Pane/index.tsx +558 -0
- package/components/PaneLayout.tsx +60 -0
- package/components/Projects/DevServersSection.tsx +140 -0
- package/components/Projects/DirectoryField.tsx +92 -0
- package/components/Projects/NewProjectDialog.tsx +188 -0
- package/components/Projects/NewProjectDialog.types.ts +46 -0
- package/components/Projects/ProjectCard.tsx +276 -0
- package/components/Projects/ProjectSettingsDialog.tsx +811 -0
- package/components/Projects/hooks/useNewProjectForm.ts +249 -0
- package/components/Projects/index.ts +3 -0
- package/components/Providers.tsx +49 -0
- package/components/QuickSwitcher.tsx +306 -0
- package/components/SessionList/KillAllConfirm.tsx +46 -0
- package/components/SessionList/SelectionToolbar.tsx +164 -0
- package/components/SessionList/SessionList.types.ts +37 -0
- package/components/SessionList/SessionListHeader.tsx +71 -0
- package/components/SessionList/hooks/useSessionListMutations.ts +269 -0
- package/components/SessionList/index.tsx +189 -0
- package/components/ShellDrawer/index.tsx +106 -0
- package/components/SidebarFooter.tsx +55 -0
- package/components/Terminal/KeybarToggleButton.tsx +45 -0
- package/components/Terminal/ScrollToBottomButton.tsx +32 -0
- package/components/Terminal/SearchBar.tsx +71 -0
- package/components/Terminal/TerminalToolbar.tsx +551 -0
- package/components/Terminal/VirtualKeyboard.tsx +711 -0
- package/components/Terminal/constants.ts +20 -0
- package/components/Terminal/hooks/index.ts +5 -0
- package/components/Terminal/hooks/resize-handlers.ts +140 -0
- package/components/Terminal/hooks/terminal-init.ts +151 -0
- package/components/Terminal/hooks/touch-scroll.ts +155 -0
- package/components/Terminal/hooks/useTerminalConnection.ts +282 -0
- package/components/Terminal/hooks/useTerminalConnection.types.ts +39 -0
- package/components/Terminal/hooks/useTerminalSearch.ts +103 -0
- package/components/Terminal/hooks/websocket-connection.ts +274 -0
- package/components/Terminal/index.tsx +320 -0
- package/components/ThemeToggle.tsx +168 -0
- package/components/TmuxSessions.tsx +132 -0
- package/components/ToolCallDisplay.tsx +71 -0
- package/components/WorkerCard.tsx +245 -0
- package/components/a/ABadge.tsx +115 -0
- package/components/a/AButton.tsx +163 -0
- package/components/a/ADialog.tsx +93 -0
- package/components/a/ADropdownMenu.tsx +279 -0
- package/components/a/AIconButton.tsx +190 -0
- package/components/a/ASheet.tsx +150 -0
- package/components/a/ATooltip.tsx +77 -0
- package/components/a/index.ts +64 -0
- package/components/mobile/SwipeSidebar.tsx +122 -0
- package/components/ui/badge.tsx +41 -0
- package/components/ui/button.tsx +60 -0
- package/components/ui/context-menu.tsx +197 -0
- package/components/ui/dialog.tsx +143 -0
- package/components/ui/dropdown-menu.tsx +257 -0
- package/components/ui/input.tsx +21 -0
- package/components/ui/scroll-area.tsx +52 -0
- package/components/ui/select.tsx +159 -0
- package/components/ui/skeleton.tsx +111 -0
- package/components/ui/switch.tsx +31 -0
- package/components/ui/textarea.tsx +21 -0
- package/components/ui/tooltip.tsx +32 -0
- package/components/views/DesktopView.tsx +244 -0
- package/components/views/MobileView.tsx +110 -0
- package/components/views/types.ts +75 -0
- package/contexts/PaneContext.tsx +336 -0
- package/data/claude/index.ts +9 -0
- package/data/claude/keys.ts +6 -0
- package/data/claude/queries.ts +120 -0
- package/data/claude/useClaudeUpdates.ts +37 -0
- package/data/code-search/index.ts +2 -0
- package/data/code-search/keys.ts +7 -0
- package/data/code-search/queries.ts +61 -0
- package/data/dev-servers/index.ts +8 -0
- package/data/dev-servers/keys.ts +4 -0
- package/data/dev-servers/queries.ts +104 -0
- package/data/files/index.ts +3 -0
- package/data/files/keys.ts +4 -0
- package/data/files/queries.ts +25 -0
- package/data/git/keys.ts +15 -0
- package/data/git/queries.ts +395 -0
- package/data/groups/index.ts +1 -0
- package/data/groups/mutations.ts +95 -0
- package/data/projects/index.ts +10 -0
- package/data/projects/keys.ts +4 -0
- package/data/projects/queries.ts +193 -0
- package/data/repositories/index.ts +7 -0
- package/data/repositories/keys.ts +5 -0
- package/data/repositories/queries.ts +122 -0
- package/data/sessions/index.ts +12 -0
- package/data/sessions/keys.ts +8 -0
- package/data/sessions/queries.ts +218 -0
- package/data/statuses/index.ts +1 -0
- package/data/statuses/queries.ts +69 -0
- package/hooks/useCopyToClipboard.ts +48 -0
- package/hooks/useDevServersManager.ts +73 -0
- package/hooks/useDirectoryBrowser.ts +90 -0
- package/hooks/useDrawerAnimation.ts +27 -0
- package/hooks/useFileDrop.ts +87 -0
- package/hooks/useFileEditor.ts +184 -0
- package/hooks/useGroups.ts +37 -0
- package/hooks/useHomePath.ts +34 -0
- package/hooks/useKeyRepeat.ts +55 -0
- package/hooks/useKeybarVisibility.ts +42 -0
- package/hooks/useNotifications.ts +257 -0
- package/hooks/useProjects.ts +53 -0
- package/hooks/useSessionStatuses.ts +30 -0
- package/hooks/useSessions.ts +86 -0
- package/hooks/useSpeechRecognition.ts +124 -0
- package/hooks/useViewport.ts +32 -0
- package/hooks/useViewportHeight.ts +50 -0
- package/lib/async-operations.ts +35 -0
- package/lib/banner.ts +81 -0
- package/lib/claude/jsonl-cache.ts +86 -0
- package/lib/claude/jsonl-reader.ts +271 -0
- package/lib/claude/process-manager.ts +278 -0
- package/lib/claude/stream-parser.ts +173 -0
- package/lib/claude/types.ts +154 -0
- package/lib/claude/watcher.ts +71 -0
- package/lib/client/session-registry.ts +111 -0
- package/lib/code-search.ts +121 -0
- package/lib/db/index.ts +48 -0
- package/lib/db/migrations.ts +45 -0
- package/lib/db/queries.ts +460 -0
- package/lib/db/schema.ts +114 -0
- package/lib/db/types.ts +92 -0
- package/lib/db.ts +2 -0
- package/lib/dev-servers.ts +509 -0
- package/lib/diff-parser.ts +221 -0
- package/lib/env-setup.ts +285 -0
- package/lib/file-upload.ts +34 -0
- package/lib/file-utils.ts +50 -0
- package/lib/files.ts +207 -0
- package/lib/git-history.ts +294 -0
- package/lib/git-status.ts +391 -0
- package/lib/git.ts +257 -0
- package/lib/mcp-config.ts +81 -0
- package/lib/multi-repo-git.ts +179 -0
- package/lib/notifications.ts +219 -0
- package/lib/orchestration.ts +448 -0
- package/lib/panes.ts +232 -0
- package/lib/ports.ts +97 -0
- package/lib/pr-generation.ts +307 -0
- package/lib/pr.ts +234 -0
- package/lib/projects.ts +578 -0
- package/lib/providers/registry.ts +70 -0
- package/lib/providers.ts +121 -0
- package/lib/query-client.ts +14 -0
- package/lib/rangeSelectionUtils.ts +65 -0
- package/lib/status-detector.ts +375 -0
- package/lib/terminal-themes.ts +265 -0
- package/lib/theme-config.ts +327 -0
- package/lib/utils.ts +6 -0
- package/lib/worktrees.ts +262 -0
- package/mcp/orchestration-server.ts +438 -0
- package/package.json +139 -0
- package/postcss.config.mjs +7 -0
- package/public/icon.svg +10 -0
- package/public/icons/icon-128x128.png +0 -0
- package/public/icons/icon-144x144.png +0 -0
- package/public/icons/icon-152x152.png +0 -0
- package/public/icons/icon-192x192.png +0 -0
- package/public/icons/icon-384x384.png +0 -0
- package/public/icons/icon-512x512.png +0 -0
- package/public/icons/icon-72x72.png +0 -0
- package/public/icons/icon-96x96.png +0 -0
- package/public/manifest.json +61 -0
- package/public/sw.js +64 -0
- package/scripts/agent-os +91 -0
- package/scripts/install.sh +48 -0
- package/scripts/lib/ai-clis.sh +132 -0
- package/scripts/lib/commands.sh +487 -0
- package/scripts/lib/common.sh +89 -0
- package/scripts/lib/prerequisites.sh +462 -0
- package/scripts/setup.sh +134 -0
- package/server.ts +155 -0
- package/stores/fileOpen.ts +26 -0
- package/stores/index.ts +1 -0
- package/stores/initialPrompt.ts +24 -0
- package/stores/sessionSelection.ts +48 -0
- package/styles/themes.css +603 -0
- package/tsconfig.json +33 -0
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { SessionList } from "@/components/SessionList";
|
|
4
|
+
import { NewSessionDialog } from "@/components/NewSessionDialog";
|
|
5
|
+
import { NotificationSettings } from "@/components/NotificationSettings";
|
|
6
|
+
import { StartServerDialog } from "@/components/DevServers/StartServerDialog";
|
|
7
|
+
import { SidebarFooter } from "@/components/SidebarFooter";
|
|
8
|
+
import { Button } from "@/components/ui/button";
|
|
9
|
+
import {
|
|
10
|
+
PanelLeftClose,
|
|
11
|
+
PanelLeft,
|
|
12
|
+
Plus,
|
|
13
|
+
Copy,
|
|
14
|
+
Check,
|
|
15
|
+
Command,
|
|
16
|
+
} from "lucide-react";
|
|
17
|
+
import { PaneLayout } from "@/components/PaneLayout";
|
|
18
|
+
import {
|
|
19
|
+
Tooltip,
|
|
20
|
+
TooltipContent,
|
|
21
|
+
TooltipTrigger,
|
|
22
|
+
} from "@/components/ui/tooltip";
|
|
23
|
+
import { QuickSwitcher } from "@/components/QuickSwitcher";
|
|
24
|
+
import type { ViewProps } from "./types";
|
|
25
|
+
import { fileOpenActions } from "@/stores/fileOpen";
|
|
26
|
+
|
|
27
|
+
export function DesktopView({
|
|
28
|
+
sessions,
|
|
29
|
+
projects,
|
|
30
|
+
sessionStatuses,
|
|
31
|
+
sidebarOpen,
|
|
32
|
+
setSidebarOpen,
|
|
33
|
+
activeSession,
|
|
34
|
+
focusedActiveTab,
|
|
35
|
+
copiedSessionId,
|
|
36
|
+
setCopiedSessionId,
|
|
37
|
+
showNewSessionDialog,
|
|
38
|
+
setShowNewSessionDialog,
|
|
39
|
+
newSessionProjectId,
|
|
40
|
+
showNotificationSettings,
|
|
41
|
+
setShowNotificationSettings,
|
|
42
|
+
showQuickSwitcher,
|
|
43
|
+
setShowQuickSwitcher,
|
|
44
|
+
notificationSettings,
|
|
45
|
+
permissionGranted,
|
|
46
|
+
updateSettings,
|
|
47
|
+
requestPermission,
|
|
48
|
+
attachToSession,
|
|
49
|
+
openSessionInNewTab,
|
|
50
|
+
handleNewSessionInProject,
|
|
51
|
+
handleOpenTerminal,
|
|
52
|
+
handleSessionCreated,
|
|
53
|
+
handleCreateProject,
|
|
54
|
+
handleStartDevServer,
|
|
55
|
+
handleCreateDevServer,
|
|
56
|
+
startDevServerProject,
|
|
57
|
+
setStartDevServerProjectId,
|
|
58
|
+
newClaudeSession,
|
|
59
|
+
resumeClaudeSession,
|
|
60
|
+
renderPane,
|
|
61
|
+
}: ViewProps) {
|
|
62
|
+
return (
|
|
63
|
+
<div className="bg-background flex h-screen overflow-hidden">
|
|
64
|
+
{/* Desktop Sidebar */}
|
|
65
|
+
<div
|
|
66
|
+
className={` ${sidebarOpen ? "w-72" : "w-0"} bg-sidebar-background flex-shrink-0 overflow-hidden shadow-xl shadow-black/10 transition-all duration-200 dark:shadow-black/30`}
|
|
67
|
+
>
|
|
68
|
+
<div className="flex h-full flex-col">
|
|
69
|
+
{/* Session list */}
|
|
70
|
+
<div className="min-h-0 flex-1 overflow-hidden">
|
|
71
|
+
<SessionList
|
|
72
|
+
activeSessionId={focusedActiveTab?.sessionId || undefined}
|
|
73
|
+
sessionStatuses={sessionStatuses}
|
|
74
|
+
onSelect={(id) => {
|
|
75
|
+
const session = sessions.find((s) => s.id === id);
|
|
76
|
+
if (session) attachToSession(session);
|
|
77
|
+
}}
|
|
78
|
+
onOpenInTab={(id) => {
|
|
79
|
+
const session = sessions.find((s) => s.id === id);
|
|
80
|
+
if (session) openSessionInNewTab(session);
|
|
81
|
+
}}
|
|
82
|
+
onNewSessionInProject={handleNewSessionInProject}
|
|
83
|
+
onOpenTerminal={handleOpenTerminal}
|
|
84
|
+
onStartDevServer={handleStartDevServer}
|
|
85
|
+
onCreateDevServer={handleCreateDevServer}
|
|
86
|
+
onResumeClaudeSession={resumeClaudeSession}
|
|
87
|
+
onNewSession={newClaudeSession}
|
|
88
|
+
/>
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<SidebarFooter />
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
{/* Main content */}
|
|
96
|
+
<div className="flex min-w-0 flex-1 flex-col">
|
|
97
|
+
{/* Header */}
|
|
98
|
+
<header className="flex items-center justify-between px-4 py-2">
|
|
99
|
+
<div className="flex items-center gap-2">
|
|
100
|
+
<Button
|
|
101
|
+
variant="ghost"
|
|
102
|
+
size="icon-sm"
|
|
103
|
+
onClick={() => setSidebarOpen(!sidebarOpen)}
|
|
104
|
+
>
|
|
105
|
+
{sidebarOpen ? (
|
|
106
|
+
<PanelLeftClose className="h-4 w-4" />
|
|
107
|
+
) : (
|
|
108
|
+
<PanelLeft className="h-4 w-4" />
|
|
109
|
+
)}
|
|
110
|
+
</Button>
|
|
111
|
+
|
|
112
|
+
{activeSession && (
|
|
113
|
+
<div className="flex items-center gap-2">
|
|
114
|
+
<span className="font-medium">{activeSession.name}</span>
|
|
115
|
+
{activeSession.tmux_name && (
|
|
116
|
+
<span className="text-muted-foreground text-xs">
|
|
117
|
+
{activeSession.tmux_name}
|
|
118
|
+
</span>
|
|
119
|
+
)}
|
|
120
|
+
<Tooltip>
|
|
121
|
+
<TooltipTrigger asChild>
|
|
122
|
+
<Button
|
|
123
|
+
variant="ghost"
|
|
124
|
+
size="icon-sm"
|
|
125
|
+
className="h-6 w-6"
|
|
126
|
+
onClick={async () => {
|
|
127
|
+
try {
|
|
128
|
+
if (navigator.clipboard) {
|
|
129
|
+
await navigator.clipboard.writeText(
|
|
130
|
+
activeSession.id
|
|
131
|
+
);
|
|
132
|
+
} else {
|
|
133
|
+
// Fallback for non-HTTPS contexts
|
|
134
|
+
const textarea = document.createElement("textarea");
|
|
135
|
+
textarea.value = activeSession.id;
|
|
136
|
+
textarea.style.position = "fixed";
|
|
137
|
+
textarea.style.opacity = "0";
|
|
138
|
+
document.body.appendChild(textarea);
|
|
139
|
+
textarea.select();
|
|
140
|
+
document.execCommand("copy");
|
|
141
|
+
document.body.removeChild(textarea);
|
|
142
|
+
}
|
|
143
|
+
setCopiedSessionId(true);
|
|
144
|
+
setTimeout(() => setCopiedSessionId(false), 2000);
|
|
145
|
+
} catch {
|
|
146
|
+
console.error("Failed to copy to clipboard");
|
|
147
|
+
}
|
|
148
|
+
}}
|
|
149
|
+
>
|
|
150
|
+
{copiedSessionId ? (
|
|
151
|
+
<Check className="h-3 w-3 text-green-500" />
|
|
152
|
+
) : (
|
|
153
|
+
<Copy className="h-3 w-3" />
|
|
154
|
+
)}
|
|
155
|
+
</Button>
|
|
156
|
+
</TooltipTrigger>
|
|
157
|
+
<TooltipContent>
|
|
158
|
+
<p>Copy session ID for orchestration</p>
|
|
159
|
+
<p className="text-muted-foreground font-mono text-xs">
|
|
160
|
+
{activeSession.id.slice(0, 8)}...
|
|
161
|
+
</p>
|
|
162
|
+
</TooltipContent>
|
|
163
|
+
</Tooltip>
|
|
164
|
+
</div>
|
|
165
|
+
)}
|
|
166
|
+
</div>
|
|
167
|
+
|
|
168
|
+
<div className="flex items-center gap-2">
|
|
169
|
+
<Tooltip>
|
|
170
|
+
<TooltipTrigger asChild>
|
|
171
|
+
<Button
|
|
172
|
+
variant="ghost"
|
|
173
|
+
size="icon-sm"
|
|
174
|
+
onClick={() => setShowQuickSwitcher(true)}
|
|
175
|
+
>
|
|
176
|
+
<Command className="h-4 w-4" />
|
|
177
|
+
</Button>
|
|
178
|
+
</TooltipTrigger>
|
|
179
|
+
<TooltipContent>
|
|
180
|
+
<p>Quick switch</p>
|
|
181
|
+
<p className="text-muted-foreground text-xs">⌘K</p>
|
|
182
|
+
</TooltipContent>
|
|
183
|
+
</Tooltip>
|
|
184
|
+
<NotificationSettings
|
|
185
|
+
open={showNotificationSettings}
|
|
186
|
+
onOpenChange={setShowNotificationSettings}
|
|
187
|
+
settings={notificationSettings}
|
|
188
|
+
permissionGranted={permissionGranted}
|
|
189
|
+
waitingSessions={sessions
|
|
190
|
+
.filter((s) => sessionStatuses[s.id]?.status === "waiting")
|
|
191
|
+
.map((s) => ({ id: s.id, name: s.name }))}
|
|
192
|
+
onUpdateSettings={updateSettings}
|
|
193
|
+
onRequestPermission={requestPermission}
|
|
194
|
+
onSelectSession={(id) => {
|
|
195
|
+
const session = sessions.find((s) => s.id === id);
|
|
196
|
+
if (session) attachToSession(session);
|
|
197
|
+
}}
|
|
198
|
+
/>
|
|
199
|
+
<Button size="sm" onClick={() => newClaudeSession()}>
|
|
200
|
+
<Plus className="mr-1 h-4 w-4" />
|
|
201
|
+
New Session
|
|
202
|
+
</Button>
|
|
203
|
+
</div>
|
|
204
|
+
</header>
|
|
205
|
+
|
|
206
|
+
{/* Pane Layout - full height */}
|
|
207
|
+
<div className="min-h-0 flex-1">
|
|
208
|
+
<PaneLayout renderPane={renderPane} />
|
|
209
|
+
</div>
|
|
210
|
+
</div>
|
|
211
|
+
|
|
212
|
+
{/* Dialogs */}
|
|
213
|
+
<NewSessionDialog
|
|
214
|
+
open={showNewSessionDialog}
|
|
215
|
+
projects={projects}
|
|
216
|
+
selectedProjectId={newSessionProjectId ?? undefined}
|
|
217
|
+
onClose={() => setShowNewSessionDialog(false)}
|
|
218
|
+
onCreated={handleSessionCreated}
|
|
219
|
+
onCreateProject={handleCreateProject}
|
|
220
|
+
/>
|
|
221
|
+
<QuickSwitcher
|
|
222
|
+
open={showQuickSwitcher}
|
|
223
|
+
onOpenChange={setShowQuickSwitcher}
|
|
224
|
+
currentSessionId={focusedActiveTab?.sessionId ?? undefined}
|
|
225
|
+
activeSessionWorkingDir={activeSession?.working_directory ?? undefined}
|
|
226
|
+
onResumeClaudeSession={resumeClaudeSession}
|
|
227
|
+
onSelectFile={(file, line) => {
|
|
228
|
+
const absolutePath = activeSession?.working_directory
|
|
229
|
+
? `${activeSession.working_directory}/${file.replace(/^\.\//, "")}`
|
|
230
|
+
: file;
|
|
231
|
+
fileOpenActions.requestOpen(absolutePath, line);
|
|
232
|
+
}}
|
|
233
|
+
/>
|
|
234
|
+
{startDevServerProject && (
|
|
235
|
+
<StartServerDialog
|
|
236
|
+
project={startDevServerProject}
|
|
237
|
+
projectDevServers={startDevServerProject.devServers}
|
|
238
|
+
onStart={handleCreateDevServer}
|
|
239
|
+
onClose={() => setStartDevServerProjectId(null)}
|
|
240
|
+
/>
|
|
241
|
+
)}
|
|
242
|
+
</div>
|
|
243
|
+
);
|
|
244
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { SessionList } from "@/components/SessionList";
|
|
4
|
+
import { NewSessionDialog } from "@/components/NewSessionDialog";
|
|
5
|
+
import { StartServerDialog } from "@/components/DevServers/StartServerDialog";
|
|
6
|
+
import { SidebarFooter } from "@/components/SidebarFooter";
|
|
7
|
+
import { PaneLayout } from "@/components/PaneLayout";
|
|
8
|
+
import { SwipeSidebar } from "@/components/mobile/SwipeSidebar";
|
|
9
|
+
import { QuickSwitcher } from "@/components/QuickSwitcher";
|
|
10
|
+
import type { ViewProps } from "./types";
|
|
11
|
+
import { fileOpenActions } from "@/stores/fileOpen";
|
|
12
|
+
|
|
13
|
+
export function MobileView({
|
|
14
|
+
sessions,
|
|
15
|
+
projects,
|
|
16
|
+
sessionStatuses,
|
|
17
|
+
sidebarOpen,
|
|
18
|
+
setSidebarOpen,
|
|
19
|
+
activeSession,
|
|
20
|
+
focusedActiveTab,
|
|
21
|
+
showNewSessionDialog,
|
|
22
|
+
setShowNewSessionDialog,
|
|
23
|
+
newSessionProjectId,
|
|
24
|
+
showQuickSwitcher,
|
|
25
|
+
setShowQuickSwitcher,
|
|
26
|
+
attachToSession,
|
|
27
|
+
openSessionInNewTab,
|
|
28
|
+
handleNewSessionInProject,
|
|
29
|
+
handleOpenTerminal,
|
|
30
|
+
handleSessionCreated,
|
|
31
|
+
handleCreateProject,
|
|
32
|
+
handleStartDevServer,
|
|
33
|
+
handleCreateDevServer,
|
|
34
|
+
startDevServerProject,
|
|
35
|
+
setStartDevServerProjectId,
|
|
36
|
+
newClaudeSession,
|
|
37
|
+
resumeClaudeSession,
|
|
38
|
+
renderPane,
|
|
39
|
+
}: ViewProps) {
|
|
40
|
+
return (
|
|
41
|
+
<main className="h-app bg-background flex flex-col overflow-hidden">
|
|
42
|
+
{/* Swipe sidebar */}
|
|
43
|
+
<SwipeSidebar isOpen={sidebarOpen} onClose={() => setSidebarOpen(false)}>
|
|
44
|
+
<div className="flex h-full flex-col">
|
|
45
|
+
{/* Session list */}
|
|
46
|
+
<div className="min-h-0 flex-1 overflow-hidden">
|
|
47
|
+
<SessionList
|
|
48
|
+
activeSessionId={focusedActiveTab?.sessionId || undefined}
|
|
49
|
+
sessionStatuses={sessionStatuses}
|
|
50
|
+
onSelect={(id) => {
|
|
51
|
+
const session = sessions.find((s) => s.id === id);
|
|
52
|
+
if (session) attachToSession(session);
|
|
53
|
+
setSidebarOpen(false);
|
|
54
|
+
}}
|
|
55
|
+
onOpenInTab={(id) => {
|
|
56
|
+
const session = sessions.find((s) => s.id === id);
|
|
57
|
+
if (session) openSessionInNewTab(session);
|
|
58
|
+
setSidebarOpen(false);
|
|
59
|
+
}}
|
|
60
|
+
onNewSessionInProject={handleNewSessionInProject}
|
|
61
|
+
onOpenTerminal={handleOpenTerminal}
|
|
62
|
+
onStartDevServer={handleStartDevServer}
|
|
63
|
+
onCreateDevServer={handleCreateDevServer}
|
|
64
|
+
onResumeClaudeSession={resumeClaudeSession}
|
|
65
|
+
onNewSession={newClaudeSession}
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<SidebarFooter />
|
|
70
|
+
</div>
|
|
71
|
+
</SwipeSidebar>
|
|
72
|
+
|
|
73
|
+
{/* Terminal fills the screen */}
|
|
74
|
+
<div className="min-h-0 w-full flex-1">
|
|
75
|
+
<PaneLayout renderPane={renderPane} />
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
{/* Dialogs */}
|
|
79
|
+
<NewSessionDialog
|
|
80
|
+
open={showNewSessionDialog}
|
|
81
|
+
projects={projects}
|
|
82
|
+
selectedProjectId={newSessionProjectId ?? undefined}
|
|
83
|
+
onClose={() => setShowNewSessionDialog(false)}
|
|
84
|
+
onCreated={handleSessionCreated}
|
|
85
|
+
onCreateProject={handleCreateProject}
|
|
86
|
+
/>
|
|
87
|
+
<QuickSwitcher
|
|
88
|
+
open={showQuickSwitcher}
|
|
89
|
+
onOpenChange={setShowQuickSwitcher}
|
|
90
|
+
currentSessionId={focusedActiveTab?.sessionId ?? undefined}
|
|
91
|
+
activeSessionWorkingDir={activeSession?.working_directory ?? undefined}
|
|
92
|
+
onResumeClaudeSession={resumeClaudeSession}
|
|
93
|
+
onSelectFile={(file, line) => {
|
|
94
|
+
const absolutePath = activeSession?.working_directory
|
|
95
|
+
? `${activeSession.working_directory}/${file.replace(/^\.\//, "")}`
|
|
96
|
+
: file;
|
|
97
|
+
fileOpenActions.requestOpen(absolutePath, line);
|
|
98
|
+
}}
|
|
99
|
+
/>
|
|
100
|
+
{startDevServerProject && (
|
|
101
|
+
<StartServerDialog
|
|
102
|
+
project={startDevServerProject}
|
|
103
|
+
projectDevServers={startDevServerProject.devServers}
|
|
104
|
+
onStart={handleCreateDevServer}
|
|
105
|
+
onClose={() => setStartDevServerProjectId(null)}
|
|
106
|
+
/>
|
|
107
|
+
)}
|
|
108
|
+
</main>
|
|
109
|
+
);
|
|
110
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { Session } from "@/lib/db";
|
|
2
|
+
import type { ProjectWithDevServers } from "@/lib/projects";
|
|
3
|
+
import type { NotificationSettings } from "@/lib/notifications";
|
|
4
|
+
import type { TabData } from "@/lib/panes";
|
|
5
|
+
|
|
6
|
+
export interface SessionStatus {
|
|
7
|
+
sessionName: string;
|
|
8
|
+
status: "idle" | "running" | "waiting" | "error" | "dead";
|
|
9
|
+
lastLine?: string;
|
|
10
|
+
claudeSessionId?: string | null;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface ViewProps {
|
|
14
|
+
sessions: Session[];
|
|
15
|
+
projects: ProjectWithDevServers[];
|
|
16
|
+
sessionStatuses: Record<string, SessionStatus>;
|
|
17
|
+
sidebarOpen: boolean;
|
|
18
|
+
setSidebarOpen: (open: boolean) => void;
|
|
19
|
+
activeSession: Session | undefined;
|
|
20
|
+
focusedActiveTab: TabData | null;
|
|
21
|
+
copiedSessionId: boolean;
|
|
22
|
+
setCopiedSessionId: (copied: boolean) => void;
|
|
23
|
+
|
|
24
|
+
// Dialogs
|
|
25
|
+
showNewSessionDialog: boolean;
|
|
26
|
+
setShowNewSessionDialog: (show: boolean) => void;
|
|
27
|
+
newSessionProjectId: string | null;
|
|
28
|
+
showNotificationSettings: boolean;
|
|
29
|
+
setShowNotificationSettings: (show: boolean) => void;
|
|
30
|
+
showQuickSwitcher: boolean;
|
|
31
|
+
setShowQuickSwitcher: (show: boolean) => void;
|
|
32
|
+
|
|
33
|
+
// Notification settings
|
|
34
|
+
notificationSettings: NotificationSettings;
|
|
35
|
+
permissionGranted: boolean;
|
|
36
|
+
updateSettings: (settings: Partial<NotificationSettings>) => void;
|
|
37
|
+
requestPermission: () => Promise<boolean>;
|
|
38
|
+
|
|
39
|
+
// Handlers
|
|
40
|
+
attachToSession: (session: Session) => void;
|
|
41
|
+
openSessionInNewTab: (session: Session) => void;
|
|
42
|
+
handleNewSessionInProject: (projectId: string) => void;
|
|
43
|
+
handleOpenTerminal: (projectId: string) => void;
|
|
44
|
+
handleSessionCreated: (sessionId: string) => Promise<void>;
|
|
45
|
+
handleCreateProject: (
|
|
46
|
+
name: string,
|
|
47
|
+
workingDirectory: string,
|
|
48
|
+
agentType?: string
|
|
49
|
+
) => Promise<string | null>;
|
|
50
|
+
|
|
51
|
+
// Dev server (for StartServerDialog)
|
|
52
|
+
handleStartDevServer: (projectId: string) => void;
|
|
53
|
+
handleCreateDevServer: (opts: {
|
|
54
|
+
projectId: string;
|
|
55
|
+
type: "node" | "docker";
|
|
56
|
+
name: string;
|
|
57
|
+
command: string;
|
|
58
|
+
workingDirectory: string;
|
|
59
|
+
ports?: number[];
|
|
60
|
+
}) => Promise<void>;
|
|
61
|
+
startDevServerProject: ProjectWithDevServers | null;
|
|
62
|
+
setStartDevServerProjectId: (id: string | null) => void;
|
|
63
|
+
|
|
64
|
+
// Claude sessions
|
|
65
|
+
newClaudeSession: (cwd?: string, projectName?: string) => void;
|
|
66
|
+
resumeClaudeSession: (
|
|
67
|
+
claudeSessionId: string,
|
|
68
|
+
cwd: string,
|
|
69
|
+
summary?: string,
|
|
70
|
+
projectName?: string
|
|
71
|
+
) => void;
|
|
72
|
+
|
|
73
|
+
// Pane
|
|
74
|
+
renderPane: (paneId: string) => React.ReactNode;
|
|
75
|
+
}
|