Skip to content

⭐️⭐️⭐️ Open-source, self-hosted alternative to Linear and Plane. Project management and issue tracking where teams and AI agents work side by side to plan and ship products.

feat(web): make the web app installable (#532)

Allie87971fb2f8a6
diff --git a/apps/web/public/icon-192.png b/apps/web/public/icon-192.png
new file mode 100644
index 00000000..6a02418d
Binary files /dev/null and b/apps/web/public/icon-192.png differ
diff --git a/apps/web/public/icon-512.png b/apps/web/public/icon-512.png
new file mode 100644
index 00000000..f23180a9
Binary files /dev/null and b/apps/web/public/icon-512.png differ
diff --git a/apps/web/public/icon-maskable-512.png b/apps/web/public/icon-maskable-512.png
new file mode 100644
index 00000000..34cd6c71
Binary files /dev/null and b/apps/web/public/icon-maskable-512.png differ
diff --git a/apps/web/src/app/apple-icon.png b/apps/web/src/app/apple-icon.png
new file mode 100644
index 00000000..5cac144f
Binary files /dev/null and b/apps/web/src/app/apple-icon.png differ
diff --git a/apps/web/src/app/layout.tsx b/apps/web/src/app/layout.tsx
index 0d8f3452..e009ec3c 100644
--- a/apps/web/src/app/layout.tsx
+++ b/apps/web/src/app/layout.tsx
@@ -1,4 +1,4 @@
-import type { Metadata } from 'next';
+import type { Metadata, Viewport } from 'next';
import { ThemeProvider } from 'next-themes';
import { NextIntlClientProvider } from 'next-intl';
import { getLocale, getTranslations } from 'next-intl/server';
@@ -10,9 +10,22 @@ import './globals.css';
export async function generateMetadata(): Promise<Metadata> {
const t = await getTranslations('meta');
- return { title: t('title'), description: t('description') };
+ return {
+ title: t('title'),
+ description: t('description'),
+ appleWebApp: { title: "It's a Plan", capable: true, statusBarStyle: 'default' },
+ };
}
+// The `--background` of each theme in globals.css, so the browser chrome of an
+// installed app matches the page.
+export const viewport: Viewport = {
+ themeColor: [
+ { media: '(prefers-color-scheme: light)', color: '#fafafa' },
+ { media: '(prefers-color-scheme: dark)', color: '#131313' },
+ ],
+};
+
export default async function RootLayout({
children,
}: Readonly<{
diff --git a/apps/web/src/app/manifest.ts b/apps/web/src/app/manifest.ts
new file mode 100644
index 00000000..61238509
--- /dev/null
+++ b/apps/web/src/app/manifest.ts
@@ -0,0 +1,22 @@
+import type { MetadataRoute } from 'next';
+
+// Makes the app installable: Add to Dock in Safari, Install in Chrome and Edge,
+// Add to Home Screen on a phone. The colours are the light theme's `--background`;
+// the browser chrome follows the viewport `themeColor` in the root layout instead,
+// which also covers the dark theme.
+export default function manifest(): MetadataRoute.Manifest {
+ return {
+ name: "It's a Plan",
+ short_name: "It's a Plan",
+ start_url: '/',
+ scope: '/',
+ display: 'standalone',
+ background_color: '#fafafa',
+ theme_color: '#fafafa',
+ icons: [
+ { src: '/icon-192.png', sizes: '192x192', type: 'image/png', purpose: 'any' },
+ { src: '/icon-512.png', sizes: '512x512', type: 'image/png', purpose: 'any' },
+ { src: '/icon-maskable-512.png', sizes: '512x512', type: 'image/png', purpose: 'maskable' },
+ ],
+ };
+}