You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GET /api/recipes sends the absolute path of every recipe #638
GET /api/recipes answers with the recipe tree, and every node carries the file's absolute path on the server, twice: as path, and as recipe.source.path.
{"children":{"2 Day Plan":{"name":"2 Day Plan","path":"/home/<user>/recipes/2 Day Plan.menu",
"recipe":{"source":{"path":"/home/<user>/recipes/2 Day Plan.menu","source_type":"Path"}, …
That tells any client the server's directory layout and, usually, the name of the account it runs as. The endpoint is a read open to everyone: with sign-in on, visitors who are not signed in get it, and it is on the --recipes-only allowlist, so guests limited to recipes get it too. Nothing needs the absolute path. The only client in the repo, the recipe picker (static/js/src/picker.js, flattenTree), strips the root's path off again to get relative ones.
It started with be92001 ("refactor: wip reming cooklang-fs"). Before it, the endpoint returned the recipes' names relative to the collection; since then it serialises cooklang_find's tree as is. docs/api.md documents the absolute paths (/absolute/path/to/seed/...).
Proposed fix
Make every path and recipe.source.path in the answer relative to the recipe directory (Breakfast/Easy Pancakes.cook), with the root as "". The picker keeps working unchanged. Any outside client that used the absolute paths would need to treat them as relative to the collection: that is the one visible change.
The Preferences page has a similar problem, tracked in #637.
Activity
fix(server): name recipes relative to the collection in GET /api/reci…