Files
Arnaud c8ee743458 feat: OS Share Target for recipe URLs (v0.67.0)
Declares share_target in manifest.ts (action /recipes, GET,
title/text/url params). recipes/page.tsx extracts the shared link --
preferring the url param, falling back to the first http(s) URL
found inside text since senders vary on where they put it -- and
passes it to RecipesHeader as sharedUrl. UrlImportDialog gained
initialUrl/autoImport props so the existing import-from-URL flow
opens pre-filled and fires immediately instead of requiring the user
to paste the link back in.

Chromium/Android only -- Safari has no Share Target API at all,
same restriction already documented for the install-prompt banner.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-21 23:36:53 +02:00

33 lines
1.2 KiB
TypeScript

import type { MetadataRoute } from "next";
export default function manifest(): MetadataRoute.Manifest {
return {
name: "Epicure",
short_name: "Epicure",
description: "Your AI-powered recipe book",
start_url: "/recipes",
display: "standalone",
background_color: "#ffffff",
theme_color: "#18181b",
icons: [
{ src: "/icon-192.svg", sizes: "192x192", type: "image/svg+xml", purpose: "any" },
{ src: "/icon-192.svg", sizes: "192x192", type: "image/svg+xml", purpose: "maskable" },
{ src: "/icon-512.svg", sizes: "512x512", type: "image/svg+xml", purpose: "any" },
{ src: "/icon-512.svg", sizes: "512x512", type: "image/svg+xml", purpose: "maskable" },
],
// Registers Epicure as a share target in the OS share sheet (Chromium
// on Android/desktop once installed — Safari has no equivalent API).
// Sharing a recipe link from another app opens /recipes with these
// query params, which auto-opens the URL-import dialog pre-filled.
share_target: {
action: "/recipes",
method: "GET",
params: {
title: "title",
text: "text",
url: "url",
},
},
};
}