feat(pwa): install the chat as a standalone app
The chat page now exports Metadata that points at /chat.webmanifest and declares appleWebApp for Safari's Add to Home Screen path (which ignores manifest scope rules). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
fce03e44f3
commit
d40b7eb516
1 changed files with 21 additions and 0 deletions
|
|
@ -1,10 +1,31 @@
|
|||
import { notFound } from "next/navigation";
|
||||
import type { Metadata } from "next";
|
||||
import { chatEnabled, getProvider } from "@/lib/chat";
|
||||
import { Topbar } from "@/components/layout/sidebar";
|
||||
import { ChatView } from "./chat-view";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
/**
|
||||
* A manifest distinct from the dashboard's, so the chat installs as its
|
||||
* own app. The dashboard manifest is generated by next-pwa from
|
||||
* next.config.js; this one is a static file in public/ and does not
|
||||
* interfere with it.
|
||||
*
|
||||
* appleWebApp covers Safari's "Add to Home Screen", which ignores
|
||||
* manifest scope rules — Apple treats the open page as a standalone
|
||||
* bookmark, so the meta tags are what drive that path.
|
||||
*/
|
||||
export const metadata: Metadata = {
|
||||
title: "Ask · MEGA INFRASTRUCTURE",
|
||||
manifest: "/chat.webmanifest",
|
||||
appleWebApp: {
|
||||
capable: true,
|
||||
title: "Ask",
|
||||
statusBarStyle: "default",
|
||||
},
|
||||
};
|
||||
|
||||
export default function ChatPage() {
|
||||
// Same gate as the API route — the page must not exist when disabled.
|
||||
if (!chatEnabled()) notFound();
|
||||
|
|
|
|||
Loading…
Reference in a new issue