From 75d4f1688fcee5b87b05fb7e6f5de01c38a09615 Mon Sep 17 00:00:00 2001 From: AnuragJangid18 Date: Fri, 23 Oct 2026 22:00:33 +0530 Subject: [PATCH] feat: update workspace sidebar create menu with native Silos names and improved document creation flow --- README.md | 6 +- .../components/workspace/WorkspaceSidebar.tsx | 89 +++++++------------ 2 files changed, 36 insertions(+), 59 deletions(-) diff --git a/README.md b/README.md index b2e0c2e..8f80e32 100644 --- a/README.md +++ b/README.md @@ -378,6 +378,6 @@ Next tenant work: unpublish, double-click title selection, and Enter-to-commit title changes. Stead plan controls also remain read-only until Edit mode is enabled. - Every workspace sidebar file row now has a plus create action. Its floating - Confluence-style menu supports Live Doc, Page, Whiteboard, Database, Smart - Link, and Folder actions, creating the corresponding Silos document or - container in the current workspace context. + menu uses the native Silos names: Silo, Stead, Sketch, and Shed. Silo, + Sketch, and Shed creations inherit the selected file's workspace and become + tree children of that file; Stead follows the existing space setup flow. diff --git a/frontend/src/components/workspace/WorkspaceSidebar.tsx b/frontend/src/components/workspace/WorkspaceSidebar.tsx index 4ef5c98..ef9f8cd 100644 --- a/frontend/src/components/workspace/WorkspaceSidebar.tsx +++ b/frontend/src/components/workspace/WorkspaceSidebar.tsx @@ -13,9 +13,6 @@ import { Clock, Star, FolderOpen, - Folder, - Database, - ExternalLink, Link2, MoreHorizontal, PenTool, @@ -38,7 +35,6 @@ import { getStoredUser } from '../../lib/api' import type { CreateType } from '../../data/createData' import { navItems, type NavItemId } from '../../data/dashboardData' import CreateDropdown from '../create/CreateDropdown' -import { defaultSteadContent } from '../../data/steadData' const typeIcons: Record = { silo: FileText, @@ -153,53 +149,38 @@ export default function WorkspaceSidebar({ } async function createFromMenu( - source: DocumentRecord, - kind: 'live-doc' | 'page' | 'whiteboard' | 'database' | 'smart-link' | 'folder', + source: DocumentRecord, + kind: CreateType, ) { - setCreateMenuId(null) - setCreateMenuPosition(null) - const steadId = source.type === 'stead' ? source.id : source.steadId - const parentPageId = source.type === 'silo' ? source.id : undefined - if (kind === 'folder' || kind === 'database') { + setCreateMenuId(null) + setCreateMenuPosition(null) + if (kind === 'stead') { + navigate('/workspace/stead/new') + return + } + + const steadId = source.type === 'stead' ? source.id : source.steadId + const parentPageId = source.type === 'stead' ? undefined : source.id + const content = + kind === 'shed' + ? getDefaultShedContent('meeting-notes') + : kind === 'sketch' + ? { elements: [] } + : { body: '', bodyHtml: '', status: 'draft' } const created = await createDocument( - 'stead', - kind === 'folder' ? 'Untitled Folder' : 'Untitled Database', - { ...defaultSteadContent(), setupComplete: true }, - undefined, - getStoredUser()?.full_name ?? 'You', - ) - navigate(`/workspace/stead/${created.id}`) - return - } - if (kind === 'live-doc') { - const created = await createDocument( - 'shed', - 'Untitled Live Doc', - getDefaultShedContent('meeting-notes'), - 'meeting-notes', + kind, + kind === 'shed' + ? 'Untitled Live Doc' + : kind === 'sketch' + ? 'Untitled Whiteboard' + : 'Untitled Page', + content, + kind === 'shed' ? 'meeting-notes' : undefined, getStoredUser()?.full_name ?? 'You', steadId, + parentPageId, ) - navigate(`/workspace/shed/${created.id}`) - return - } - const type = kind === 'whiteboard' ? 'sketch' : 'silo' - const content = - kind === 'whiteboard' - ? { elements: [] } - : kind === 'smart-link' - ? { body: 'Paste a link here', bodyHtml: '

Paste a link here

', status: 'draft' } - : { body: '', bodyHtml: '', status: 'draft' } - const created = await createDocument( - type, - kind === 'whiteboard' ? 'Untitled Whiteboard' : kind === 'smart-link' ? 'Untitled Smart Link' : 'Untitled Page', - content, - undefined, - getStoredUser()?.full_name ?? 'You', - steadId, - parentPageId, - ) - navigate(`/workspace/${type}/${created.id}`) + navigate(`/workspace/${kind}/${created.id}`) } function startRename(doc: DocumentRecord) { @@ -397,21 +378,17 @@ export default function WorkspaceSidebar({ aria-label={`Create content under ${doc.title}`} > {[ - { kind: 'live-doc' as const, label: 'Live Doc', icon: Zap }, - { kind: 'page' as const, label: 'Page', icon: FileText }, - { kind: 'whiteboard' as const, label: 'Whiteboard', icon: PenTool }, - { kind: 'database' as const, label: 'Database', icon: Database }, - { kind: 'smart-link' as const, label: 'Smart Link', icon: ExternalLink }, - { kind: 'folder' as const, label: 'Folder', icon: Folder }, - ].map(({ kind, label, icon: MenuIcon }, index) => ( + { kind: 'silo' as const, label: 'Silo', icon: FileText }, + { kind: 'stead' as const, label: 'Stead', icon: LayoutGrid }, + { kind: 'sketch' as const, label: 'Sketch', icon: PenTool }, + { kind: 'shed' as const, label: 'Shed', icon: Zap }, + ].map(({ kind, label, icon: MenuIcon }) => (