v0.29.0 — Ramble box, dark-mode toggle, pantry pull reasons

- #10 Ramble box: new /ramble sticky-note board (post/pin/archive/delete),
  ported from FMB. New Ramble model + migration, /api/rambles routes, nav entry.
- #6 Dark-mode toggle: sun/moon button in the top bar (dark palette already
  existed in CSS, just had no control).
- #9 Pantry pull reason: structured disposition (Immediate use / Preserved /
  Gave away / Waste) on ItemLog.reason, added to single + bulk pull dialogs
  and the audit payload. New migration.
- #2 Suggestions: drop the stale white-card wrapper; render SuggestionsPanel
  bare like FMB so it's readable and thumbnails show.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-12 14:40:54 -05:00
parent 2ad9ac53f8
commit 083e2992c9
18 changed files with 499 additions and 10 deletions

View File

@@ -166,6 +166,7 @@ export async function usePantryItem(
const result = await bulkUsePantry(ctx, {
pulls: [{ id, amount: input.amount }],
notes: input.notes ?? null,
reason: input.reason ?? null,
});
if (result.skipped.length) throw new ApiError(404, "Pantry item not found");
return { remaining: result.results[0].remaining };
@@ -183,6 +184,7 @@ export async function bulkUsePantry(
): Promise<BulkUseResult> {
const ids = input.pulls.map(p => p.id);
const notes = input.notes?.trim() || null;
const reason = input.reason ?? null;
return db.$transaction(async tx => {
const items = await tx.item.findMany({
@@ -203,6 +205,7 @@ export async function bulkUsePantry(
type: "USED",
amount: u.amount,
notes,
reason,
actorId: ctx.userId,
},
});
@@ -216,6 +219,7 @@ export async function bulkUsePantry(
pulls: plan.updates.map(u => ({ id: u.id, name: u.name, amount: u.amount })),
skipped: plan.skipped,
notes,
reason,
via: ctx.via,
},
},