mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-23 18:17:44 +02:00
- Create NavigationAdapter interface (push, replace, back, pathname, searchParams) - Create AppLink component replacing next/link in 4 files - Replace useRouter → useNavigation in 3 files (issue-detail, create-issue, create-workspace) - Create WebNavigationProvider wrapping Next.js useRouter/usePathname/useSearchParams - Move ~85 feature UI files (issues, editor, modals, my-issues, skills, runtimes) to packages/views/ - Add store singleton registration pattern (registerAuthStore, registerWorkspaceStore) - Create data-aware wrappers in packages/views/common/ (ActorAvatar, Markdown) - Update all app-layer imports to @multica/views/* - Add @source directive for Tailwind to scan views package - packages/views/ has zero next/* imports Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
41 lines
898 B
TypeScript
41 lines
898 B
TypeScript
"use client";
|
|
|
|
import { Suspense } from "react";
|
|
import { useRouter, usePathname, useSearchParams } from "next/navigation";
|
|
import {
|
|
NavigationProvider,
|
|
type NavigationAdapter,
|
|
} from "@multica/views/navigation";
|
|
|
|
function NavigationProviderInner({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode;
|
|
}) {
|
|
const router = useRouter();
|
|
const pathname = usePathname();
|
|
const searchParams = useSearchParams();
|
|
|
|
const adapter: NavigationAdapter = {
|
|
push: router.push,
|
|
replace: router.replace,
|
|
back: router.back,
|
|
pathname,
|
|
searchParams: new URLSearchParams(searchParams.toString()),
|
|
};
|
|
|
|
return <NavigationProvider value={adapter}>{children}</NavigationProvider>;
|
|
}
|
|
|
|
export function WebNavigationProvider({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode;
|
|
}) {
|
|
return (
|
|
<Suspense>
|
|
<NavigationProviderInner>{children}</NavigationProviderInner>
|
|
</Suspense>
|
|
);
|
|
}
|