Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -679,15 +679,19 @@ function AppInner() {
/>
<MainContent>
<ContentArea>
{selectedWorkspace ? (
{selectedWorkspace?.workspacePath ? (
<ErrorBoundary
workspaceInfo={`${selectedWorkspace.projectName}/${selectedWorkspace.workspacePath.split("/").pop() ?? ""}`}
workspaceInfo={`${selectedWorkspace.projectName}/${selectedWorkspace.workspacePath?.split("/").pop() ?? selectedWorkspace.workspaceId ?? "unknown"}`}
>
<AIView
key={selectedWorkspace.workspaceId}
workspaceId={selectedWorkspace.workspaceId}
projectName={selectedWorkspace.projectName}
branch={selectedWorkspace.workspacePath.split("/").pop() ?? ""}
branch={
selectedWorkspace.workspacePath?.split("/").pop() ??
selectedWorkspace.workspaceId ??
""
}
workspacePath={selectedWorkspace.workspacePath}
/>
</ErrorBoundary>
Expand Down
16 changes: 8 additions & 8 deletions src/utils/commands/sources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export function buildCoreSources(p: BuildSourcesParams): Array<() => CommandActi

// Remove current workspace (rename action intentionally omitted until we add a proper modal)
if (selected) {
const workspaceDisplayName = `${selected.projectName}/${selected.workspacePath.split("/").pop() ?? selected.workspacePath}`;
const workspaceDisplayName = `${selected.projectName}/${selected.workspacePath?.split("/").pop() ?? selected.workspacePath}`;
list.push({
id: "ws:open-terminal-current",
title: "Open Current Workspace in Terminal",
Expand Down Expand Up @@ -193,8 +193,8 @@ export function buildCoreSources(p: BuildSourcesParams): Array<() => CommandActi
name: "newName",
label: "New name",
placeholder: "Enter new workspace name",
initialValue: selected.workspacePath.split("/").pop() ?? "",
getInitialValue: () => selected.workspacePath.split("/").pop() ?? "",
initialValue: selected.workspacePath?.split("/").pop() ?? "",
getInitialValue: () => selected.workspacePath?.split("/").pop() ?? "",
validate: (v) => (!v.trim() ? "Name is required" : null),
},
],
Expand All @@ -221,7 +221,7 @@ export function buildCoreSources(p: BuildSourcesParams): Array<() => CommandActi
placeholder: "Search workspaces…",
getOptions: () =>
Array.from(p.workspaceMetadata.values()).map((meta) => {
const workspaceName = meta.workspacePath.split("/").pop() ?? meta.workspacePath;
const workspaceName = meta.workspacePath?.split("/").pop() ?? meta.workspacePath;
const label = `${meta.projectName} / ${workspaceName}`;
return {
id: meta.workspacePath,
Expand Down Expand Up @@ -251,7 +251,7 @@ export function buildCoreSources(p: BuildSourcesParams): Array<() => CommandActi
placeholder: "Search workspaces…",
getOptions: () =>
Array.from(p.workspaceMetadata.values()).map((meta) => {
const workspaceName = meta.workspacePath.split("/").pop() ?? meta.workspacePath;
const workspaceName = meta.workspacePath?.split("/").pop() ?? meta.workspacePath;
const label = `${meta.projectName} / ${workspaceName}`;
return {
id: meta.id,
Expand All @@ -269,7 +269,7 @@ export function buildCoreSources(p: BuildSourcesParams): Array<() => CommandActi
const meta = Array.from(p.workspaceMetadata.values()).find(
(m) => m.id === values.workspaceId
);
return meta ? (meta.workspacePath.split("/").pop() ?? "") : "";
return meta ? (meta.workspacePath?.split("/").pop() ?? "") : "";
},
validate: (v) => (!v.trim() ? "Name is required" : null),
},
Expand All @@ -294,7 +294,7 @@ export function buildCoreSources(p: BuildSourcesParams): Array<() => CommandActi
placeholder: "Search workspaces…",
getOptions: () =>
Array.from(p.workspaceMetadata.values()).map((meta) => {
const workspaceName = meta.workspacePath.split("/").pop() ?? meta.workspacePath;
const workspaceName = meta.workspacePath?.split("/").pop() ?? meta.workspacePath;
const label = `${meta.projectName}/${workspaceName}`;
return {
id: meta.id,
Expand All @@ -309,7 +309,7 @@ export function buildCoreSources(p: BuildSourcesParams): Array<() => CommandActi
(m) => m.id === vals.workspaceId
);
const workspaceName = meta
? `${meta.projectName}/${meta.workspacePath.split("/").pop() ?? meta.workspacePath}`
? `${meta.projectName}/${meta.workspacePath?.split("/").pop() ?? meta.workspacePath}`
: vals.workspaceId;
const ok = confirm(`Remove workspace ${workspaceName}? This cannot be undone.`);
if (ok) {
Expand Down