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
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ArrowLeftFromLine } from "lucide-react";

export function CrossVersionMismatchState() {
return (
<div className="flex h-full w-full items-center justify-center p-6">
<div className="flex w-full max-w-sm flex-col items-start gap-5">
<ArrowLeftFromLine
className="size-5 text-muted-foreground"
strokeWidth={1.5}
aria-hidden="true"
/>
<div className="flex flex-col gap-1.5">
<h1 className="text-[15px] font-medium tracking-tight text-foreground select-text cursor-text">
Pick a workspace
</h1>
<p className="text-[13px] leading-relaxed text-muted-foreground select-text cursor-text">
Select a workspace from the sidebar to get started.
</p>
</div>
</div>
</div>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { CrossVersionMismatchState } from "./CrossVersionMismatchState";
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
useWorkspaceSidebarStore,
} from "renderer/stores/workspace-sidebar-state";
import { AddRepositoryModals } from "./components/AddRepositoryModals";
import { CrossVersionMismatchState } from "./components/CrossVersionMismatchState";
import { TopBar } from "./components/TopBar";

export const Route = createFileRoute("/_authenticated/_dashboard")({
Expand All @@ -41,6 +42,15 @@ function DashboardLayout() {
});
const currentWorkspaceId =
currentWorkspaceMatch !== false ? currentWorkspaceMatch.workspaceId : null;
const v2WorkspaceMatch = matchRoute({
to: "/v2-workspace/$workspaceId",
fuzzy: true,
});
const onV1WorkspaceRoute = currentWorkspaceMatch !== false;
const onV2WorkspaceRoute = v2WorkspaceMatch !== false;
const versionMismatch =
(isV2CloudEnabled && onV1WorkspaceRoute) ||
(!isV2CloudEnabled && onV2WorkspaceRoute);

const { data: currentWorkspace } = electronTrpc.workspaces.get.useQuery(
{ id: currentWorkspaceId ?? "" },
Expand Down Expand Up @@ -134,7 +144,7 @@ function DashboardLayout() {
<div className="flex flex-1 min-h-0 min-w-0 overflow-hidden">
{!sidebarOutsideColumn && sidebarPanel}
<div className="flex flex-1 min-h-0 min-w-0">
<Outlet />
{versionMismatch ? <CrossVersionMismatchState /> : <Outlet />}
</div>
</div>
</div>
Expand Down
Loading