Add dynamic sizing of recipe

This commit is contained in:
2026-08-03 21:38:34 -05:00
parent e0b04beac5
commit 348a4555ca
3 changed files with 94 additions and 8 deletions
+44
View File
@@ -98,6 +98,50 @@ References:
- [Cookbook API documentation](https://nextcloud.github.io/cookbook/dev/api/0.1.0/index.html)
- [Cookbook user documentation](https://nextcloud.github.io/cookbook/user/)
## Future architecture: recipe sources and consumers
The current module both retrieves recipes and presents the full-screen recipe
mode. A future version should separate those responsibilities using
MagicMirror's notification system as a shared recipe data stream:
```text
MMM-NextcloudCookbook ─┐
MMM-Paprika ───────────┼── recipe data notifications ──> MMM-RecipeMode
MMM-Mealime ───────────┘
```
In that model:
- `MMM-NextcloudCookbook` is a source adapter. It reads recipes from Nextcloud
Cookbook and publishes normalized recipe records.
- `MMM-RecipeMode` is a consumer. It provides recipe selection, the phone
control page, portion scaling, QR code, and full-screen cooking display.
- Other source modules can publish recipes from Paprika, Mealime, local files,
or other services without duplicating the presentation code.
- Additional consumers can use the same recipe data for meal planning, search,
shopping lists, dashboards, or other displays.
The shared notification contract should eventually define source-qualified
stable recipe IDs, basic list metadata, complete recipe records, refresh and
error states, and optional source capabilities. The normalized record should
retain schema.org Recipe fields where practical. Exact notification names and
payload schemas should be designed when a second source or consumer is
implemented, rather than treating the current module's private HTTP API as the
cross-module contract.
This separation is a future feature. The current combined behavior should
remain functional until `MMM-RecipeMode` can replace its presentation and
control responsibilities.
### Future presentation option: preserve selected modules
Recipe mode currently hides every other MagicMirror module. A future
`MMM-RecipeMode` configuration should accept an allowlist of modules to leave
visible while cooking. For example, a user could preserve a calendar at the top
of the display while the recipe occupies the remaining area. The option should
support module names and, where multiple instances exist, specific instance
identifiers. Hiding all other modules should remain the default.
## Development
```bash