fix: hide recipe variations button when locked instead of disabled+lock-badge (v0.78.1)
Was the one gated feature still shown as a clickable disabled button with a small lock icon overlay, opening an upgrade dialog on click. Every other gated feature (pairings, nutrition estimate, markdown export) hides entirely instead — brought this one in line and removed the now-dead locked/UpgradeDialog code from VariationsButton. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,11 @@
|
||||
|
||||
All notable changes to Epicure are documented here. This file is mirrored in-app at `/changelog` (and in the admin dashboard) via `apps/web/lib/changelog.ts` — update both together.
|
||||
|
||||
## 0.78.1 — 2026-07-24 14:10
|
||||
|
||||
### Fixed
|
||||
- Recipe variations button was the one leftover spot still shown disabled with a small lock badge for tiers without the feature, instead of hidden entirely like every other gated feature. Now hidden, matching meal/drink pairings, nutrition estimation, and Markdown export.
|
||||
|
||||
## 0.78.0 — 2026-07-24 13:40
|
||||
|
||||
### Fixed
|
||||
|
||||
@@ -116,6 +116,7 @@ Status legend: **Exists** (fully working) · **Partial** (works but with a real
|
||||
| Stripe webhook (checkout/cancel) | Exists | Signature-verified, replay-protected, event-deduped — production quality | `apps/web/app/api/webhooks/stripe/route.ts` |
|
||||
| Stripe checkout + self-serve billing portal (2026-07-23) | Exists | `POST /api/v1/billing/checkout` creates a subscription Checkout Session (promotion codes enabled); `POST /api/v1/billing/portal` opens Stripe's hosted Customer Portal for self-serve cancel/upgrade/card-update. Webhook route rewritten with the real `stripe` SDK (`stripe.webhooks.constructEvent`, replacing the hand-rolled HMAC verifier) and now handles the full event set: `checkout.session.completed`, `customer.subscription.{updated,deleted}`, `invoice.{payment_failed,paid}` — `past_due` deliberately doesn't downgrade tier (Stripe retries the card first). `/settings/billing` shows plan cards, usage, and a "Manage billing" button; `/admin/billing` shows connection status, subscriber counts, past-due list, recent billing audit events. Cancel/downgrade is at period end (Stripe Portal default); no trial period. **Not yet built:** family-group multi-user sharing (Family tier is purchasable solo, but the plan's per-account member invite/join/tier-resolution piece is deliberately deferred — see `plans/STRIPE_PLAN.md` §1a, flagged there as the most novel/error-prone piece, intentionally shipped after solo billing is proven). | `apps/web/lib/stripe.ts`, `apps/web/app/api/webhooks/stripe/route.ts`, `apps/web/app/api/v1/billing/**`, `apps/web/app/(app)/settings/billing/page.tsx`, `apps/web/app/admin/billing/page.tsx` |
|
||||
| Admin dashboard | Exists | 15 sections (was 13, missing Billing until this pass): overview, insights/analytics, users, invites, recipe moderation, reports, support, tier limits, **billing**, webhooks, audit logs, storage, AI config, site settings, changelog | `apps/web/app/admin/layout.tsx` (`adminNav`) |
|
||||
| Variations button lock-badge (closed 2026-07-24) | Exists | Was the one gated feature still shown disabled with a small lock-icon overlay + upgrade-dialog-on-click instead of hidden entirely; now hidden like every other gated feature, and the dead locked/`UpgradeDialog` code was removed from `VariationsButton`. | `apps/web/components/recipe/variations-button.tsx`, `apps/web/app/(app)/recipes/[id]/page.tsx` |
|
||||
| Feature flags (per-tier) vs feature prefs (per-user cosmetic) | Exists, two distinct systems | Flags now gate 9 capabilities by tier (was 3): recipe_variations/drink_pairing/meal_pairing (default enabled) plus recipe_import_url, recipe_import_photo, nutrition_estimation, markdown_export, weekly_nutrition, grocery_delivery (2026-07-24, default **disabled** for all tiers — admin turns on per tier from `/admin/tiers`). Each key's own `defaultEnabled` governs the fallback when no admin override row exists, not a blanket true. Prefs let users hide 7 nav sections, no billing implication, unrelated system. | `apps/web/lib/{feature-flags,feature-prefs}.ts` |
|
||||
| **Developer permission** (2026-07-22, split 2026-07-23) | Exists | Two separate, orthogonal permissions — not one. `users.isDeveloper` gates webhooks + self-serve API keys: admin-toggled always, *and* self-serve toggleable by the user themselves once on a paid tier (no added fee) via `PATCH /api/v1/users/me/developer-access`; free-tier users still need an admin grant. `users.isByokEnabled` gates BYOK separately, admin-only, no self-serve — routing real AI spend through Epicure on the user's own key warrants a manual check-in. Previously all three (webhooks/API keys/BYOK) shared one flag with zero self-serve path. Existing users with a webhook/API key were already grandfathered for `isDeveloper`; a second migration grandfathered existing BYOK users into `isByokEnabled` specifically. | `apps/web/lib/permissions.ts` (`hasDeveloperAccess`, `hasByokAccess`, `canSelfServeDeveloperAccess`), `apps/web/lib/api-auth.ts` (`requireDeveloper`, `requireByok`) |
|
||||
| User webhooks (personal automation) | Exists | 7 events, Zapier-style, requires developer access | `apps/web/lib/webhooks.ts` |
|
||||
|
||||
@@ -232,26 +232,27 @@ export default async function RecipePage({ params }: Params) {
|
||||
ingredients={recipe.ingredients.map((ing) => ({ rawName: ing.rawName }))}
|
||||
/>
|
||||
)}
|
||||
<VariationsButton
|
||||
recipeId={id}
|
||||
baseServings={recipe.baseServings}
|
||||
difficulty={recipe.difficulty}
|
||||
prepMins={recipe.prepMins}
|
||||
cookMins={recipe.cookMins}
|
||||
ingredients={recipe.ingredients.map((ing) => ({
|
||||
rawName: ing.rawName,
|
||||
quantity: ing.quantity,
|
||||
unit: ing.unit,
|
||||
note: ing.note,
|
||||
order: ing.order,
|
||||
}))}
|
||||
steps={recipe.steps.map((s) => ({
|
||||
instruction: s.instruction,
|
||||
timerSeconds: s.timerSeconds,
|
||||
order: s.order,
|
||||
}))}
|
||||
locked={locked.variations}
|
||||
/>
|
||||
{!locked.variations && (
|
||||
<VariationsButton
|
||||
recipeId={id}
|
||||
baseServings={recipe.baseServings}
|
||||
difficulty={recipe.difficulty}
|
||||
prepMins={recipe.prepMins}
|
||||
cookMins={recipe.cookMins}
|
||||
ingredients={recipe.ingredients.map((ing) => ({
|
||||
rawName: ing.rawName,
|
||||
quantity: ing.quantity,
|
||||
unit: ing.unit,
|
||||
note: ing.note,
|
||||
order: ing.order,
|
||||
}))}
|
||||
steps={recipe.steps.map((s) => ({
|
||||
instruction: s.instruction,
|
||||
timerSeconds: s.timerSeconds,
|
||||
order: s.order,
|
||||
}))}
|
||||
/>
|
||||
)}
|
||||
<ForkRecipeButton recipeId={id} variant={isOwner ? "duplicate" : "fork"} />
|
||||
<ShareRecipeButton recipeId={id} visibility={recipe.visibility} />
|
||||
<SaveOfflineButton recipeId={id} recipeTitle={recipe.title} />
|
||||
|
||||
@@ -48,7 +48,7 @@ export function FeatureFlagsForm({
|
||||
<div>
|
||||
<h2 className="font-semibold text-lg">Feature Toggles</h2>
|
||||
<p className="text-sm text-muted-foreground mt-1">
|
||||
Disable a feature for a tier to hide it for that tier's users (most features hide entirely; a few show a locked/upgrade state instead — see each feature's actual behavior in the app).
|
||||
Disable a feature for a tier to hide it entirely for that tier's users.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
|
||||
import { useState } from "react";
|
||||
import { useTranslations } from "next-intl";
|
||||
import { GitBranch, Lock } from "lucide-react";
|
||||
import { GitBranch } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
|
||||
import { VariationsDialog } from "./variations-dialog";
|
||||
import { UpgradeDialog } from "@/components/premium/upgrade-dialog";
|
||||
|
||||
export function VariationsButton({
|
||||
recipeId,
|
||||
@@ -16,7 +15,6 @@ export function VariationsButton({
|
||||
cookMins,
|
||||
ingredients,
|
||||
steps,
|
||||
locked = false,
|
||||
}: {
|
||||
recipeId: string;
|
||||
baseServings: number;
|
||||
@@ -25,26 +23,17 @@ export function VariationsButton({
|
||||
cookMins?: number | null;
|
||||
ingredients: Array<{ rawName: string; quantity?: string | number | null; unit?: string | null; note?: string | null; order: number }>;
|
||||
steps: Array<{ instruction: string; timerSeconds?: number | null; order: number }>;
|
||||
locked?: boolean;
|
||||
}) {
|
||||
const t = useTranslations("recipe");
|
||||
const [open, setOpen] = useState(false);
|
||||
const [upgradeOpen, setUpgradeOpen] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<TooltipProvider>
|
||||
<Tooltip>
|
||||
<TooltipTrigger render={
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
onClick={() => (locked ? setUpgradeOpen(true) : setOpen(true))}
|
||||
aria-label={t("variationsTooltip")}
|
||||
className="relative"
|
||||
>
|
||||
<Button variant="ghost" size="icon" onClick={() => setOpen(true)} aria-label={t("variationsTooltip")}>
|
||||
<GitBranch className="h-4 w-4" />
|
||||
{locked && <Lock className="h-2.5 w-2.5 absolute bottom-1 right-1 text-muted-foreground" />}
|
||||
</Button>
|
||||
} />
|
||||
<TooltipContent>{t("variationsTooltip")}</TooltipContent>
|
||||
@@ -61,12 +50,6 @@ export function VariationsButton({
|
||||
open={open}
|
||||
onOpenChange={setOpen}
|
||||
/>
|
||||
<UpgradeDialog
|
||||
open={upgradeOpen}
|
||||
onOpenChange={setUpgradeOpen}
|
||||
featureKey="recipe_variations"
|
||||
featureLabel="Recipe variations"
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Mirrors CHANGELOG.md at the repo root — update both together.
|
||||
export const APP_VERSION = "0.78.0";
|
||||
export const APP_VERSION = "0.78.1";
|
||||
|
||||
export type ChangelogEntry = {
|
||||
version: string;
|
||||
@@ -11,6 +11,13 @@ export type ChangelogEntry = {
|
||||
};
|
||||
|
||||
export const CHANGELOG: ChangelogEntry[] = [
|
||||
{
|
||||
version: "0.78.1",
|
||||
date: "2026-07-24 14:10",
|
||||
fixed: [
|
||||
"Recipe variations button was the one leftover spot still shown disabled with a small lock badge for tiers without the feature, instead of hidden entirely like every other gated feature. Now hidden, matching meal/drink pairings, nutrition estimation, and Markdown export.",
|
||||
],
|
||||
},
|
||||
{
|
||||
version: "0.78.0",
|
||||
date: "2026-07-24 13:40",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@epicure/web",
|
||||
"version": "0.78.0",
|
||||
"version": "0.78.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "epicure",
|
||||
"version": "0.78.0",
|
||||
"version": "0.78.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "pnpm --filter web dev",
|
||||
|
||||
Reference in New Issue
Block a user