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

+43
View File
@@ -334,3 +334,46 @@ func TestPlaces(t *testing.T) {
}
check("close gaps", "D,H,A,F,B,G")
}
func TestVisibility(t *testing.T) {
ctx := context.Background()
s := newTestStore(t)
// Old clients send only the visible flag.
pub, err := s.CreateList(ctx, List{Title: "Pub", Category: "movie", MaxItems: 5, Visible: true})
if err != nil {
t.Fatal(err)
}
if pub.Visibility != VisibilityPublic || !pub.Visible || pub.ShareToken == "" {
t.Fatalf("public: %+v", pub)
}
un, err := s.CreateList(ctx, List{Title: "Un", Category: "movie", MaxItems: 5, Visibility: VisibilityUnlisted})
if err != nil {
t.Fatal(err)
}
if un.Visible || un.SharePath() != "/s/"+un.ShareToken || un.ShareToken == pub.ShareToken {
t.Fatalf("unlisted: %+v", un)
}
if _, err := s.CreateList(ctx, List{Title: "X", Category: "movie", MaxItems: 5, Visibility: "secret"}); err == nil {
t.Fatal("bad visibility accepted")
}
got, err := s.ListByShareToken(ctx, un.ShareToken)
if err != nil || got.ID != un.ID {
t.Fatalf("by token: %v %+v", err, got)
}
lists, _ := s.Lists(ctx, false)
if len(lists) != 1 || lists[0].ID != pub.ID {
t.Fatalf("home lists: %+v", lists)
}
old := un.ShareToken
un, err = s.ResetShareToken(ctx, un.ID)
if err != nil || un.ShareToken == old {
t.Fatalf("reset: %v %q", err, un.ShareToken)
}
if _, err := s.ListByShareToken(ctx, old); err != ErrNotFound {
t.Fatalf("old token still works: %v", err)
}
un.Visibility = VisibilityPrivate
if un, err = s.UpdateList(ctx, un); err != nil || un.SharePath() != "" {
t.Fatalf("private: %v %+v", err, un)
}
}