feat(planner): desktop redesign — flip tiles, full-width grid, no right panel #54
@@ -25,7 +25,20 @@
|
|||||||
|
|
||||||
let days = $derived(weekDays(weekStart));
|
let days = $derived(weekDays(weekStart));
|
||||||
let slots = $derived(weekPlan?.slots ?? []);
|
let slots = $derived(weekPlan?.slots ?? []);
|
||||||
let slotMap = $derived(Object.fromEntries(slots.map((s: any) => [s.slotDate, s])));
|
// SlotRecipe from the API has no tags — merge from data.recipes by id
|
||||||
|
const recipeById = $derived(
|
||||||
|
Object.fromEntries((data.recipes ?? []).map((r: any) => [r.id, r]))
|
||||||
|
);
|
||||||
|
let slotMap = $derived(
|
||||||
|
Object.fromEntries(
|
||||||
|
slots.map((s: any) => [
|
||||||
|
s.slotDate,
|
||||||
|
s.recipe
|
||||||
|
? { ...s, recipe: { ...s.recipe, tags: recipeById[s.recipe.id]?.tags ?? [] } }
|
||||||
|
: s
|
||||||
|
])
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
// Default selected day: today if in this week, else first day
|
// Default selected day: today if in this week, else first day
|
||||||
// We read data.weekStart once synchronously here (before reactivity kicks in) to seed the initial value.
|
// We read data.weekStart once synchronously here (before reactivity kicks in) to seed the initial value.
|
||||||
|
|||||||
Reference in New Issue
Block a user