Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/web/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@ export async function generateMetadata(): Promise<Metadata> {
export default function RootLayout({ children }: { children: ReactNode }) {
return (
<html lang="en" className="dark" suppressHydrationWarning>
<head>
<link rel="manifest" href="/manifest.webmanifest" crossOrigin="use-credentials" />
</head>
<body className="h-screen overflow-hidden bg-[var(--color-bg-base)] text-[var(--color-text-primary)] antialiased">
<Providers>{children}</Providers>
<ServiceWorkerRegistrar />
</body>
</html>
);
}

4 changes: 2 additions & 2 deletions packages/web/src/app/manifest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ vi.mock("@/lib/project-name", () => ({

describe("app manifest", () => {
it("builds the PWA manifest with project-aware naming and icons", async () => {
const { default: manifest } = await import("./manifest");
const { buildPwaManifest } = await import("@/lib/pwa-manifest");

expect(manifest()).toMatchObject({
expect(buildPwaManifest()).toMatchObject({
name: "ao | Agent Orchestrator",
short_name: "ao",
start_url: "/",
Expand Down
8 changes: 8 additions & 0 deletions packages/web/src/app/manifest.webmanifest/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { buildPwaManifest } from "@/lib/pwa-manifest";

export function GET() {
const manifest = buildPwaManifest();
return new Response(JSON.stringify(manifest), {
headers: { "Content-Type": "application/manifest+json" },
});
Comment thread
greptile-apps[bot] marked this conversation as resolved.
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { MetadataRoute } from "next";
import { getProjectName } from "@/lib/project-name";

export default function manifest(): MetadataRoute.Manifest {
export function buildPwaManifest(): MetadataRoute.Manifest {
const projectName = getProjectName();
return {
name: `ao | ${projectName}`,
Expand Down