Files
pad/internal/server
xarmian 873d351e24 feat(server): enrich collection share payload with settings, schema, item content (TASK-1678) (#680)
The public collection share-link resolver (`handleResolveShareLink`,
`collection` branch) previously returned only `{name, icon, description}`
plus a flat `{title, ref, fields}` per item. The public viewer at
`/s/{token}` therefore could not reproduce the owner's chosen view
type, grouping, field labels, or status colors, and had no body to
show for an inline read-only row expand.

Enrich the public collection DTO with:
- `collection.settings` — a presentation-only projection of
  CollectionSettings (`layout`, `default_view`, `board_group_by`,
  `list_sort_by`, `list_group_by`), emitted as a parsed JSON object.
  The authoring-only fields (`quick_actions`, `content_template`) are
  deliberately excluded from the public path.
- `collection.schema` — the parsed CollectionSchema object
  (`fields[]` with key/label/type/options/terminal_options/suffix),
  emitted as an object rather than a raw JSON string.
- `items[].content` — each item's markdown body, for the inline
  read-only row expand decided in TASK-1684.

Both settings and schema are parsed defensively: a malformed stored
JSON blob is simply omitted from the response rather than failing the
resolve. No internal IDs, creator info, workspace internals, or
timestamps are exposed. Adds an HTTP-level test asserting the enriched
shape and guarding against leakage of forbidden tokens.

Frontend integration (consuming this shape) is TASK-1680; security
review of the content exposure is tracked in TASK-1685.

Parent: PLAN-1677.
2026-05-31 00:58:59 -04:00
..