From 79668e436b23b89e09e21919b9f1b9a9d1cdb17f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Wed, 4 Mar 2026 19:42:30 +0000 Subject: [PATCH] remove stale homeRoot state from file viewer and dashboard creation Co-Authored-By: Claude Opus 4.6 --- .../src/apps/Dashboards/DashboardPreview.tsx | 5 ++--- .../src/hooks/useFileViewerPanels/Providers.tsx | 10 ++-------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/workspaces/officerdev/src/apps/Dashboards/DashboardPreview.tsx b/src/workspaces/officerdev/src/apps/Dashboards/DashboardPreview.tsx index dbb63940..92ae0bed 100644 --- a/src/workspaces/officerdev/src/apps/Dashboards/DashboardPreview.tsx +++ b/src/workspaces/officerdev/src/apps/Dashboards/DashboardPreview.tsx @@ -7,7 +7,7 @@ import { useClient } from 'hooks/useClient'; import { useUserState } from 'state/useUserState'; import { useDashboardState } from 'state/useDashboardState'; import { WorkspaceLayout, WorkspaceView, createDefaultLayout } from '../../components/Workspace'; -import type { LayoutNode, DashboardDefinition, HomeRoot } from '../../components/Workspace'; +import type { LayoutNode, DashboardDefinition } from '../../components/Workspace'; import { Button } from '@/components/ui/button'; import { generateSlug, slugify } from 'helpers/slug'; import { FileBrowserApp } from '../FileBrowser'; @@ -276,7 +276,6 @@ const CreatePanel = () => { const client = useClient(); const [name, setName] = useGlobal(NEW_DASH_NAME_KEY, ''); const [filePath] = useUserState('files/currentPath', '/'); - const [homeRoot] = useUserState('files/homeRoot', 'home'); const { value: dashboards, setValue: setDashboards } = useDashboardState('workspaces', []); const cwd = filePath === '/' ? '~' : `~/${filePath.replace(/^\//, '')}`; @@ -338,7 +337,7 @@ const CreatePanel = () => { id, name: trimmed, cwd, - root: homeRoot !== 'home' ? homeRoot : undefined, + root: undefined, description: desc || undefined, templateIdx, }; diff --git a/src/workspaces/officerdev/src/hooks/useFileViewerPanels/Providers.tsx b/src/workspaces/officerdev/src/hooks/useFileViewerPanels/Providers.tsx index 33982638..fb44299a 100644 --- a/src/workspaces/officerdev/src/hooks/useFileViewerPanels/Providers.tsx +++ b/src/workspaces/officerdev/src/hooks/useFileViewerPanels/Providers.tsx @@ -1,13 +1,11 @@ import { type ReactNode, useCallback } from 'react'; import { useSearchParams } from 'react-router'; -import { useUserState } from 'state/useUserState'; import { usePanelChannel } from 'hooks/usePanelChannel'; import { FileViewerProvider } from '../../apps/FileViewer'; import { EmbeddableChat } from '../../apps/Chat/EmbeddableChat'; export function ViewerProvider({ children }: { children: ReactNode }) { const [searchParams, setSearchParams] = useSearchParams(); - const [homeRoot] = useUserState('files/homeRoot', 'home'); const viewPath = searchParams.get('view') ?? ''; const fileName = viewPath.split('/').pop() ?? ''; @@ -21,7 +19,7 @@ export function ViewerProvider({ children }: { children: ReactNode }) { }; return ( - + {children} ); @@ -66,12 +64,9 @@ export function Ephemeral2Provider({ children }: { children: ReactNode }) { export const ChatEphemeralBody = () => { const [searchParams] = useSearchParams(); - const [homeRoot] = useUserState('files/homeRoot', 'home'); const [, setRefreshSignal] = usePanelChannel('files:refresh-signal', 0); const chatContext = searchParams.get('chatContext') ?? ''; const chatType = searchParams.get('chatType') as 'file' | 'folder' | null; - const hostRoot = homeRoot === '~' || homeRoot === 'officer.dev'; - const sandboxed = !hostRoot; const cwdPath = chatType === 'file' ? chatContext.substring(0, chatContext.lastIndexOf('/')) || '/' @@ -90,8 +85,7 @@ export const ChatEphemeralBody = () => { return (