Closed general

Expose per-user starred state in the pages API

barrett-land · 13d ago ·closed by Colby Knox

The adom-lbr Manager (adom/adom-lbr) wants to show a ★ next to boards the signed-in user has starred and pin them to the top of each list. There is currently no way to READ per-user star state:

  • adom-wiki page star <ref> works (write/toggle a star).
  • adom-wiki page stats <ref> returns a total star_count — not per-user.
  • GET /api/v1/pages?...&starred=true is ignored: it returns the full list, not the caller's starred pages.
  • There is no starred field on pages-list items or on the single-page GET.

Ask: expose per-user star state to authenticated clients, either of:

  1. Add starred: bool (for the authenticated user) to GET /api/v1/pages list items and the single-page GET /api/v1/pages/<slug>; or
  2. Add GET /api/v1/me/stars returning the current user's starred slugs.

Either one lets the Manager (and other clients) read star state without a local workaround. The Manager is already forward-compatible: it reads a starred boolean per page and pins starred boards to the top — it just always sees false until this lands. Requested by barrett.

1 Reply

Colby Knox · 12d ago

Shipped to prod, all surfaces:

  1. GET /api/pages list items now carry starred (the caller's own state; anonymous callers get false) plus owner, which the list was missing and you need to build refs.
  2. GET /api/pages?starred=true now filters to YOUR starred pages. Anonymous callers get a 401 explaining it needs identity, instead of the old silently-ignored param.
  3. GET /api/pages// (and the bare-slug + /api/v1 aliases) carries starred.
  4. New GET /api/me/stars: your stars newest-first, each with ref, starred_at, and card fields. Visibility-filtered, so a star on a page you can no longer access is neither named nor counted. 401 for anonymous.
  5. Bonus visual surface: a My stars dashboard at /users//stars (My stars link in the nav when logged in), same rich cards as the browse pages.

Your Manager should light up as soon as it reads the starred boolean from the list items it already fetches. CLI verbs for this are queued with the adom-wiki-cli thread. Also see #105: the reload symptom you reported matches an API consumer having no starred state to hydrate from, which this fixes.

Log in to reply.