}
diff --git a/designer/src/platform/PlatformApp.tsx b/designer/src/platform/PlatformApp.tsx
index e06a704..7bbd00c 100644
--- a/designer/src/platform/PlatformApp.tsx
+++ b/designer/src/platform/PlatformApp.tsx
@@ -44,6 +44,7 @@ import { usePcbOnboarding } from '../onboarding/usePcbOnboarding.js';
const CodexPcbDock = lazy(() =>
import('../codex-pcb/CodexPcbDock.js').then((m) => ({ default: m.CodexPcbDock })),
);
+const ProjectLibrary = lazy(() => import('../project-library/ProjectLibrary.js'));
const EditorHost = lazy(() => import('./EditorHost.js'));
const BASE = import.meta.env.BASE_URL;
const BUILD = typeof __BUILD_STAMP__ === 'undefined' ? 'dev' : __BUILD_STAMP__;
@@ -133,6 +134,7 @@ function Workspace({
}
});
const [route, setRoute] = useState(initial.route);
+ const projectLibrary = !route.code && new URLSearchParams(location.search).get('library') === '1';
const [invalidRoute, setInvalidRoute] = useState(initial.error);
const routeRef = useRef(route);
const historyIndex = useRef(Number(history.state?.vmPcbIndex) || 0);
@@ -311,9 +313,10 @@ function Workspace({
};
}, [leave]);
useEffect(() => {
- if (!route.code)
+ if (projectLibrary) document.title = locale === 'zh' ? '开源项目库 | VibeMake' : 'Open-source library | VibeMake';
+ else if (!route.code)
document.title = locale === 'zh' ? '我的 PCB 项目 | VibeMake' : 'My PCB projects | VibeMake';
- }, [route.code, locale]);
+ }, [route.code, locale, projectLibrary]);
useEffect(() => {
runtime?.setLocked(!allowed || auth.status !== 'authenticated' || !api);
}, [runtime, allowed, auth.status, api]);
@@ -690,6 +693,10 @@ function Workspace({
{tr('登录并开始设计', 'Sign in to start designing')}
+ ) : projectLibrary && auth.record ? (
+ {tr('正在打开项目库…', 'Loading library…')}}>
+
+
) : error ? (
{tr('工程加载失败', 'Could not load project')}
@@ -731,7 +738,8 @@ function Workspace({
importProject={create}
/>
)}
- {(activeWorkbench || new URLSearchParams(location.search).get('ai') === '1') &&
+ {!projectLibrary &&
+ (activeWorkbench || new URLSearchParams(location.search).get('ai') === '1') &&
allowed &&
api &&
auth.status === 'authenticated' && (
diff --git a/designer/src/platform/ProjectList.tsx b/designer/src/platform/ProjectList.tsx
index 87a0dc8..99003de 100644
--- a/designer/src/platform/ProjectList.tsx
+++ b/designer/src/platform/ProjectList.tsx
@@ -118,6 +118,9 @@ export function ProjectList({
{tr('我的 PCB 项目', 'My PCB projects')}
+
+ {tr('开源项目库', 'Open-source library')}
+