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:
1 parent
268af7b9ed
commit
87e3d1fb30
16 files changed
+292
-28
No files matched your search
@@ -1,5 +1,6 @@
|
||||
// Admin dashboard: all lists, their order, create/edit/delete.
|
||||
import { h, icon, api, readBoot, toast, confirmDialog, fmt } from "./common.js";
|
||||
import { shareDialog, VISIBILITY, visibilityOf } from "./share.js";
|
||||
import { sortable } from "./sortable.js";
|
||||
import { openListForm } from "./list-form.js";
|
||||
|
||||
@@ -67,12 +68,14 @@ function card(list) {
|
||||
h("span", { "aria-hidden": "true" }, "·"),
|
||||
h("span", {}, `${fmt.format(list.itemCount)} / ${fmt.format(list.maxItems)}`),
|
||||
h("span", { class: "list-card-bar", "aria-hidden": "true" }, h("span", { style: { width: pct + "%" } })),
|
||||
!list.visible && h("span", { class: "badge badge--muted" }, icon("eye-off"), "Hidden"),
|
||||
visibilityOf(list) !== "public" && h("span", { class: "badge badge--muted" }, icon(VISIBILITY[visibilityOf(list)].icon), VISIBILITY[visibilityOf(list)].label),
|
||||
),
|
||||
),
|
||||
),
|
||||
h("div", { class: "list-card-actions" },
|
||||
h("a", { class: "icon-btn", href: `/l/${list.slug}`, title: "View public page", "aria-label": "View public page" }, icon("external")),
|
||||
h("a", { class: "icon-btn", href: `/l/${list.slug}`, title: "View page", "aria-label": "View page" }, icon("external")),
|
||||
h("button", { type: "button", class: "icon-btn", title: "Share", "aria-label": `Share ${list.title}`,
|
||||
onclick: () => shareDialog(list, { onChange: (saved) => { lists = lists.map((l) => (l.id === saved.id ? saved : l)); render(); } }) }, icon("link")),
|
||||
h("button", { type: "button", class: "icon-btn", title: "List settings", "aria-label": "List settings", onclick: () => editList(list) }, icon("settings")),
|
||||
h("button", { type: "button", class: "icon-btn icon-btn--danger", title: "Delete", "aria-label": "Delete list", onclick: () => deleteList(list) }, icon("trash")),
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user