From 5b5b6abf475e2475b0daec7f3f49eb9a8f35207f Mon Sep 17 00:00:00 2001 From: urjitc <135136842+urjitc@users.noreply.github.com> Date: Wed, 29 Apr 2026 21:19:47 +0000 Subject: [PATCH 1/2] Rename dashboard to workspace terminology and remove legacy routes Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --- public/robots.txt | 1 - src/app/dashboard/[slug]/page.tsx | 23 ----------- src/app/home/layout.tsx | 2 +- src/app/share-copy/[id]/page.tsx | 2 +- src/app/workspace/[slug]/page.tsx | 4 +- src/components/chat/ChatPanel.tsx | 2 +- ...ashboardLayout.tsx => WorkspaceLayout.tsx} | 8 ++-- .../modals/PasswordProtectedPdfDialog.tsx | 2 +- .../workspace-canvas/WorkspaceSection.tsx | 2 +- .../workspace/WorkspaceShell.tsx} | 39 +++++++------------ src/contexts/WorkspaceContext.tsx | 4 -- src/lib/layout-constants.ts | 2 +- src/lib/stores/ui-store.ts | 2 +- 13 files changed, 27 insertions(+), 66 deletions(-) delete mode 100644 src/app/dashboard/[slug]/page.tsx rename src/components/layout/{DashboardLayout.tsx => WorkspaceLayout.tsx} (97%) rename src/{app/dashboard/page.tsx => components/workspace/WorkspaceShell.tsx} (95%) diff --git a/public/robots.txt b/public/robots.txt index 938882ce..52708d58 100644 --- a/public/robots.txt +++ b/public/robots.txt @@ -8,7 +8,6 @@ Allow: /api/share/* # Disallow private/workspace areas Disallow: /workspace/ -Disallow: /dashboard/ # Legacy route, redirects to /workspace Disallow: /auth/ Disallow: /api/ Disallow: /_next/ diff --git a/src/app/dashboard/[slug]/page.tsx b/src/app/dashboard/[slug]/page.tsx deleted file mode 100644 index 679b125b..00000000 --- a/src/app/dashboard/[slug]/page.tsx +++ /dev/null @@ -1,23 +0,0 @@ -"use client"; - -/** - * Legacy route: /dashboard/[slug] - * Redirects to /workspace/[slug] for backwards compatibility - */ -import { useRouter, useParams } from "next/navigation"; -import { useEffect } from "react"; - -export default function DashboardSlugPage() { - const router = useRouter(); - const params = useParams(); - const slug = params?.slug as string; - - useEffect(() => { - if (slug) { - router.replace(`/workspace/${slug}`); - } - }, [router, slug]); - - return null; -} - diff --git a/src/app/home/layout.tsx b/src/app/home/layout.tsx index 1039f1e2..05b8f1ee 100644 --- a/src/app/home/layout.tsx +++ b/src/app/home/layout.tsx @@ -11,7 +11,7 @@ const ogImage = getFullImageUrl(seoConfig.defaultImage); export const metadata: Metadata = { title: pageTitle, description: pageDescription, - keywords: ["home", "workspaces", "dashboard", "productivity tools"], + keywords: ["home", "workspaces", "productivity tools"], authors: [{ name: seoConfig.author }], robots: { index: true, follow: true }, alternates: { canonical: pageUrl }, diff --git a/src/app/share-copy/[id]/page.tsx b/src/app/share-copy/[id]/page.tsx index e4e49133..d684cf86 100644 --- a/src/app/share-copy/[id]/page.tsx +++ b/src/app/share-copy/[id]/page.tsx @@ -161,7 +161,7 @@ export default function SharePage() { if (session && !session.user.isAnonymous) { const handleModalClose = (open: boolean) => { if (!open) { - // Redirect to dashboard when modal is closed without importing + // Redirect to home when modal is closed without importing router.push("/home"); } }; diff --git a/src/app/workspace/[slug]/page.tsx b/src/app/workspace/[slug]/page.tsx index 72e8b42d..09f1ca0b 100644 --- a/src/app/workspace/[slug]/page.tsx +++ b/src/app/workspace/[slug]/page.tsx @@ -1,7 +1,7 @@ "use client"; -import { DashboardShell } from "../../dashboard/page"; +import { WorkspaceShell } from "@/components/workspace/WorkspaceShell"; export default function WorkspacePage() { - return ; + return ; } diff --git a/src/components/chat/ChatPanel.tsx b/src/components/chat/ChatPanel.tsx index bb3e8832..c6938f5d 100644 --- a/src/components/chat/ChatPanel.tsx +++ b/src/components/chat/ChatPanel.tsx @@ -22,7 +22,7 @@ interface ChatPanelProps { /** * Renders the chat panel chrome (header, message list, composer, dropzone). * Assumes both `ChatProvider` and `ComposerProvider` already wrap this tree — - * `DashboardLayout` mounts them once at the layout level so workspace UI + * `WorkspaceLayout` mounts them once at the layout level so workspace UI * outside the chat panel can also drive the composer. */ export function ChatPanel({ diff --git a/src/components/layout/DashboardLayout.tsx b/src/components/layout/WorkspaceLayout.tsx similarity index 97% rename from src/components/layout/DashboardLayout.tsx rename to src/components/layout/WorkspaceLayout.tsx index f8de769e..d07d8e79 100644 --- a/src/components/layout/DashboardLayout.tsx +++ b/src/components/layout/WorkspaceLayout.tsx @@ -8,7 +8,7 @@ import { WorkspaceCanvasDropzone } from "@/components/workspace-canvas/Workspace import { PANEL_DEFAULTS } from "@/lib/layout-constants"; import React from "react"; -interface DashboardLayoutProps { +interface WorkspaceLayoutProps { // Workspace sidebar currentWorkspaceId: string | null; onWorkspaceSwitch: (slug: string) => void; @@ -28,10 +28,10 @@ interface DashboardLayoutProps { } /** - * Main dashboard layout component. + * Main workspace layout component. * Handles the overall structure including sidebars and layout animations. */ -export function DashboardLayout({ +export function WorkspaceLayout({ currentWorkspaceId, onWorkspaceSwitch, showCreateModal, @@ -42,7 +42,7 @@ export function DashboardLayout({ setIsChatMaximized, workspaceSection, workspaceHeader, -}: DashboardLayoutProps) { +}: WorkspaceLayoutProps) { // Render logic // Ensure chat is only shown when a workspace is active const effectiveChatExpanded = isChatExpanded && !!currentWorkspaceId; diff --git a/src/components/modals/PasswordProtectedPdfDialog.tsx b/src/components/modals/PasswordProtectedPdfDialog.tsx index e4055627..a851381d 100644 --- a/src/components/modals/PasswordProtectedPdfDialog.tsx +++ b/src/components/modals/PasswordProtectedPdfDialog.tsx @@ -30,7 +30,7 @@ export function emitPasswordProtectedPdf(fileNames: string[]) { * Global dialog that warns users about password-protected PDFs * and links them to iLovePDF to unlock. * - * Mount this once near the app root (e.g. dashboard shell or DashboardLayout). + * Mount this once near the app root (e.g. WorkspaceShell or WorkspaceLayout). */ export function PasswordProtectedPdfDialog() { const [open, setOpen] = useState(false); diff --git a/src/components/workspace-canvas/WorkspaceSection.tsx b/src/components/workspace-canvas/WorkspaceSection.tsx index 36910e44..c425c14f 100644 --- a/src/components/workspace-canvas/WorkspaceSection.tsx +++ b/src/components/workspace-canvas/WorkspaceSection.tsx @@ -503,7 +503,7 @@ export function WorkspaceSection({ onMouseDown={handleWorkspaceMouseDown} > - {/* WorkspaceHeader is now rendered in DashboardLayout above the sidebar */} + {/* WorkspaceHeader is now rendered in WorkspaceLayout above the sidebar */} {/* Modal Manager - Renders over content */} {openItemView} diff --git a/src/app/dashboard/page.tsx b/src/components/workspace/WorkspaceShell.tsx similarity index 95% rename from src/app/dashboard/page.tsx rename to src/components/workspace/WorkspaceShell.tsx index 7a6acf15..c88f7871 100644 --- a/src/app/dashboard/page.tsx +++ b/src/components/workspace/WorkspaceShell.tsx @@ -1,7 +1,6 @@ "use client"; import { useCallback, useEffect, useRef, useState } from "react"; -import { useRouter } from "next/navigation"; import type { WorkspaceWithState } from "@/lib/workspace-state/types"; import { useKeyboardShortcuts } from "@/hooks/ui/use-keyboard-shortcuts"; import useMediaQuery from "@/hooks/ui/use-media-query"; @@ -17,7 +16,7 @@ import { useWorkspaceStore } from "@/lib/stores/workspace-store"; import { useSession } from "@/lib/auth-client"; import { WorkspaceSection } from "@/components/workspace-canvas/WorkspaceSection"; import { OpenWorkspaceItemView } from "@/components/workspace-canvas/OpenWorkspaceItemView"; -import { DashboardLayout } from "@/components/layout/DashboardLayout"; +import { WorkspaceLayout } from "@/components/layout/WorkspaceLayout"; import WorkspaceHeader from "@/components/workspace-canvas/WorkspaceHeader"; import { WorkspaceSearchDialog } from "@/components/workspace-canvas/WorkspaceSearchDialog"; import { useSidebar } from "@/components/ui/sidebar"; @@ -53,16 +52,16 @@ import { getDocumentUploadSuccessMessage, } from "@/lib/uploads/upload-feedback"; -// Main dashboard content component -interface DashboardContentProps { +// Main workspace content component +interface WorkspaceContentProps { currentWorkspace: WorkspaceWithState | null; loadingCurrentWorkspace: boolean; } -function DashboardContent({ +function WorkspaceContent({ currentWorkspace, loadingCurrentWorkspace, -}: DashboardContentProps) { +}: WorkspaceContentProps) { const { data: session } = useSession(); const currentWorkspaceId = currentWorkspace?.id || null; @@ -234,7 +233,7 @@ function DashboardContent({ itemIds: createdIds, onOcrError: (error) => { console.error( - "[DASHBOARD_PROCESSING] Failed to start processing:", + "[WORKSPACE_PROCESSING] Failed to start processing:", error, ); }, @@ -257,7 +256,7 @@ function DashboardContent({ open={showOnboardingDialog} onOpenChange={setShowOnboardingDialog} /> */} - - + ); } -// Inner component with all the dashboard hooks +// Inner component with all the workspace hooks // Only rendered when InviteGuard allows (authenticated + invite processed) -function DashboardView() { +function WorkspaceView() { // Get workspace context - currentWorkspace is loaded directly by slug (fast path) const { currentWorkspace, loadingCurrentWorkspace, markWorkspaceOpened } = useWorkspaceContext(); @@ -419,7 +418,7 @@ function DashboardView() { return ( - @@ -428,7 +427,7 @@ function DashboardView() { ); } -export function DashboardShell() { +export function WorkspaceShell() { return ( <> @@ -436,7 +435,7 @@ export function DashboardShell() { {/* */} - + {/* */} @@ -444,13 +443,3 @@ export function DashboardShell() { ); } - -export default function Page() { - const router = useRouter(); - - useEffect(() => { - router.replace("/workspace"); - }, [router]); - - return null; -} diff --git a/src/contexts/WorkspaceContext.tsx b/src/contexts/WorkspaceContext.tsx index 857a9b22..3138fd90 100644 --- a/src/contexts/WorkspaceContext.tsx +++ b/src/contexts/WorkspaceContext.tsx @@ -61,10 +61,6 @@ export function WorkspaceProvider({ if (pathname.startsWith("/workspace/") && pathname !== "/workspace") { return pathname.replace("/workspace/", ""); } - // Backwards compatibility: also check /dashboard/ - if (pathname.startsWith("/dashboard/") && pathname !== "/dashboard") { - return pathname.replace("/dashboard/", ""); - } return null; }, [pathname]); diff --git a/src/lib/layout-constants.ts b/src/lib/layout-constants.ts index fe9f9269..bc36241d 100644 --- a/src/lib/layout-constants.ts +++ b/src/lib/layout-constants.ts @@ -2,7 +2,7 @@ * Layout Constants * * Centralized configuration for all layout-related magic numbers. - * These values control the responsive behavior of the dashboard layout. + * These values control the responsive behavior of the workspace layout. */ // ===== SIDEBAR WIDTHS ===== diff --git a/src/lib/stores/ui-store.ts b/src/lib/stores/ui-store.ts index ba1ad9db..7010474a 100644 --- a/src/lib/stores/ui-store.ts +++ b/src/lib/stores/ui-store.ts @@ -5,7 +5,7 @@ import { getDefaultChatModelId } from "@/lib/ai/models"; /** * UI Store - Manages all UI state (chat, modals, search, layout, reply context) - * This replaces scattered useState hooks in dashboard + * This replaces scattered useState hooks in workspace */ /** Column / keyboard focus when two items are open (split). */ From 1246f737e550f8d579ff2ef35c1adb061d647b8b Mon Sep 17 00:00:00 2001 From: urjitc <135136842+urjitc@users.noreply.github.com> Date: Wed, 29 Apr 2026 21:23:23 +0000 Subject: [PATCH 2/2] fix: remove duplicate comments in WorkspaceShell.tsx Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --- src/components/workspace/WorkspaceShell.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/workspace/WorkspaceShell.tsx b/src/components/workspace/WorkspaceShell.tsx index c88f7871..c7b0e871 100644 --- a/src/components/workspace/WorkspaceShell.tsx +++ b/src/components/workspace/WorkspaceShell.tsx @@ -368,8 +368,6 @@ function WorkspaceContent({ ); } -// Main page component -// Main page component // Main page component (wrapper) export function WorkspacePage() { return (