Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
fix(desktop): resolve cross-platform boundary violations and deduplicate shared code
Naiyuan Qing042985d9611a
diff --git a/CLAUDE.md b/CLAUDE.mdindex 9b533dfb31..bb8b8c9b4e 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -35,7 +35,7 @@ packages/**Dependency direction:** `views/ → core/ + ui/`. Core and UI are independent of each other. No package imports from `next/*` or `apps/web/`.-**Platform bridge:** `apps/web/platform/` is the only place that touches `process.env`, `next/navigation`, and creates store/api singletons. Each future app (desktop, mobile) provides its own platform layer.+**Platform bridge:** `packages/core/platform/` provides `CoreProvider` — a single component that initializes API client, auth store, workspace store, WS connection, and QueryClient. Apps wrap their root with `<CoreProvider apiBaseUrl wsUrl>` and only need to provide a `NavigationAdapter` for routing. `apps/web/platform/` adds web-specific concerns (cookies, Next.js navigation). Desktop uses `CoreProvider` directly with `react-router-dom` navigation.### packages/core/ (`@multica/core`)@@ -54,6 +54,7 @@ Headless business logic. **Zero react-dom, zero localStorage, zero process.env.*| `core/hooks.tsx` | Workspace ID context | `useWorkspaceId`, `WorkspaceIdProvider` || `core/modals/` | Modal state store | `useModalStore` || `core/navigation/` | Navigation state store | `useNavigationStore` |+| `core/platform/` | CoreProvider + auth init + default storage | `CoreProvider`, `AuthInitializer`, `defaultStorage` |**Store factory pattern:** Auth and workspace stores are created via factory functions that receive platform-specific dependencies:```typescript@@ -98,16 +99,12 @@ apps/web/│ ├── auth/ # Web-only: auth-cookie.ts, initializer.tsx│ ├── landing/ # Web-only: landing pages (uses next/image, next/link)│ └── search/ # Web-only: search dialog-└── components/ # App-level: theme-provider, multica-icon, locale-sync, loading-indicator+└── components/ # App-level: theme-provider (re-export + React 19 fix), locale-sync, loading-indicator```-**`platform/`** — The only code that touches Next.js APIs and browser globals:-- `api.ts` — Creates `ApiClient` singleton with `onUnauthorized` redirect-- `auth.ts` — `createAuthStore({ api, storage: webStorage, onLogin: setLoggedInCookie })`-- `workspace.ts` — `createWorkspaceStore(api, { storage: webStorage, onError: toast.error })`-- `ws-provider.tsx` — Wraps `WSProvider` with web-specific WS URL and store instances+**`platform/`** — Web-specific code that extends `CoreProvider` from `@multica/core/platform`:- `navigation.tsx` — `WebNavigationProvider` wrapping Next.js `useRouter`/`usePathname`-- `storage.ts` — SSR-safe `webStorage` adapter (guards `localStorage` with `typeof window` checks)+- Core initialization (API, auth, workspace, WS) is handled by `CoreProvider` in `packages/core/platform/`### State Managementdiff --git a/apps/desktop/electron.vite.config.ts b/apps/desktop/electron.vite.config.tsindex f9bf641b6e..22d2fed886 100644--- a/apps/desktop/electron.vite.config.ts+++ b/apps/desktop/electron.vite.config.ts@@ -16,6 +16,7 @@ export default defineConfig({alias: {"@": resolve("src/renderer/src"),},+ dedupe: ["react", "react-dom"],},},});diff --git a/apps/desktop/package.json b/apps/desktop/package.jsonindex 0b685b42ad..7e3d28ebd5 100644--- a/apps/desktop/package.json+++ b/apps/desktop/package.json@@ -20,23 +20,24 @@"@multica/ui": "workspace:*","@multica/views": "workspace:*","react-router-dom": "^7.6.0",- "next-themes": "^0.4.6",- "sonner": "^2.0.7"+ "shadcn": "^4.1.0",+ "sonner": "^2.0.7",+ "tw-animate-css": "^1.4.0"},"devDependencies": {"@multica/tsconfig": "workspace:*","@electron-toolkit/tsconfig": "^2.0.0","@tailwindcss/vite": "^4",- "@types/node": "^22.19.1",- "@types/react": "^19.2.0",- "@types/react-dom": "^19.2.0",+ "@types/node": "catalog:",+ "@types/react": "catalog:",+ "@types/react-dom": "catalog:","@vitejs/plugin-react": "^5.1.1","electron": "^39.2.6","electron-builder": "^26.0.12","electron-vite": "^5.0.0",- "react": "19.2.3",- "react-dom": "19.2.3",+ "react": "catalog:",+ "react-dom": "catalog:","tailwindcss": "^4",- "typescript": "^5.9.3"+ "typescript": "catalog:"}}diff --git a/apps/desktop/src/main/index.ts b/apps/desktop/src/main/index.tsindex f44e6ec5c7..d9d792679b 100644--- a/apps/desktop/src/main/index.ts+++ b/apps/desktop/src/main/index.ts@@ -11,7 +11,7 @@ function createWindow(): void {minWidth: 900,minHeight: 600,titleBarStyle: "hiddenInset",- trafficLightPosition: { x: 16, y: 14 },+ trafficLightPosition: { x: 16, y: 13 },show: false,autoHideMenuBar: true,webPreferences: {diff --git a/apps/desktop/src/renderer/src/App.tsx b/apps/desktop/src/renderer/src/App.tsxindex 8360ddff40..9324abad65 100644--- a/apps/desktop/src/renderer/src/App.tsx+++ b/apps/desktop/src/renderer/src/App.tsx@@ -1,6 +1,6 @@import { RouterProvider } from "react-router-dom";import { CoreProvider } from "@multica/core/platform";-import { ThemeProvider } from "./components/theme-provider";+import { ThemeProvider } from "@multica/ui/components/common/theme-provider";import { Toaster } from "sonner";import { router } from "./router";@@ -8,8 +8,8 @@ export default function App() {return (<ThemeProvider><CoreProvider- apiBaseUrl={import.meta.env.VITE_API_URL}- wsUrl={import.meta.env.VITE_WS_URL}+ apiBaseUrl={import.meta.env.VITE_API_URL || "http://localhost:8080"}+ wsUrl={import.meta.env.VITE_WS_URL || "ws://localhost:8080/ws"}><RouterProvider router={router} /></CoreProvider>diff --git a/apps/desktop/src/renderer/src/components/dashboard-shell.tsx b/apps/desktop/src/renderer/src/components/dashboard-shell.tsxdeleted file mode 100644index 78460a5e8b..0000000000--- a/apps/desktop/src/renderer/src/components/dashboard-shell.tsx+++ /dev/null@@ -1,19 +0,0 @@-import { Outlet } from "react-router-dom";-import { DesktopNavigationProvider } from "@/platform/navigation";-import { DashboardLayout } from "@multica/views/layout";-import { TitleBar } from "./title-bar";-import { MulticaIcon } from "./multica-icon";--export function DashboardShell() {- return (- <DesktopNavigationProvider>- <DashboardLayout- header={<TitleBar />}- loginPath="/login"- loadingIndicator={<MulticaIcon className="size-6" />}- >- <Outlet />- </DashboardLayout>- </DesktopNavigationProvider>- );-}diff --git a/apps/desktop/src/renderer/src/components/desktop-layout.tsx b/apps/desktop/src/renderer/src/components/desktop-layout.tsxnew file mode 100644index 0000000000..4e1260eb29--- /dev/null+++ b/apps/desktop/src/renderer/src/components/desktop-layout.tsx@@ -0,0 +1,117 @@+import { useEffect } from "react";+import { Outlet, useNavigate } from "react-router-dom";+import { ChevronLeft, ChevronRight } from "lucide-react";+import { useNavigationHistory } from "@/hooks/use-history-stack";+import { useTabSync } from "@/hooks/use-tab-sync";+import { useTabStore, resolveRouteIcon } from "@/stores/tab-store";+import { SidebarProvider } from "@multica/ui/components/ui/sidebar";+import { WorkspaceIdProvider } from "@multica/core/hooks";+import { ModalRegistry } from "@multica/views/modals/registry";+import { AppSidebar, useDashboardGuard } from "@multica/views/layout";+import { DesktopNavigationProvider } from "@/platform/navigation";+import { MulticaIcon } from "@multica/ui/components/common/multica-icon";+import { TabBar } from "./tab-bar";++function SidebarTopBar() {+ const { canGoBack, canGoForward, goBack, goForward } = useNavigationHistory();++ return (+ <div+ className="h-12 shrink-0 flex items-center justify-end px-2"+ style={{ WebkitAppRegion: "drag" } as React.CSSProperties}+ >+ <div+ className="flex items-center gap-0.5"+ style={{ WebkitAppRegion: "no-drag" } as React.CSSProperties}+ >+ <button+ onClick={goBack}+ disabled={!canGoBack}+ className="flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-30 disabled:pointer-events-none"+ >+ <ChevronLeft className="size-4" />+ </button>+ <button+ onClick={goForward}+ disabled={!canGoForward}+ className="flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-30 disabled:pointer-events-none"+ >+ <ChevronRight className="size-4" />+ </button>+ </div>+ </div>+ );+}++export function DesktopLayout() {+ return (+ <DesktopNavigationProvider>+ <DesktopLayoutInner />+ </DesktopNavigationProvider>+ );+}++function useInternalLinkHandler() {+ const navigate = useNavigate();++ useEffect(() => {+ const handler = (e: Event) => {+ const path = (e as CustomEvent).detail?.path;+ if (!path) return;+ const icon = resolveRouteIcon(path);+ const store = useTabStore.getState();+ const tabId = store.openTab(path, path, icon);+ store.setActiveTab(tabId);+ navigate(path);+ };+ window.addEventListener("multica:navigate", handler);+ return () => window.removeEventListener("multica:navigate", handler);+ }, [navigate]);+}++function DesktopLayoutInner() {+ useTabSync();+ useInternalLinkHandler();+ const { user, isLoading, workspace } = useDashboardGuard("/login");++ if (isLoading) {+ return (+ <div className="flex h-screen items-center justify-center">+ <MulticaIcon className="size-6" />+ </div>+ );+ }++ if (!user) return null;++ return (+ <div className="flex h-screen">+ <SidebarProvider className="flex-1">+ <AppSidebar topSlot={<SidebarTopBar />} />+ {/* Right side: header + content container */}+ <div className="flex flex-1 min-w-0 flex-col">+ {/* Tab bar + drag region */}+ <header+ className="h-12 shrink-0"+ style={{ WebkitAppRegion: "drag" } as React.CSSProperties}+ >+ <TabBar />+ </header>+ {/* Content area with inset styling */}+ <div className="flex flex-1 min-h-0 flex-col overflow-hidden mr-2 mb-2 ml-0.5 rounded-xl shadow-sm bg-background">+ {workspace ? (+ <WorkspaceIdProvider wsId={workspace.id}>+ <Outlet />+ <ModalRegistry />+ </WorkspaceIdProvider>+ ) : (+ <div className="flex h-full items-center justify-center">+ <MulticaIcon className="size-6 animate-pulse" />+ </div>+ )}+ </div>+ </div>+ </SidebarProvider>+ </div>+ );+}diff --git a/apps/desktop/src/renderer/src/components/multica-icon.tsx b/apps/desktop/src/renderer/src/components/multica-icon.tsxdeleted file mode 100644index 52b0fe82f7..0000000000--- a/apps/desktop/src/renderer/src/components/multica-icon.tsx+++ /dev/null@@ -1,105 +0,0 @@-import { useState, useEffect } from "react";-import { cn } from "@multica/ui/lib/utils";--interface MulticaIconProps extends React.ComponentProps<"span"> {- /**- * If true, play a one-time entrance spin animation.- */- animate?: boolean;- /**- * If true, disable hover spin animation.- */- noSpin?: boolean;- /**- * If true, show a border around the icon.- */- bordered?: boolean;- /**- * Size of the bordered icon: "sm" (default), "md", "lg"- */- size?: "sm" | "md" | "lg";-}--const borderedSizes = {- sm: { wrapper: "p-1.5", icon: "size-3.5" },- md: { wrapper: "p-2", icon: "size-4" },- lg: { wrapper: "p-2.5", icon: "size-5" },-};--/**- * Pure CSS 8-pointed asterisk icon matching the Multica logo.- * Uses currentColor so it adapts to light/dark themes automatically.- * Clip-path polygon traced from the original SVG path coordinates.- */-export function MulticaIcon({- className,- animate = false,- noSpin = false,- bordered = false,- size = "sm",- ...props-}: MulticaIconProps) {- const [entranceDone, setEntranceDone] = useState(!animate);-- useEffect(() => {- if (!animate) return;- const timer = setTimeout(() => setEntranceDone(true), 600);- return () => clearTimeout(timer);- }, [animate]);-- const clipPath = `polygon(- 45% 62.1%, 45% 100%, 55% 100%, 55% 62.1%,- 81.8% 88.9%, 88.9% 81.8%, 62.1% 55%, 100% 55%,- 100% 45%, 62.1% 45%, 88.9% 18.2%, 81.8% 11.1%,- 55% 37.9%, 55% 0%, 45% 0%, 45% 37.9%,- 18.2% 11.1%, 11.1% 18.2%, 37.9% 45%, 0% 45%,- 0% 55%, 37.9% 55%, 11.1% 81.8%, 18.2% 88.9%- )`;-- if (bordered) {- const sizeConfig = borderedSizes[size];- return (- <span- className={cn(- "inline-flex items-center justify-center border border-border rounded-md",- sizeConfig.wrapper,- className- )}- aria-hidden="true"- {...props}- >- <span- className={cn(- "block",- sizeConfig.icon,- !entranceDone && "animate-entrance-spin",- entranceDone && !noSpin && "hover:animate-spin"- )}- >- <span- className="block size-full bg-current"- style={{ clipPath }}- />- </span>- </span>- );- }-- return (- <span- className={cn(- "inline-block size-[1em]",- !entranceDone && "animate-entrance-spin",- entranceDone && !noSpin && "hover:animate-spin",- className- )}- aria-hidden="true"- {...props}- >- <span- className="block size-full bg-current"- style={{ clipPath }}- />- </span>- );-}diff --git a/apps/desktop/src/renderer/src/components/title-bar.tsx b/apps/desktop/src/renderer/src/components/title-bar.tsxdeleted file mode 100644index cd609df534..0000000000--- a/apps/desktop/src/renderer/src/components/title-bar.tsx+++ /dev/null@@ -1,17 +0,0 @@-export function TitleBar() {- return (- <div- className="h-11 shrink-0 flex items-center border-b bg-sidebar select-none"- style={{ WebkitAppRegion: "drag" } as React.CSSProperties}- >- {/* Left: traffic light inset area (macOS) */}- <div className="w-[78px] shrink-0" />-- {/* Center: reserved for future tabs */}- <div className="flex-1 flex items-center px-2" />-- {/* Right: reserved for future window actions */}- <div className="w-10 shrink-0" />- </div>- );-}diff --git a/apps/desktop/src/renderer/src/globals.css b/apps/desktop/src/renderer/src/globals.cssindex dd3e18eb37..31179bde68 100644--- a/apps/desktop/src/renderer/src/globals.css+++ b/apps/desktop/src/renderer/src/globals.css@@ -1,28 +1,17 @@@import "tailwindcss";@import "tw-animate-css";+@import "shadcn/tailwind.css";@import "@multica/ui/styles/tokens.css";+@import "@multica/ui/styles/base.css";@custom-variant dark (&:is(.dark *));@source "../../../../../packages/ui/**/*.tsx";-@source "../../../../../packages/core/**/*.tsx";-@source "../../../../../packages/views/**/*.tsx";+@source "../../../../../packages/core/**/*.{ts,tsx}";+@source "../../../../../packages/views/**/*.{ts,tsx}";@source "./**/*.tsx";-@layer base {- * {- @apply border-border outline-ring/50;- scrollbar-width: thin;- scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);- }- *::-webkit-scrollbar { width: 6px; height: 6px; }- *::-webkit-scrollbar-track { background: var(--scrollbar-track); }- *::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }- *::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }- body {- @apply bg-background text-foreground;- }- html {- @apply font-sans;- }+/* Desktop-specific: override sidebar container padding for traffic light layout */+[data-slot="sidebar-container"] {+ padding: 0 !important;}diff --git a/apps/desktop/src/renderer/src/pages/login.tsx b/apps/desktop/src/renderer/src/pages/login.tsxindex 536144ad47..057db87de6 100644--- a/apps/desktop/src/renderer/src/pages/login.tsx+++ b/apps/desktop/src/renderer/src/pages/login.tsx@@ -1,14 +1,17 @@import { useNavigate } from "react-router-dom";import { LoginPage } from "@multica/views/auth";-import { MulticaIcon } from "../components/multica-icon";-import { TitleBar } from "../components/title-bar";+import { MulticaIcon } from "@multica/ui/components/common/multica-icon";export function DesktopLoginPage() {const navigate = useNavigate();return (<div className="flex h-screen flex-col">- <TitleBar />+ {/* Traffic light inset */}+ <div+ className="h-[38px] shrink-0"+ style={{ WebkitAppRegion: "drag" } as React.CSSProperties}+ /><LoginPagelogo={<MulticaIcon bordered size="lg" />}onSuccess={() => navigate("/issues", { replace: true })}diff --git a/apps/desktop/src/renderer/src/platform/navigation.tsx b/apps/desktop/src/renderer/src/platform/navigation.tsxindex 404d225d5a..1f5ea32ee9 100644--- a/apps/desktop/src/renderer/src/platform/navigation.tsx+++ b/apps/desktop/src/renderer/src/platform/navigation.tsx@@ -3,6 +3,7 @@ import {NavigationProvider,type NavigationAdapter,} from "@multica/views/navigation";+import { useTabStore, resolveRouteIcon } from "@/stores/tab-store";export function DesktopNavigationProvider({children,@@ -18,6 +19,14 @@ export function DesktopNavigationProvider({back: () => navigate(-1),pathname: location.pathname,searchParams: new URLSearchParams(location.search),+ openInNewTab: (path, title?) => {+ const icon = resolveRouteIcon(path);+ const store = useTabStore.getState();+ const tabId = store.openTab(path, title ?? path, icon);+ store.setActiveTab(tabId);+ navigate(path);+ },+ getShareableUrl: (path) => `https://www.multica.ai${path}`,};return <NavigationProvider value={adapter}>{children}</NavigationProvider>;diff --git a/apps/desktop/tsconfig.web.json b/apps/desktop/tsconfig.web.jsonindex 844815cae3..d3413015c1 100644--- a/apps/desktop/tsconfig.web.json+++ b/apps/desktop/tsconfig.web.json@@ -8,6 +8,7 @@],"compilerOptions": {"composite": true,+ "noImplicitAny": true,"jsx": "react-jsx","baseUrl": ".","paths": {diff --git a/apps/web/app/(dashboard)/agents/[id]/page.tsx b/apps/web/app/(dashboard)/agents/[id]/page.tsxdeleted file mode 100644index 119722a0c6..0000000000--- a/apps/web/app/(dashboard)/agents/[id]/page.tsx+++ /dev/null@@ -1,12 +0,0 @@-export default function AgentDetailPage({- params,-}: {- params: Promise<{ id: string }>;-}) {- return (- <div className="p-6">- <h1 className="text-2xl font-bold">Agent Detail</h1>- <p className="mt-2 text-muted-foreground">Agent status and task history</p>- </div>- );-}diff --git a/apps/web/app/(dashboard)/board/page.tsx b/apps/web/app/(dashboard)/board/page.tsxdeleted file mode 100644index 36148402f0..0000000000--- a/apps/web/app/(dashboard)/board/page.tsx+++ /dev/null@@ -1,10 +0,0 @@-export default function BoardPage() {- return (- <div className="p-6">- <h1 className="text-2xl font-bold">Board</h1>- <p className="mt-2 text-muted-foreground">- Kanban board view coming soon.- </p>- </div>- );-}diff --git a/apps/web/app/(dashboard)/layout.tsx b/apps/web/app/(dashboard)/layout.tsxindex bc8f957fe6..6bb3c93cf1 100644--- a/apps/web/app/(dashboard)/layout.tsx+++ b/apps/web/app/(dashboard)/layout.tsx@@ -1,7 +1,7 @@"use client";import { DashboardLayout } from "@multica/views/layout";-import { MulticaIcon } from "@/components/multica-icon";+import { MulticaIcon } from "@multica/ui/components/common/multica-icon";import { SearchCommand } from "@/features/search";export default function Layout({ children }: { children: React.ReactNode }) {diff --git a/apps/web/app/custom.css b/apps/web/app/custom.cssindex d24ef7a0c3..cd429a7d4b 100644--- a/apps/web/app/custom.css+++ b/apps/web/app/custom.css@@ -1,41 +1,5 @@/* =============================================================================- * Multica Web — Custom styles (non-shadcn)+ * Multica Web — Custom styles (non-shadcn, web-only)+ * Shared styles (shiki, entrance-spin, sidebar, sonner, scrollbar) are in+ * @multica/ui/styles/base.css* ============================================================================= */--/* Shiki dual themes: CSS-only light/dark switching via CSS variables */-/* @see https://shiki.style/guide/dual-themes */-.shiki,-.shiki span {- color: var(--shiki-light);-}--.dark .shiki,-.dark .shiki span {- color: var(--shiki-dark) !important;-}--/* Multica icon: entrance spin animation */-@keyframes entrance-spin {- 0% { transform: rotate(0deg); opacity: 0; }- 50% { opacity: 1; }- 100% { transform: rotate(360deg); opacity: 1; }-}--.animate-entrance-spin {- animation: entrance-spin 0.6s ease-out forwards;-}--/* Sidebar: open triggers (dropdown/popover) get active background */-[data-sidebar="menu-button"][data-popup-open] {- background-color: var(--sidebar-accent);- color: var(--sidebar-accent-foreground);-}--/* Sonner toast: align icon to first line of text, not vertically centered */-[data-sonner-toast] {- align-items: flex-start !important;-}--[data-sonner-toast] [data-icon] {- margin-top: 2.5px;-}diff --git a/apps/web/app/globals.css b/apps/web/app/globals.cssindex be2a2c959d..be5951d722 100644--- a/apps/web/app/globals.css+++ b/apps/web/app/globals.css@@ -2,6 +2,7 @@@import "tw-animate-css";@import "shadcn/tailwind.css";@import "@multica/ui/styles/tokens.css";+@import "@multica/ui/styles/base.css";@import "./custom.css";@custom-variant dark (&:is(.dark *));@@ -9,21 +10,3 @@@source "../../../packages/ui/**/*.tsx";@source "../../../packages/core/**/*.{ts,tsx}";@source "../../../packages/views/**/*.{ts,tsx}";--@layer base {- * {- @apply border-border outline-ring/50;- scrollbar-width: thin;- scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);- }- *::-webkit-scrollbar { width: 6px; height: 6px; }- *::-webkit-scrollbar-track { background: var(--scrollbar-track); }- *::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }- *::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }- body {- @apply bg-background text-foreground;- }- html {- @apply font-sans;- }-}diff --git a/apps/web/components/theme-provider.tsx b/apps/web/components/theme-provider.tsxindex c2cedca1b2..02b67fdceb 100644--- a/apps/web/components/theme-provider.tsx+++ b/apps/web/components/theme-provider.tsx@@ -1,7 +1,7 @@"use client"-import { ThemeProvider as NextThemesProvider } from "next-themes"-import { TooltipProvider } from "@multica/ui/components/ui/tooltip"+// Re-export the shared ThemeProvider from @multica/ui+export { ThemeProvider } from "@multica/ui/components/common/theme-provider"// Suppress React 19 false-positive about next-themes' inline <script>.// The script works correctly; React 19 just warns about any <script> in components.@@ -14,24 +14,3 @@ if (typeof window !== "undefined" && process.env.NODE_ENV === "development") {orig.apply(console, args);};}--function ThemeProvider({- children,- ...props-}: React.ComponentProps<typeof NextThemesProvider>) {- return (- <NextThemesProvider- attribute="class"- defaultTheme="system"- enableSystem- disableTransitionOnChange- {...props}- >- <TooltipProvider delay={500}>- {children}- </TooltipProvider>- </NextThemesProvider>- )-}--export { ThemeProvider }diff --git a/apps/web/features/landing/components/landing-footer.tsx b/apps/web/features/landing/components/landing-footer.tsxindex af0113a5a8..db9aa4c5dd 100644--- a/apps/web/features/landing/components/landing-footer.tsx+++ b/apps/web/features/landing/components/landing-footer.tsx@@ -1,7 +1,7 @@"use client";import Link from "next/link";-import { MulticaIcon } from "@/components/multica-icon";+import { MulticaIcon } from "@multica/ui/components/common/multica-icon";import { cn } from "@multica/ui/lib/utils";import { useAuthStore } from "@multica/core/auth";import { useLocale, locales, localeLabels } from "../i18n";diff --git a/apps/web/features/landing/components/landing-header.tsx b/apps/web/features/landing/components/landing-header.tsxindex d48a66a681..cd5fdcdcf2 100644--- a/apps/web/features/landing/components/landing-header.tsx+++ b/apps/web/features/landing/components/landing-header.tsx@@ -1,7 +1,7 @@"use client";import Link from "next/link";-import { MulticaIcon } from "@/components/multica-icon";+import { MulticaIcon } from "@multica/ui/components/common/multica-icon";import { cn } from "@multica/ui/lib/utils";import { useAuthStore } from "@multica/core/auth";import { useLocale } from "../i18n";diff --git a/packages/core/package.json b/packages/core/package.jsonindex e4f502cfec..9f78095cd5 100644--- a/packages/core/package.json+++ b/packages/core/package.json@@ -3,6 +3,9 @@"version": "0.0.0","private": true,"type": "module",+ "scripts": {+ "typecheck": "tsc --noEmit"+ },"exports": {".": "./index.ts","./types": "./types/index.ts",diff --git a/packages/core/platform/auth-initializer.tsx b/packages/core/platform/auth-initializer.tsxindex 4f5c8db295..712c8a6908 100644--- a/packages/core/platform/auth-initializer.tsx+++ b/packages/core/platform/auth-initializer.tsx@@ -6,6 +6,7 @@ import { useAuthStore } from "../auth";import { useWorkspaceStore } from "../workspace";import { createLogger } from "../logger";import { defaultStorage } from "./storage";+import type { StorageAdapter } from "../types/storage";const logger = createLogger("auth");@@ -13,13 +14,15 @@ export function AuthInitializer({children,onLogin,onLogout,+ storage = defaultStorage,}: {children: ReactNode;onLogin?: () => void;onLogout?: () => void;+ storage?: StorageAdapter;}) {useEffect(() => {- const token = defaultStorage.getItem("multica_token");+ const token = storage.getItem("multica_token");if (!token) {onLogout?.();useAuthStore.setState({ isLoading: false });@@ -28,7 +31,7 @@ export function AuthInitializer({const api = getApi();api.setToken(token);- const wsId = defaultStorage.getItem("multica_workspace_id");+ const wsId = storage.getItem("multica_workspace_id");Promise.all([api.getMe(), api.listWorkspaces()]).then(([user, wsList]) => {@@ -40,8 +43,8 @@ export function AuthInitializer({logger.error("auth init failed", err);api.setToken(null);api.setWorkspaceId(null);- defaultStorage.removeItem("multica_token");- defaultStorage.removeItem("multica_workspace_id");+ storage.removeItem("multica_token");+ storage.removeItem("multica_workspace_id");onLogout?.();useAuthStore.setState({ user: null, isLoading: false });});diff --git a/packages/core/platform/core-provider.tsx b/packages/core/platform/core-provider.tsxindex 1bccd64e70..a66eac62ca 100644--- a/packages/core/platform/core-provider.tsx+++ b/packages/core/platform/core-provider.tsx@@ -11,36 +11,35 @@ import { createLogger } from "../logger";import { defaultStorage } from "./storage";import { AuthInitializer } from "./auth-initializer";import type { CoreProviderProps } from "./types";+import type { StorageAdapter } from "../types/storage";-// Module-level singletons — created once, shared across renders.+// Module-level singletons — created once at first render, never recreated.+// Vite HMR preserves module-level state, so these survive hot reloads.let initialized = false;let authStore: ReturnType<typeof createAuthStore>;let workspaceStore: ReturnType<typeof createWorkspaceStore>;--function initCore(apiBaseUrl: string) {+function initCore(apiBaseUrl: string, storage: StorageAdapter) {if (initialized) return;const api = new ApiClient(apiBaseUrl, {logger: createLogger("api"),onUnauthorized: () => {- defaultStorage.removeItem("multica_token");- defaultStorage.removeItem("multica_workspace_id");+ storage.removeItem("multica_token");+ storage.removeItem("multica_workspace_id");},});setApiInstance(api);// Hydrate token from storage- const token = defaultStorage.getItem("multica_token");+ const token = storage.getItem("multica_token");if (token) api.setToken(token);- const wsId = defaultStorage.getItem("multica_workspace_id");+ const wsId = storage.getItem("multica_workspace_id");if (wsId) api.setWorkspaceId(wsId);- authStore = createAuthStore({ api, storage: defaultStorage });+ authStore = createAuthStore({ api, storage });registerAuthStore(authStore);- workspaceStore = createWorkspaceStore(api, {- storage: defaultStorage,- });+ workspaceStore = createWorkspaceStore(api, { storage });registerWorkspaceStore(workspaceStore);initialized = true;@@ -50,20 +49,23 @@ export function CoreProvider({children,apiBaseUrl = "",wsUrl = "ws://localhost:8080/ws",+ storage = defaultStorage,onLogin,onLogout,}: CoreProviderProps) {- // Initialize singletons on first render- useMemo(() => initCore(apiBaseUrl), [apiBaseUrl]);+ // Initialize singletons on first render only. Dependencies are read-once:+ // apiBaseUrl and storage are set at app boot and never change at runtime.+ // eslint-disable-next-line react-hooks/exhaustive-deps+ useMemo(() => initCore(apiBaseUrl, storage), []);return (<QueryProvider>- <AuthInitializer onLogin={onLogin} onLogout={onLogout}>+ <AuthInitializer onLogin={onLogin} onLogout={onLogout} storage={storage}><WSProviderwsUrl={wsUrl}authStore={authStore}workspaceStore={workspaceStore}- storage={defaultStorage}+ storage={storage}>{children}</WSProvider>diff --git a/packages/core/platform/types.ts b/packages/core/platform/types.tsindex b1d93c908e..0537421bc7 100644--- a/packages/core/platform/types.ts+++ b/packages/core/platform/types.ts@@ -1,9 +1,13 @@+import type { StorageAdapter } from "../types/storage";+export interface CoreProviderProps {children: React.ReactNode;/** API base URL. Default: "" (same-origin). */apiBaseUrl?: string;/** WebSocket URL. Default: "ws://localhost:8080/ws". */wsUrl?: string;+ /** Storage adapter. Default: SSR-safe localStorage wrapper. */+ storage?: StorageAdapter;/** Called after successful login (e.g. set cookie for Next.js middleware). */onLogin?: () => void;/** Called after logout (e.g. clear cookie). */diff --git a/apps/web/components/multica-icon.tsx b/packages/ui/components/common/multica-icon.tsxsimilarity index 98%rename from apps/web/components/multica-icon.tsxrename to packages/ui/components/common/multica-icon.tsxindex 52b0fe82f7..e0f0e09b13 100644--- a/apps/web/components/multica-icon.tsx+++ b/packages/ui/components/common/multica-icon.tsx@@ -1,5 +1,5 @@import { useState, useEffect } from "react";-import { cn } from "@multica/ui/lib/utils";+import { cn } from "../../lib/utils";interface MulticaIconProps extends React.ComponentProps<"span"> {/**diff --git a/apps/desktop/src/renderer/src/components/theme-provider.tsx b/packages/ui/components/common/theme-provider.tsxsimilarity index 72%rename from apps/desktop/src/renderer/src/components/theme-provider.tsxrename to packages/ui/components/common/theme-provider.tsxindex f002f090c6..a8cd428a9d 100644--- a/apps/desktop/src/renderer/src/components/theme-provider.tsx+++ b/packages/ui/components/common/theme-provider.tsx@@ -1,5 +1,7 @@-import { ThemeProvider as NextThemesProvider } from "next-themes";-import { TooltipProvider } from "@multica/ui/components/ui/tooltip";+import { ThemeProvider as NextThemesProvider, useTheme } from "next-themes";++export { useTheme };+import { TooltipProvider } from "../ui/tooltip";export function ThemeProvider({children,diff --git a/packages/ui/package.json b/packages/ui/package.jsonindex 7718afad66..0b96bd8e8e 100644--- a/packages/ui/package.json+++ b/packages/ui/package.json@@ -3,6 +3,9 @@"version": "0.0.0","private": true,"type": "module",+ "scripts": {+ "typecheck": "tsc --noEmit"+ },"exports": {"./components/ui/*": "./components/ui/*.tsx","./components/common/*": "./components/common/*.tsx",@@ -12,7 +15,8 @@"./markdown/mentions": "./markdown/mentions.ts","./hooks/*": "./hooks/*.ts","./lib/utils": "./lib/utils.ts",- "./styles/tokens.css": "./styles/tokens.css"+ "./styles/tokens.css": "./styles/tokens.css",+ "./styles/base.css": "./styles/base.css"},"dependencies": {"@base-ui/react": "^1.3.0",diff --git a/packages/ui/styles/base.css b/packages/ui/styles/base.cssnew file mode 100644index 0000000000..e9a0e025d4--- /dev/null+++ b/packages/ui/styles/base.css@@ -0,0 +1,59 @@+/* =============================================================================+ * Multica shared base styles — imported by all apps+ * ============================================================================= */++/* Shiki dual themes: CSS-only light/dark switching via CSS variables */+/* @see https://shiki.style/guide/dual-themes */+.shiki,+.shiki span {+ color: var(--shiki-light);+}++.dark .shiki,+.dark .shiki span {+ color: var(--shiki-dark) !important;+}++/* Multica icon: entrance spin animation */+@keyframes entrance-spin {+ 0% { transform: rotate(0deg); opacity: 0; }+ 50% { opacity: 1; }+ 100% { transform: rotate(360deg); opacity: 1; }+}++.animate-entrance-spin {+ animation: entrance-spin 0.6s ease-out forwards;+}++/* Sidebar: open triggers (dropdown/popover) get active background */+[data-sidebar="menu-button"][data-popup-open] {+ background-color: var(--sidebar-accent);+ color: var(--sidebar-accent-foreground);+}++/* Sonner toast: align icon to first line of text, not vertically centered */+[data-sonner-toast] {+ align-items: flex-start !important;+}++[data-sonner-toast] [data-icon] {+ margin-top: 2.5px;+}++@layer base {+ * {+ @apply border-border outline-ring/50;+ scrollbar-width: thin;+ scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);+ }+ *::-webkit-scrollbar { width: 6px; height: 6px; }+ *::-webkit-scrollbar-track { background: var(--scrollbar-track); }+ *::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }+ *::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }+ body {+ @apply bg-background text-foreground;+ }+ html {+ @apply font-sans;+ }+}diff --git a/packages/views/editor/content-editor.tsx b/packages/views/editor/content-editor.tsxindex 577be9a43d..6383334668 100644--- a/packages/views/editor/content-editor.tsx+++ b/packages/views/editor/content-editor.tsx@@ -132,17 +132,29 @@ const ContentEditor = forwardRef<ContentEditorRef, ContentEditorProps>(const href = link?.getAttribute("href");if (!href || href.startsWith("mention://")) return false;+ const openLink = () => {+ if (href.startsWith("/")) {+ // Internal path — dispatch custom event so the app can handle it+ // (direct window.open breaks in Electron hash router)+ window.dispatchEvent(+ new CustomEvent("multica:navigate", { detail: { path: href } }),+ );+ } else {+ window.open(href, "_blank", "noopener,noreferrer");+ }+ };+if (!editable) {// Readonly: any click on link opens new tabevent.preventDefault();- window.open(href, "_blank", "noopener,noreferrer");+ openLink();return true;}if (event.metaKey || event.ctrlKey) {// Edit mode: Cmd/Ctrl+click opens link- window.open(href, "_blank", "noopener,noreferrer");event.preventDefault();+ openLink();return true;}diff --git a/packages/views/editor/extensions/mention-view.tsx b/packages/views/editor/extensions/mention-view.tsxindex 81c124ab0c..4a001b4ffe 100644--- a/packages/views/editor/extensions/mention-view.tsx+++ b/packages/views/editor/extensions/mention-view.tsx@@ -23,6 +23,7 @@ import type { NodeViewProps } from "@tiptap/react";import { useQuery } from "@tanstack/react-query";import { issueListOptions } from "@multica/core/issues/queries";import { useWorkspaceId } from "@multica/core/hooks";+import { useNavigation } from "../../navigation";import { StatusIcon } from "../../issues/components/status-icon";export function MentionView({ node }: NodeViewProps) {@@ -52,12 +53,19 @@ function IssueMention({}) {const wsId = useWorkspaceId();const { data: issues = [] } = useQuery(issueListOptions(wsId));+ const { push, openInNewTab } = useNavigation();const issue = issues.find((i) => i.id === issueId);+ const issuePath = `/issues/${issueId}`;+ const tabTitle = issue ? `${issue.identifier}: ${issue.title}` : undefined;const handleClick = (e: React.MouseEvent) => {e.preventDefault();e.stopPropagation();- window.open(`/issues/${issueId}`, "_blank", "noopener,noreferrer");+ if (openInNewTab) {+ openInNewTab(issuePath, tabTitle);+ } else {+ window.open(issuePath, "_blank", "noopener,noreferrer");+ }};const cardClass =diff --git a/packages/views/editor/readonly-content.tsx b/packages/views/editor/readonly-content.tsxindex eb845b807d..96c34ce606 100644--- a/packages/views/editor/readonly-content.tsx+++ b/packages/views/editor/readonly-content.tsx@@ -29,6 +29,7 @@ import { toHtml } from "hast-util-to-html";import { Maximize2, Download, Link as LinkIcon, FileText } from "lucide-react";import { toast } from "sonner";import { cn } from "@multica/ui/lib/utils";+import { useNavigation } from "../navigation";import { IssueMentionCard } from "../issues/components/issue-mention-card";import { ImageLightbox } from "./extensions/image-view";import { preprocessMarkdown } from "./utils/preprocess";@@ -53,6 +54,27 @@ function urlTransform(url: string): string {// Custom react-markdown components// ---------------------------------------------------------------------------+function IssueMentionLink({ issueId, label }: { issueId: string; label?: string }) {+ const { openInNewTab } = useNavigation();+ const path = `/issues/${issueId}`;+ return (+ <span+ className="inline align-middle"+ onClick={(e) => {+ e.preventDefault();+ e.stopPropagation();+ if (openInNewTab) {+ openInNewTab(path, label);+ } else {+ window.open(path, "_blank", "noopener,noreferrer");+ }+ }}+ >+ <IssueMentionCard issueId={issueId} fallbackLabel={label} />+ </span>+ );+}+const components: Partial<Components> = {// Links — route mention:// to mention components, others open in new taba: ({ href, children }) => {@@ -67,25 +89,13 @@ const components: Partial<Components> = {: Array.isArray(children)? children.join(""): undefined;- // Wrap in inline span for vertical alignment (mimics Tiptap's NodeViewWrapper)- return (- <span- className="inline align-middle"- onClick={(e) => {- e.preventDefault();- e.stopPropagation();- window.open(`/issues/${match[2]}`, "_blank", "noopener,noreferrer");- }}- >- <IssueMentionCard issueId={match[2]} fallbackLabel={label} />- </span>- );+ return <IssueMentionLink issueId={match[2]} label={label} />;}// Member / agent / all mentionsreturn <span className="mention">{children}</span>;}- // Regular links — open in new tab (matches ContentEditor readonly behavior)+ // Regular links — open in new tabreturn (<ahref={href}diff --git a/packages/views/issues/components/issue-detail.tsx b/packages/views/issues/components/issue-detail.tsxindex 6d6df5599e..b03f32ecf5 100644--- a/packages/views/issues/components/issue-detail.tsx+++ b/packages/views/issues/components/issue-detail.tsx@@ -632,7 +632,10 @@ export function IssueDetail({ issueId, onDelete, defaultSidebarOpen = true, layo{/* Copy link */}<DropdownMenuItem onClick={() => {- navigator.clipboard.writeText(window.location.href);+ const url = router.getShareableUrl+ ? router.getShareableUrl(router.pathname)+ : window.location.href;+ navigator.clipboard.writeText(url);toast.success("Link copied");}}><Link2 className="h-3.5 w-3.5" />diff --git a/packages/views/layout/app-sidebar.tsx b/packages/views/layout/app-sidebar.tsxindex 6e27bcaeb0..0fbfa77f58 100644--- a/packages/views/layout/app-sidebar.tsx+++ b/packages/views/layout/app-sidebar.tsx@@ -1,6 +1,7 @@"use client";import React from "react";+import { cn } from "@multica/ui/lib/utils";import { AppLink, useNavigation } from "../navigation";import {Inbox,@@ -66,7 +67,16 @@ function DraftDot() {return <span className="absolute top-0 right-0 size-1.5 rounded-full bg-brand" />;}-export function AppSidebar() {+interface AppSidebarProps {+ /** Rendered above SidebarHeader (e.g. desktop traffic light spacer) */+ topSlot?: React.ReactNode;+ /** Extra className for SidebarHeader */+ headerClassName?: string;+ /** Extra style for SidebarHeader */+ headerStyle?: React.CSSProperties;+}++export function AppSidebar({ topSlot, headerClassName, headerStyle }: AppSidebarProps = {}) {const { pathname, push } = useNavigation();const user = useAuthStore((s) => s.user);const authLogout = useAuthStore((s) => s.logout);@@ -93,8 +103,9 @@ export function AppSidebar() {return (<Sidebar variant="inset">+ {topSlot}{/* Workspace Switcher */}- <SidebarHeader className="py-3">+ <SidebarHeader className={cn("py-3", headerClassName)} style={headerStyle}><div className="flex items-center gap-4"><SidebarMenu className="min-w-0 flex-1"><SidebarMenuItem>@@ -111,7 +122,7 @@ export function AppSidebar() {}/><DropdownMenuContent- className="w-52"+ className="w-auto"align="start"side="bottom"sideOffset={4}diff --git a/packages/views/layout/dashboard-layout.tsx b/packages/views/layout/dashboard-layout.tsxindex dfe0b4ae75..24689915df 100644--- a/packages/views/layout/dashboard-layout.tsx+++ b/packages/views/layout/dashboard-layout.tsx@@ -1,54 +1,31 @@"use client";-import { useEffect, type ReactNode } from "react";-import { useNavigationStore } from "@multica/core/navigation";+import type { ReactNode } from "react";import { SidebarProvider, SidebarInset } from "@multica/ui/components/ui/sidebar";import { WorkspaceIdProvider } from "@multica/core/hooks";-import { useAuthStore } from "@multica/core/auth";-import { useWorkspaceStore } from "@multica/core/workspace";import { ModalRegistry } from "../modals/registry";-import { useNavigation } from "../navigation";import { AppSidebar } from "./app-sidebar";+import { useDashboardGuard } from "./use-dashboard-guard";interface DashboardLayoutProps {children: ReactNode;- /** Above sidebar area (e.g. desktop TitleBar) */- header?: ReactNode;- /** Sibling of SidebarInset (e.g. web SearchCommand) */+ /** Sibling of SidebarInset (e.g. SearchCommand) */extra?: ReactNode;/** Loading indicator */loadingIndicator?: ReactNode;- /** Redirect path when not authenticated. Default: "/" */- loginPath?: string;}export function DashboardLayout({children,- header,extra,loadingIndicator,- loginPath = "/",}: DashboardLayoutProps) {- const { pathname, push } = useNavigation();- const user = useAuthStore((s) => s.user);- const isLoading = useAuthStore((s) => s.isLoading);- const workspace = useWorkspaceStore((s) => s.workspace);-- useEffect(() => {- if (!isLoading && !user) push(loginPath);- }, [user, isLoading, push, loginPath]);-- useEffect(() => {- useNavigationStore.getState().onPathChange(pathname);- }, [pathname]);+ const { user, isLoading, workspace } = useDashboardGuard("/");if (isLoading) {return (- <div className="flex h-screen flex-col">- {header}- <div className="flex flex-1 items-center justify-center">- {loadingIndicator}- </div>+ <div className="flex h-screen items-center justify-center">+ {loadingIndicator}</div>);}@@ -56,26 +33,21 @@ export function DashboardLayout({if (!user) return null;return (- <div className="flex h-screen flex-col">- {header}- <div className="flex flex-1 min-h-0">- <SidebarProvider className="flex-1">- <AppSidebar />- <SidebarInset className="overflow-hidden">- {workspace ? (- <WorkspaceIdProvider wsId={workspace.id}>- {children}- <ModalRegistry />- </WorkspaceIdProvider>- ) : (- <div className="flex flex-1 items-center justify-center">- {loadingIndicator}- </div>- )}- </SidebarInset>- {extra}- </SidebarProvider>- </div>- </div>+ <SidebarProvider className="h-svh">+ <AppSidebar />+ <SidebarInset className="overflow-hidden">+ {workspace ? (+ <WorkspaceIdProvider wsId={workspace.id}>+ {children}+ <ModalRegistry />+ </WorkspaceIdProvider>+ ) : (+ <div className="flex flex-1 items-center justify-center">+ {loadingIndicator}+ </div>+ )}+ </SidebarInset>+ {extra}+ </SidebarProvider>);}diff --git a/packages/views/layout/index.ts b/packages/views/layout/index.tsindex 27f29deecf..3adefbbbbb 100644--- a/packages/views/layout/index.ts+++ b/packages/views/layout/index.ts@@ -1,2 +1,3 @@export { AppSidebar } from "./app-sidebar";export { DashboardLayout } from "./dashboard-layout";+export { useDashboardGuard } from "./use-dashboard-guard";diff --git a/packages/views/layout/use-dashboard-guard.ts b/packages/views/layout/use-dashboard-guard.tsnew file mode 100644index 0000000000..79c8fe7e90--- /dev/null+++ b/packages/views/layout/use-dashboard-guard.ts@@ -0,0 +1,24 @@+"use client";++import { useEffect } from "react";+import { useNavigationStore } from "@multica/core/navigation";+import { useAuthStore } from "@multica/core/auth";+import { useWorkspaceStore } from "@multica/core/workspace";+import { useNavigation } from "../navigation";++export function useDashboardGuard(loginPath = "/") {+ const { pathname, push } = useNavigation();+ const user = useAuthStore((s) => s.user);+ const isLoading = useAuthStore((s) => s.isLoading);+ const workspace = useWorkspaceStore((s) => s.workspace);++ useEffect(() => {+ if (!isLoading && !user) push(loginPath);+ }, [user, isLoading, push, loginPath]);++ useEffect(() => {+ useNavigationStore.getState().onPathChange(pathname);+ }, [pathname]);++ return { user, isLoading, workspace };+}diff --git a/packages/views/navigation/app-link.tsx b/packages/views/navigation/app-link.tsxindex 4eae32ab54..75417706c3 100644--- a/packages/views/navigation/app-link.tsx+++ b/packages/views/navigation/app-link.tsx@@ -9,11 +9,16 @@ interface AppLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {export const AppLink = forwardRef<HTMLAnchorElement, AppLinkProps>(function AppLink({ href, children, onClick, ...props }, ref) {- const { push } = useNavigation();+ const { push, openInNewTab } = useNavigation();const handleClick = (e: React.MouseEvent<HTMLAnchorElement>) => {- // Allow ctrl/cmd+click to open in new tab- if (e.metaKey || e.ctrlKey || e.shiftKey) return;+ if (e.metaKey || e.ctrlKey || e.shiftKey) {+ if (openInNewTab) {+ e.preventDefault();+ openInNewTab(href);+ }+ return;+ }e.preventDefault();onClick?.(e);push(href);diff --git a/packages/views/navigation/types.ts b/packages/views/navigation/types.tsindex 9e825fa617..5fb575fc09 100644--- a/packages/views/navigation/types.ts+++ b/packages/views/navigation/types.ts@@ -4,4 +4,8 @@ export interface NavigationAdapter {back(): void;pathname: string;searchParams: URLSearchParams;+ /** Desktop only: open a path in a new background tab. Optional title overrides the default. */+ openInNewTab?: (path: string, title?: string) => void;+ /** Return a shareable URL for a path. Web: origin + path. Desktop: public web URL. */+ getShareableUrl?: (path: string) => string;}diff --git a/packages/views/package.json b/packages/views/package.jsonindex 73eb8aae0e..0613d65722 100644--- a/packages/views/package.json+++ b/packages/views/package.json@@ -3,6 +3,9 @@"version": "0.0.0","private": true,"type": "module",+ "scripts": {+ "typecheck": "tsc --noEmit"+ },"exports": {"./navigation": "./navigation/index.ts","./common/actor-avatar": "./common/actor-avatar.tsx",@@ -60,7 +63,6 @@"remark-gfm": "^4.0.1","react-resizable-panels": "^4.7.5","recharts": "3.8.0",- "next-themes": "^0.4.6","sonner": "^2.0.7"},"peerDependencies": {diff --git a/packages/views/settings/components/appearance-tab.tsx b/packages/views/settings/components/appearance-tab.tsxindex bc9b1428dc..a7573ea973 100644--- a/packages/views/settings/components/appearance-tab.tsx+++ b/packages/views/settings/components/appearance-tab.tsx@@ -1,6 +1,6 @@"use client";-import { useTheme } from "next-themes";+import { useTheme } from "@multica/ui/components/common/theme-provider";import { cn } from "@multica/ui/lib/utils";const LIGHT_COLORS = {diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex b2b1996612..aeeb73fa17 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -87,9 +87,6 @@ importers:'@multica/views':specifier: workspace:*version: link:../../packages/views- next-themes:- specifier: ^0.4.6react-router-dom:specifier: ^7.6.0@@ -99,16 +96,16 @@ importers:devDependencies:'@electron-toolkit/tsconfig':specifier: ^2.0.0- version: 2.0.0(@types/[email protected])+ version: 2.0.0(@types/[email protected])'@multica/tsconfig':specifier: workspace:*version: link:../../packages/tsconfig'@tailwindcss/vite':specifier: ^4'@types/node':- specifier: ^22.19.1- version: 22.19.17+ specifier: 'catalog:'+ version: 25.5.0'@types/react':specifier: ^19.2.0version: 19.2.14@@ -117,7 +114,7 @@ importers:version: 19.2.3(@types/[email protected])'@vitejs/plugin-react':specifier: ^5.1.1electron:specifier: ^39.2.6version: 39.8.7@@ -126,18 +123,18 @@ importers:version: 26.8.1([email protected])electron-vite:specifier: ^5.0.0react:- specifier: 19.2.3+ specifier: 'catalog:'version: 19.2.3react-dom:- specifier: 19.2.3+ specifier: 'catalog:'version: 19.2.3([email protected])tailwindcss:specifier: ^4version: 4.2.2typescript:- specifier: ^5.9.3+ specifier: 'catalog:'version: 5.9.3apps/web:@@ -5935,9 +5932,9 @@ snapshots:dependencies:electron: 39.8.7- '@electron-toolkit/[email protected](@types/[email protected])':+ '@electron-toolkit/[email protected](@types/[email protected])':dependencies:- '@types/node': 22.19.17+ '@types/node': 25.5.0'@electron-toolkit/[email protected]([email protected])':dependencies:@@ -6798,12 +6795,12 @@ snapshots:postcss: 8.5.8tailwindcss: 4.2.2dependencies:'@tailwindcss/node': 4.2.2'@tailwindcss/oxide': 4.2.2tailwindcss: 4.2.2- vite: 8.0.1(@types/[email protected])([email protected])+ vite: 8.0.1(@types/[email protected])([email protected])'@tanstack/[email protected]': {}@@ -7141,7 +7138,7 @@ snapshots:dependencies:'@types/http-cache-semantics': 4.2.0'@types/keyv': 3.1.4- '@types/node': 22.19.17+ '@types/node': 25.5.0'@types/responselike': 1.0.3'@types/[email protected]':@@ -7187,7 +7184,7 @@ snapshots:'@types/[email protected]':dependencies:- '@types/node': 22.19.17+ '@types/node': 25.5.0'@types/[email protected]':dependencies:@@ -7197,7 +7194,7 @@ snapshots:'@types/[email protected]':dependencies:- '@types/node': 22.19.17+ '@types/node': 25.5.0'@types/[email protected]': {}@@ -7224,13 +7221,13 @@ snapshots:'@types/[email protected]':dependencies:- '@types/node': 22.19.17+ '@types/node': 25.5.0pg-protocol: 1.13.0pg-types: 2.2.0'@types/[email protected]':dependencies:- '@types/node': 22.19.17+ '@types/node': 25.5.0xmlbuilder: 15.1.1optional: true@@ -7244,7 +7241,7 @@ snapshots:'@types/[email protected]':dependencies:- '@types/node': 22.19.17+ '@types/node': 25.5.0'@types/[email protected]': {}@@ -7261,12 +7258,12 @@ snapshots:'@types/[email protected]':dependencies:- '@types/node': 22.19.17+ '@types/node': 25.5.0optional: true'@ungap/[email protected]': {}dependencies:'@babel/core': 7.29.0'@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/[email protected])@@ -7274,7 +7271,7 @@ snapshots:'@rolldown/pluginutils': 1.0.0-rc.3'@types/babel__core': 7.20.5react-refresh: 0.18.0- vite: 8.0.1(@types/[email protected])([email protected])+ vite: 8.0.1(@types/[email protected])([email protected])transitivePeerDependencies:- supports-color@@ -7985,7 +7982,7 @@ snapshots:dependencies:'@babel/core': 7.29.0'@babel/plugin-transform-arrow-functions': 7.27.1(@babel/[email protected])@@ -7993,7 +7990,7 @@ snapshots:esbuild: 0.25.12magic-string: 0.30.21picocolors: 1.1.1- vite: 8.0.1(@types/[email protected])([email protected])+ vite: 8.0.1(@types/[email protected])([email protected])transitivePeerDependencies:- supports-color@@ -10811,18 +10808,6 @@ snapshots:d3-time: 3.1.0d3-timer: 3.0.1- dependencies:- lightningcss: 1.32.0- picomatch: 4.0.3- postcss: 8.5.8- rolldown: 1.0.0-rc.10- tinyglobby: 0.2.15- optionalDependencies:- '@types/node': 22.19.17- fsevents: 2.3.3- jiti: 2.6.1-dependencies:lightningcss: 1.32.0