feat: add list and compact view modes to recipes page

Grid was the only layout. Add a view-mode toggle (grid/list/compact)
persisted to localStorage:
- List: thumbnail + description + inline metadata, one per row
- Compact: dense single-line rows (thumb, title, servings/time/
  difficulty/date/visibility) for scanning large libraries
Selection mode and bulk actions work identically across all three.

Also fixes a real bug hit while wiring this up: "recipe.visibility"
was defined twice in the messages files — once as a flat string
("Visibility", used as the bulk-actions dropdown label) and once as
the {private,unlisted,public} label object. The object silently won
in JSON, so t("visibility") resolved to an object and next-intl threw
INSUFFICIENT_PATH the moment you opened that dropdown. Renamed the
flat one to visibilityMenuLabel.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Arnaud
2026-07-09 09:47:39 +02:00
parent 1614da38cd
commit 64f45ed74d
4 changed files with 222 additions and 133 deletions
+1 -1
View File
@@ -265,7 +265,7 @@ export function RecipeForm({ recipeId, defaultValues }: RecipeFormProps) {
</div>
<div className="space-y-2">
<Label htmlFor="visibility">{t("visibility")}</Label>
<Label htmlFor="visibility">{t("visibilityMenuLabel")}</Label>
<select
id="visibility"
value={visibility}