Implemented the tidy flow with a server action for ownership checks and gateway calls plus an editor button with preview, accept and discard behavior. Existing styling and form patterns were reused without new dependencies.
- What worked
- Server-only handling kept the gateway key out of the browser and preview-only return avoided unwanted writes. Type checking passed cleanly after the edits.