Visibility phase 1: add site_members value + 4-option dropdown
First step of the public-viewing feature (design: docs/design/tree-visibility.md). No non-member behavior change yet — this only widens the vocabulary and UI. - TreeVisibility gains `site_members` (any authenticated user of the instance), giving the four-level model: public / site_members / unlisted / private. - Alembic migration adds the enum value via an autocommit block (ALTER TYPE ADD VALUE can't run in a transaction on older Postgres); downgrade is a no-op since PG can't drop an enum value. - Regenerated openapi.json + frontend TS client. - Trees-list dropdown now offers Private / Public – Members / Unlisted / Public with an explanatory tooltip. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Justin Paul <justin@jpaul.me>
This commit is contained in:
@@ -95,10 +95,17 @@ export default function TreesPage() {
|
||||
setVisibility(tree.id, e.target.value as NonNullable<Tree["visibility"]>)
|
||||
}
|
||||
aria-label="Tree visibility"
|
||||
title="Who can see this tree. Living people stay protected even when public."
|
||||
title={
|
||||
"Who can see this tree (living people stay protected regardless):\n" +
|
||||
"• Private — only you and people you invite\n" +
|
||||
"• Members — any signed-in user on this site\n" +
|
||||
"• Unlisted — anyone with the link (not listed or indexed)\n" +
|
||||
"• Public — anyone on the web; listed and search-indexable"
|
||||
}
|
||||
className="rounded-md border border-[var(--border)] bg-[var(--surface)] px-2 py-1 text-xs uppercase tracking-wide text-bronze focus-visible:border-bronze focus-visible:outline-none"
|
||||
>
|
||||
<option value="private">Private</option>
|
||||
<option value="site_members">Public – Members</option>
|
||||
<option value="unlisted">Unlisted</option>
|
||||
<option value="public">Public</option>
|
||||
</select>
|
||||
|
||||
Vendored
+1
-1
@@ -1534,7 +1534,7 @@ export interface components {
|
||||
* TreeVisibility
|
||||
* @enum {string}
|
||||
*/
|
||||
TreeVisibility: "public" | "unlisted" | "private";
|
||||
TreeVisibility: "public" | "site_members" | "unlisted" | "private";
|
||||
/** UserRead */
|
||||
UserRead: {
|
||||
/**
|
||||
|
||||
@@ -5552,6 +5552,7 @@
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"public",
|
||||
"site_members",
|
||||
"unlisted",
|
||||
"private"
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user