Suggest subreddits when filling in an inventory entry, checked with Reddit

If the Subreddits box is empty, the AI suggests up to eight, by the
relationship, each with who is there. Each is looked up on Reddit (with
the app's client ID and secret) and left out if it doesn't exist, is
private, 18+, restricted or archived; the first five kept fill the box.
The form lists every suggestion with members, post types and why any was
left out. Lookups are cached for drafting. Without Reddit keys the
suggestions are kept and the form says they weren't checked.

The Reddit client now returns ErrNotFound and ErrForbidden, and treats an
empty about listing as not found.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-21 10:31:04 -07:00
co-authored by Claude Opus 5.5
parent 6f396d3ff6
commit d9b1467365
7 changed files with 233 additions and 22 deletions
+9
View File
@@ -349,3 +349,12 @@ form.inline { display: inline-block; margin: 0 0 0.75rem; }
.results .detail { display: block; color: hsl(var(--muted-foreground)); font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-page { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; max-width: 40rem; }
.search-page input { margin: 0; }
/* Subreddits suggested when filling in an inventory entry */
.suggestions { margin-top: 0.75rem; font-size: 0.92rem; }
.suggestions summary { cursor: pointer; font-weight: 600; }
.suggestions ul { list-style: none; padding: 0; margin: 0.5rem 0; }
.suggestions li { padding: 0.35rem 0; border-bottom: 1px solid hsl(var(--border)); display: flex; flex-wrap: wrap; gap: 0 0.6rem; align-items: baseline; }
.suggestions li:last-child { border-bottom: 0; }
.suggestions li .help { flex-basis: 100%; margin: 0; }
.suggestions li.dropped a { text-decoration: line-through; color: hsl(var(--muted-foreground)); }