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
4 changes: 2 additions & 2 deletions components/editor/access-denied.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import Link from "next/link";
*/
export function AccessDenied() {
return (
<div className="flex h-full w-full items-center justify-center px-6">
<div className="absolute inset-0 flex items-center justify-center px-6">
<div className="flex max-w-md flex-col items-center gap-4 text-center">
<div className="flex h-16 w-16 items-center justify-center rounded-full bg-bg-elevated">
<div className="flex h-16 w-16 items-center justify-center rounded-full bg-bg-surface/80">
<Lock className="h-8 w-8 text-text-muted" />
</div>
<h1 className="text-xl font-semibold tracking-tight text-text-primary">
Expand Down
6 changes: 3 additions & 3 deletions components/editor/canvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ function CollaborativeFlow() {
return (
<div
ref={wrapperRef}
className="relative h-full w-full"
className="absolute inset-0"
onDragOver={handleDragOver}
onDrop={handleDrop}
>
Expand All @@ -249,7 +249,7 @@ function CollaborativeFlow() {
fitView
connectionMode={ConnectionMode.Loose}
proOptions={{ hideAttribution: true }}
className="bg-bg-base"
className="!bg-transparent"
>
<Background
variant={BackgroundVariant.Dots}
Expand All @@ -260,7 +260,7 @@ function CollaborativeFlow() {
<MiniMap
pannable
zoomable
className="!bg-bg-surface !border !border-border-default !rounded-xl"
className="!bg-bg-surface/80 !border !border-border-default !rounded-xl !shadow-lg"
nodeColor="var(--text-muted)"
maskColor="rgba(8, 8, 9, 0.7)"
/>
Expand Down
119 changes: 84 additions & 35 deletions components/editor/workspace-shell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { useState } from "react";
import { UserButton } from "@clerk/nextjs";
import { PanelLeftClose, PanelLeftOpen, Share2, MessageSquare, X } from "lucide-react";
import { PanelLeftClose, PanelLeftOpen, Share2, X, Network, Sparkles, Bot } from "lucide-react";

import { Button } from "@/components/ui/button";
import { ScrollArea } from "@/components/ui/scroll-area";
Expand Down Expand Up @@ -55,7 +55,7 @@ export function WorkspaceShell({
onToggleSidebar={() => setIsSidebarOpen((open) => !open)}
onToggleAiSidebar={() => setIsAiSidebarOpen((open) => !open)}
aiSidebarOpen={isAiSidebarOpen}
onShareClick={() => {}}
onShareClick={() => { }}
/>
<main className="relative flex-1 overflow-hidden">
<ProjectSidebar
Expand Down Expand Up @@ -86,14 +86,16 @@ export function WorkspaceShell({
onShareClick={shareDialog.onOpenChange}
/>
<main className="relative flex-1 overflow-hidden">
<div className="absolute inset-0">
<Canvas roomId={currentRoomId} />
</div>
<ProjectSidebar
isOpen={isSidebarOpen}
onClose={() => setIsSidebarOpen(false)}
ownedProjects={ownedProjects}
sharedProjects={sharedProjects}
currentRoomId={currentRoomId}
/>
<Canvas roomId={currentRoomId} />
<AiSidebar
isOpen={isAiSidebarOpen}
onClose={() => setIsAiSidebarOpen(false)}
Expand Down Expand Up @@ -153,13 +155,16 @@ function EditorNavbar({
<PanelLeftOpen className="h-5 w-5" />
)}
</button>
{projectName ? (
<span className="text-sm font-medium text-text-primary">
{projectName}
</span>
) : (
<span className="text-sm font-medium text-text-muted">Editor</span>
)}
<div className="flex flex-col">
{projectName ? (
<span className="text-sm font-semibold text-text-primary">
{projectName}
</span>
) : (
<span className="text-sm font-semibold text-text-primary">Ghost Room</span>
)}
<span className="text-[11px] font-medium text-text-faint">Workspace</span>
</div>
</div>
<div className="flex items-center gap-2">
<Button
Expand All @@ -169,31 +174,30 @@ function EditorNavbar({
className="gap-2"
onClick={() => onShareClick(true)}
>
<Share2 className="h-4 w-4" />
<Network className="h-4 w-4" />
Share
</Button>
<Button
type="button"
variant="ghost"
size="sm"
className={cn(
"gap-2",
aiSidebarOpen && "bg-bg-elevated text-text-primary",
"gap-2 bg-accent-primary/10 text-accent-primary hover:bg-accent-primary/20",
aiSidebarOpen && "bg-accent-primary/20",
)}
onClick={onToggleAiSidebar}
>
<MessageSquare className="h-4 w-4" />
AI Chat
<Sparkles className="h-4 w-4" />
AI
</Button>
</div>
<div className="flex items-center">
<UserButton
appearance={{
elements: {
userButtonBox: "h-9 w-9",
userButtonTrigger:
"h-9 w-9 rounded-xl ring-1 ring-border-default hover:ring-border-subtle transition",
userButtonAvatarBox: "h-9 w-9 rounded-xl",
"h-9 w-9 rounded-full ring-1 ring-border-default hover:ring-border-subtle transition-all overflow-hidden focus:outline-none focus:ring-2 focus:ring-accent-primary/50",
userButtonAvatarBox: "h-full w-full rounded-full",
userButtonAvatarImage: "h-full w-full object-cover",
},
}}
/>
Expand Down Expand Up @@ -236,8 +240,8 @@ function ProjectSidebar({
<aside
aria-hidden={!isOpen}
className={cn(
"pointer-events-none fixed left-0 top-0 z-40 flex h-full w-80 flex-col border-r border-border-default bg-bg-surface/95 shadow-2xl backdrop-blur-md transition-transform duration-300 ease-in-out",
isOpen ? "translate-x-0 pointer-events-auto" : "-translate-x-full",
"pointer-events-none fixed left-0 top-14 z-40 flex h-[calc(100vh-3.5rem)] w-80 flex-col border-r border-border-default bg-bg-surface/95 shadow-2xl backdrop-blur-md transition-transform duration-300 ease-in-out",
isOpen ? "translate-x-0 pointer-events-auto" : "-translate-x-[101%]",
)}
>
<div className="flex h-14 shrink-0 items-center justify-between border-b border-border-default px-4">
Expand Down Expand Up @@ -298,7 +302,7 @@ function ProjectSidebar({
className="w-full"
size="default"
// Create project not wired yet
onClick={() => {}}
onClick={() => { }}
>
<Share2 className="h-4 w-4" />
New Project
Expand Down Expand Up @@ -373,7 +377,10 @@ interface AiSidebarProps {
}

/**
* Right sidebar placeholder for future AI chat.
* Right sidebar for the AI Copilot. The toggle is wired (the AI button
* in the navbar controls visibility), but the actual chat surface and
* generation are intentionally out of scope here — this panel currently
* shows the placeholder status and the future hooks that will attach.
*/
function AiSidebar({ isOpen, onClose }: AiSidebarProps) {
return (
Expand All @@ -395,23 +402,65 @@ function AiSidebar({ isOpen, onClose }: AiSidebarProps) {
<aside
aria-hidden={!isOpen}
className={cn(
"pointer-events-none fixed right-0 top-0 z-40 flex h-full w-80 flex-col border-l border-border-default bg-bg-surface/95 shadow-2xl backdrop-blur-md transition-transform duration-300 ease-in-out",
"pointer-events-none fixed right-0 top-14 z-40 flex h-[calc(100vh-3.5rem)] w-80 flex-col border-l border-border-default bg-bg-surface/95 shadow-2xl backdrop-blur-md transition-transform duration-300 ease-in-out",
isOpen ? "translate-x-0 pointer-events-auto" : "translate-x-full",
)}
>
{/* Header */}
<div className="flex h-14 shrink-0 items-center justify-between border-b border-border-default px-4">
<h2 className="text-sm font-semibold text-text-primary">AI Chat</h2>
<button
type="button"
onClick={onClose}
aria-label="Close AI chat"
className="inline-flex h-8 w-8 items-center justify-center rounded-xl text-text-muted transition-colors hover:bg-bg-elevated hover:text-text-primary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border-subtle"
>
<X className="h-4 w-4" />
</button>
<div className="flex items-center gap-2">
<h2 className="text-sm font-semibold text-text-primary">
AI Copilot
</h2>
</div>
<div className="flex items-center gap-2">
<Sparkles className="h-4 w-4 text-accent-ai-text" />
<button
type="button"
onClick={onClose}
aria-label="Close AI chat"
className="inline-flex h-8 w-8 items-center justify-center rounded-xl text-text-muted transition-colors hover:bg-bg-elevated hover:text-text-primary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border-subtle"
>
<X className="h-4 w-4" />
</button>
</div>
</div>
<div className="flex flex-1 items-center justify-center">
<p className="text-sm text-text-muted">AI chat coming soon</p>

{/* Subtitle */}
<div className="border-b border-border-default px-4 pb-3 pt-2">
<p className="text-xs text-text-muted">Placeholder panel</p>
</div>

{/* Body */}
<div className="flex flex-1 flex-col gap-4 overflow-y-auto p-4">
{/* Status card */}
<div className="rounded-2xl border border-border-default bg-bg-elevated p-4">
<div className="flex items-start gap-3">
<div className="flex h-8 w-8 shrink-0 items-center justify-center rounded-xl bg-bg-subtle">
<Bot className="h-4 w-4 text-accent-ai-text" />
</div>
<div className="flex flex-col gap-1">
<h3 className="text-sm font-semibold text-text-primary">
Chat surface pending
</h3>
<p className="text-xs leading-relaxed text-text-muted">
The toggle is wired. Messaging and generation are
intentionally out of scope here.
</p>
</div>
</div>
</div>

{/* Future hooks card */}
<div className="rounded-2xl border border-dashed border-border-default bg-bg-elevated/50 p-4">
<h3 className="text-[11px] font-semibold uppercase tracking-wider text-text-faint">
Future Hooks
</h3>
<p className="mt-2 text-xs leading-relaxed text-text-muted">
Prompt composer, run status, and architecture guidance will
attach to this sidebar.
</p>
</div>
</div>
</aside>
</>
Expand Down
66 changes: 19 additions & 47 deletions context/current-issues-liveblocks-canvas.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,30 @@
Review the editor canvas implementation and fix the visual issues. The canvas currently looks like it's floating above the background inside a border box, instead of feeling like a real design canvas. Check `/context/screenshots/image.png` for the current broken state.
Read the current canvas component code in `components/` and Rewier The UI eliments

Read the current canvas component code in `components/editor`
image location `img/image.png`

Issues to look for and document:
image description :
```
Top Navigation Bar
Left side: Displays the name of the Workspace.

DRAG AND DROP ISSUES:
move to Right side: Includes a "Share" button, a highlighted "AI" button, fix user profile avatar fill the circle correctly.

- Canvas nodes from the node panel cannot be dragged and dropped onto the canvas. Investigate and fix the full drag-and-drop pipeline:
- Confirm that draggable nodes in the node panel have the correct draggable attribute and onDragStart handler that sets the node type in dataTransfer
- Confirm that the canvas has onDragOver (with preventDefault to allow dropping) and onDrop handlers wired up correctly
- Ensure the drop handler reads the node type from dataTransfer, calculates the correct canvas coordinates accounting for pan offset and zoom scale, and creates a new node at the dropped position
- Check that no parent element is intercepting or blocking the drag events before they reach the canvas
Left Panel (Projects)
Tabs: Features two main views at the top: "My Projects" (currently selected) and "Shared".

CANVAS VISUAL ISSUES:
Project List: Shows one active project listed under the current selection: "Liveblocks Live Room" with a cyan indicator dot.

- Box shadow or elevation styles making the canvas appear to float
- Border or border-radius giving it a "card" appearance instead of a canvas feel
- Background color mismatch between canvas and its container
- Missing or incorrect dotted background pattern on the canvas
- z-index or positioning (absolute/relative) causing the floating effect
- Padding/margin around the canvas creating separation from the background
- Any wrapper div styles (like rounded corners, shadows, or elevated backgrounds) treating the canvas as a UI card
Bottom Action: A bright cyan button labeled "+ New Project" sits at the bottom of the panel next to a profile placeholder icon labeled "N".

SIDEBAR ISSUES:
Center Canvas & Bottom Toolbar
The large central area is a black workspace featuring a subtle dot grid pattern.

- The left and right sidebars should float OVER the canvas, not push or shrink it
- Sidebars must use position: fixed or position: absolute with a higher z-index so the canvas extends fully behind them
- The canvas background (dotted pattern) should be visible edge-to-edge underneath both sidebars
- Sidebars should have a semi-transparent or solid background with a subtle shadow so they feel elevated above the canvas, not embedded in the layout
- The left sidebar is not fully hiding when toggled off
At the bottom center, there is a floating horizontal toolbar containing various shape icons (such as a rectangle, diamond, circle, line tool, cylinder, and hexagon) along with a cursor hand icon.

— it is partially visible or peeking out instead of sliding completely off-screen. When closed, the sidebar should translate fully outside the viewport with no visible remnant. Check for incorrect transform: translateX values, insufficient negative offset, overflow issues on the parent container, or missing overflow: hidden that is causing the sidebar to remain partially visible during or after the close transition.
Right Panel (AI Copilot)
Header: Labeled "AI Copilot" with a "Placeholder panel" subtitle and a small sparkles icon.

TOPBAR ISSUES:

### Left Section:

- A wireframe-style icon (resembling a document or sidebar layout) on the far left.
- The main title text: "Ghost Room".
- A smaller, muted subtitle below it reading "Workspace".

### Right Section:

- A "Share" button containing a node-network icon.
- An "AI" button featuring a star/sparkle icon.
- A circular user profile avatar image on the far right.


## After documenting all issues fix all of the above so that:

1. The canvas has a dotted background pattern filling the full viewport naturally
2. The canvas feels flush with the surrounding background — no floating, no card effect
3. Box-shadow, excessive borders, and elevated styling are removed from the canvas
4. The canvas looks and feels like an infinite design canvas (similar to Figma or Excalidraw)
5. Both sidebars float over the canvas and are fully hidden when toggled off
6. Nodes can be dragged from the node panel and dropped onto the canvas correctly
Status Card: A box in the upper section states "Chat surface pending" with a description explaining: "The toggle is wired. Messaging and generation are intentionally out of scope here."

Future Hooks Section: A lower box titled "FUTURE HOOKS" notes: "Prompt composer, run status, and architecture guidance will attach to this sidebar."
```
2 changes: 1 addition & 1 deletion context/progress-tracker.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Update this file whenever the current phase, active feature, or implementation s

## Current Phase

- Feature 11TBD
- Feature 12(compleated)

## Current Goal

Expand Down