From 68b1e63c464bfb7dba4bc4dc12d9ef27770c97bb Mon Sep 17 00:00:00 2001 From: cynarAI <155274210+cynarAI@users.noreply.github.com> Date: Sun, 4 Oct 2026 16:43:50 +0200 Subject: [PATCH] fix(web): render the create-bot modal outside the side panel; tidy Shell leftovers (#131) The centered Create new Bot modal was rendered inside the side panel's condition, so the empty states that open it (nothing selected, or a project without bots) only showed it while a panel happened to be open. It is a portal to the document body, so it now renders after the panel. - The project drag grip's accessible name goes through Lingui (German "Ziehen zum Umsortieren") instead of a hard-coded English label. - Drop the project drag state that was set but never read, and imports Shell.tsx no longer uses. Claude-Session: https://claude.ai/code/session_01MRtGG9ARfqqhma3t85Ro2u Co-authored-by: Claude --- apps/web/src/components/SortableGroup.tsx | 4 +- apps/web/src/locales/de/messages.po | 4 + apps/web/src/locales/en/messages.po | 4 + apps/web/src/locales/es/messages.po | 4 + apps/web/src/locales/hi/messages.po | 4 + apps/web/src/locales/ko/messages.po | 4 + apps/web/src/locales/pt-BR/messages.po | 4 + apps/web/src/locales/ru/messages.po | 4 + apps/web/src/locales/tr/messages.po | 4 + apps/web/src/locales/zh-CN/messages.po | 4 + apps/web/src/pages/Shell.tsx | 92 ++++++++----------- apps/web/src/pages/shell/use-sidebar-model.ts | 6 -- 12 files changed, 79 insertions(+), 59 deletions(-) diff --git a/apps/web/src/components/SortableGroup.tsx b/apps/web/src/components/SortableGroup.tsx index c0dd3d7..97ece43 100644 --- a/apps/web/src/components/SortableGroup.tsx +++ b/apps/web/src/components/SortableGroup.tsx @@ -4,6 +4,7 @@ */ import { useSortable } from "@dnd-kit/sortable"; import { CSS } from "@dnd-kit/utilities"; +import { useLingui } from "@lingui/react/macro"; import { createContext, memo, useContext, useMemo } from "react"; interface SortableGroupProps { @@ -30,13 +31,14 @@ export const ProjectDragGrip = memo(function ProjectDragGrip({ className?: string; children: React.ReactNode; }) { + const { t } = useLingui(); const handle = useSortableGroupHandle(); return ( - - setShowCreateBotModal(false)} - onCreate={async (input) => { - await createBot(input); - }} - onImport={async (manifest) => { - await importBot(manifest); - setShowCreateBotModal(false); - }} - /> - - , - document.body, - )} {panel === "settings" && active ? ( ) : null} + {/* Centered Create Bot Modal */} + {showCreateBotModal && + createPortal( +
+ +
+ setShowCreateBotModal(false)} + onCreate={async (input) => { + await createBot(input); + }} + onImport={async (manifest) => { + await importBot(manifest); + setShowCreateBotModal(false); + }} + /> + + , + document.body, + )} {contextChat && botMenu ? ( diff --git a/apps/web/src/pages/shell/use-sidebar-model.ts b/apps/web/src/pages/shell/use-sidebar-model.ts index d1f864c..847506f 100644 --- a/apps/web/src/pages/shell/use-sidebar-model.ts +++ b/apps/web/src/pages/shell/use-sidebar-model.ts @@ -32,7 +32,6 @@ export function useSidebarModel({ setProjectOrder(orderedIds); writeProjectSidebarOrder(orderedIds); }, []); - const [draggedProjectId, setDraggedProjectId] = useState(null); const sensors = useSensors( useSensor(MouseSensor, { activationConstraint: { distance: 8 } }), useSensor(TouchSensor, { activationConstraint: { distance: 8 } }), @@ -242,9 +241,6 @@ export function useSidebarModel({ }, [projectSidebarGroups, handleReorderProjects], ); - const handleProjectDragStart = useCallback((event: { active: { id: string | number } }) => { - setDraggedProjectId(String(event.active.id)); - }, []); return { homeSpaceBots, @@ -252,8 +248,6 @@ export function useSidebarModel({ mainConversationEntry, projectSidebarGroups, sensors, - setDraggedProjectId, handleProjectDragEnd, - handleProjectDragStart, }; }