feat: custom recipe cover color/icon + mute auto placeholder palette (v0.51.0)
Two changes to the no-photo cover placeholder shipped last version: 1. Muted the gradient palette (100/40-opacity tints instead of solid -200/ -950 stops) — the original was too saturated next to real cover photos in the same grid, per feedback. 2. New coverIcon/coverColor columns on recipes (nullable text, migration 0048, additive-only) let the author pin a specific color+icon from the recipe editor instead of the automatic per-id pick. getRecipePlaceholder now checks these first, falling back to the deterministic hash pick when unset — existing recipes are unaffected until edited. Wired coverIcon/coverColor through every explicit-column recipe select that feeds a grid card (explore trending/recent, search, feed, for-you) — the relational-query call sites (recipes page, collections, profile pages) already return all columns and needed no changes. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE "recipes" ADD COLUMN "cover_icon" text;--> statement-breakpoint
|
||||
ALTER TABLE "recipes" ADD COLUMN "cover_color" text;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -337,6 +337,13 @@
|
||||
"when": 1784394631882,
|
||||
"tag": "0047_acoustic_goblin_queen",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 48,
|
||||
"version": "7",
|
||||
"when": 1784449674049,
|
||||
"tag": "0048_normal_shiver_man",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -49,6 +49,10 @@ export const recipes = pgTable("recipes", {
|
||||
cookMins: integer("cook_mins"),
|
||||
tags: text("tags").array().notNull().default([]),
|
||||
isBatchCook: boolean("is_batch_cook").notNull().default(false),
|
||||
// User-chosen cover for when there's no photo — null falls back to the
|
||||
// deterministic hash-based placeholder (see lib/recipe-placeholder.ts).
|
||||
coverIcon: text("cover_icon"),
|
||||
coverColor: text("cover_color"),
|
||||
createdAt: timestamp("created_at").notNull().defaultNow(),
|
||||
updatedAt: timestamp("updated_at").notNull().defaultNow(),
|
||||
}, (t) => [
|
||||
|
||||
Reference in New Issue
Block a user