The Preview button posted the draft the operator was editing and the handler
threw it away — it loaded the group from the store and assembled that. Tighten
a regex, press Preview, and the answer came back byte-identical (and, after the
first call, from cache in under a millisecond), so the button looked dead.
Reproduced in the panel: a filter dropping five countries left all 32 nodes on
screen, unchanged.
- POST /api/groups/{id}/preview now overlays the posted body on the stored
group before assembling. The body stays optional, so an empty request still
means "preview exactly what is stored", and identity fields (id, token,
created_at) keep their stored values whatever the body claims. Nothing is
written: previewing must not be a side effect.
- New POST /api/groups/preview previews a group that does not exist yet. The
editor used to SAVE an unsaved group just to get an id to preview it, which
left a half-made group behind whenever someone pressed Preview to look
around and then cancelled.
Covered by two tests: the draft filter must change the result and must not be
persisted, and previewing a draft must create no group.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>