Wrap list chips, add list sharing and public/unlisted/private visibility

- Home page list chips wrap to new rows instead of scrolling off the edge
- Lists are public, unlisted or private (migrated from the visible flag)
- Unlisted lists are reachable only at /s/<token>; slug URLs are public-only
- Share button on list pages and in the editor/dashboard; owners can reset an unlisted link

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
cdnutterandClaude Opus 5.5 committed 2026-11-19 09:51:16 -08:00
1 parent 268af7b9ed
commit 87e3d1fb30
16 files changed
+292 -28

No files matched your search

+13 -3
View File
@@ -1,5 +1,6 @@
// Create / edit list dialog, shared by the dashboard and the list editor.
import { h, icon, api, openDialog, dialogHead, busy, fmt } from "./common.js";
import { VISIBILITY, visibilityOf } from "./share.js";
const SIZE_PRESETS = [5, 10, 25, 50, 100];
@@ -91,7 +92,16 @@ export function openListForm({ categories, limits, styles, list, category, onSav
h("label", {}, h("input", { type: "radio", name: "art", value: "square", checked: art === "square" }), "Square (logos, covers)"),
h("label", {}, h("input", { type: "radio", name: "art", value: "poster", checked: art === "poster" }), "Tall (posters, photos)"),
));
const visible = h("input", { type: "checkbox", name: "visible", checked: list ? list.visible : true });
const vis = list ? visibilityOf(list) : "public";
const visHint = h("span", { class: "field-hint" }, VISIBILITY[vis].hint);
const visField = h("div", { class: "field" },
h("span", { class: "field-label" }, "Who can see it"),
h("div", { class: "radio-cards", role: "radiogroup", "aria-label": "Who can see it" },
Object.entries(VISIBILITY).map(([key, o]) => h("label", {},
h("input", { type: "radio", name: "visibility", value: key, checked: vis === key,
onchange: () => { visHint.textContent = o.hint; } }),
icon(o.icon), o.label))),
visHint);
const error = h("p", { class: "alert alert--error", role: "alert", hidden: true });
const save = h("button", { type: "submit", class: "btn btn--primary" }, editing ? "Save changes" : "Create list");
@@ -110,7 +120,7 @@ export function openListForm({ categories, limits, styles, list, category, onSav
h("div", { class: "field" }, h("span", { class: "field-label" }, "Style"), layoutGroup,
h("span", { class: "field-hint" }, "How the list looks on your page. Visitors can switch styles on the list's own page.")),
artField,
h("label", { class: "check" }, visible, "Show this list on my public page"),
visField,
error,
),
h("div", { class: "dialog-foot" },
@@ -140,7 +150,7 @@ export function openListForm({ categories, limits, styles, list, category, onSav
maxItems: n,
description: desc.value,
layout: form.querySelector("input[name=layout]:checked").value,
visible: visible.checked,
visibility: form.querySelector("input[name=visibility]:checked").value,
art: isCustom() ? form.querySelector("input[name=art]:checked").value : "",
};
if (editing) body.slug = slug.value;