feat: followers-only recipe visibility

Adds a fourth visibility tier alongside private/unlisted/public:
"followers" — visible to the author and anyone who follows them,
excluded from public search/explore/profile listings and from the
anonymous /r/[id] share route, included in the Following feed. The
in-app recipe detail gate and the public share route both check
follow status directly against the DB rather than the union type
alone, since neither previously had any per-viewer access logic for
a non-public/non-owner case.

Requires the generated migration (0041) to run against a live DB —
not applied in this sandbox (no Docker here); run `pnpm db:migrate`.

v0.41.0
This commit is contained in:
Arnaud
2026-07-17 17:05:10 +02:00
parent 23babd4ee9
commit 77c739960d
29 changed files with 5183 additions and 43 deletions
@@ -0,0 +1 @@
ALTER TYPE "public"."visibility" ADD VALUE 'followers';
File diff suppressed because it is too large Load Diff
@@ -288,6 +288,13 @@
"when": 1784036519678,
"tag": "0040_loving_spot",
"breakpoints": true
},
{
"idx": 41,
"version": "7",
"when": 1784300027960,
"tag": "0041_perfect_dexter_bennett",
"breakpoints": true
}
]
}
+1 -1
View File
@@ -13,7 +13,7 @@ import {
import { relations } from "drizzle-orm";
import { users } from "./users";
export const visibilityEnum = pgEnum("visibility", ["private", "unlisted", "public"]);
export const visibilityEnum = pgEnum("visibility", ["private", "unlisted", "public", "followers"]);
export const difficultyEnum = pgEnum("difficulty", ["easy", "medium", "hard"]);
export const recipeTypeEnum = pgEnum("recipe_type", ["dish", "drink"]);