feat(ui): path-based app-router routes with 404 and project auth preview

Resolve routes from pathname (and legacy hash), add a notFound route with
a dedicated 404 page, and show a blurred workspace preview for
unauthenticated project visits. Wire up Next.js app-router entry files and
listen for popstate so history navigation updates the route.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-08 12:07:13 +08:00
parent 92343ef1f6
commit 4e98a81aae
9 changed files with 592 additions and 15 deletions
+5 -7
View File
@@ -168,19 +168,17 @@ export const designGateway = {
agentSocket(projectId: string, payload: AgentChatPayload, handlers: ProjectEventHandlers) {
let closed = false;
let closeEvents: (() => void) | null = payload.threadId ? designGateway.projectEvents(projectId, handlers, { threadId: payload.threadId }) : null;
let closeEvents: (() => void) | null = null;
void designGateway
.agentChat(projectId, payload)
.then((response) => {
if (closed) return;
handlers.onProject?.(response.project);
if (!closeEvents) {
closeEvents = designGateway.projectEvents(response.project.id, handlers, {
threadId: response.threadId || payload.threadId,
eventsUrl: response.eventsUrl
});
}
closeEvents = designGateway.projectEvents(response.project.id, handlers, {
threadId: response.threadId || payload.threadId,
eventsUrl: response.eventsUrl
});
})
.catch((error: Error) => {
if (!closed) {