feat(web): add Save & close to the props-mode page docheader #84

Merged
dominik.polakovics merged 1 commit from afk/82 into main 2026-07-18 00:02:55 +02:00

The page-properties mode of the page docheader (props=1) gains a second primary action: Save & close next to the existing Save.

  • Save is unchanged: submits and keeps the form open (save-and-keep-editing).
  • Save & close (props-save-close, primary, disabled under the same barSaveDisabled() condition) awaits SettingsSaveApi.save() and clears the props param only when it resolves true. On a 422 or client-side validation failure the form stays open with the existing inline field errors — no navigation.
  • Close and the unsaved-changes guard are untouched. The success path never trips the guard because a successful save resets the form's dirty baseline, so no extra wiring was needed.

Tests

Extended Docheader.test.tsx props-mode block:

  • props-save-close present in the deep-link assertions.
  • Success path: save endpoint called once, settings form unmounts, search cleared, unsaved-changes dialog never appears.
  • 422 path: inline field-error-title shown, form stays mounted, props=1 retained.

Verified: full web suite 775/775 green, tsc --noEmit clean, vite build ok, go build ./... and go test ./... all green.

Closes #82

🤖 Generated with Claude Code

The page-properties mode of the page docheader (`props=1`) gains a second primary action: **Save & close** next to the existing **Save**. - **Save** is unchanged: submits and keeps the form open (save-and-keep-editing). - **Save & close** (`props-save-close`, primary, disabled under the same `barSaveDisabled()` condition) awaits `SettingsSaveApi.save()` and clears the `props` param only when it resolves `true`. On a 422 or client-side validation failure the form stays open with the existing inline field errors — no navigation. - Close and the unsaved-changes guard are untouched. The success path never trips the guard because a successful save resets the form's dirty baseline, so no extra wiring was needed. ## Tests Extended `Docheader.test.tsx` props-mode block: - `props-save-close` present in the deep-link assertions. - Success path: save endpoint called once, settings form unmounts, search cleared, unsaved-changes dialog never appears. - 422 path: inline `field-error-title` shown, form stays mounted, `props=1` retained. Verified: full web suite 775/775 green, `tsc --noEmit` clean, `vite build` ok, `go build ./...` and `go test ./...` all green. Closes #82 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(web): add Save & close to the props-mode page docheader
All checks were successful
ci / build-and-test (pull_request) Successful in 6m41s
7113d2879a
The page-properties docheader gains a second primary action next to
Save: Save & close submits the settings form and, on a successful save,
returns to page content by clearing the props param. A 422 or
client-side validation failure leaves the form open with its inline
field errors, exactly like plain Save. Close and its unsaved-changes
guard are untouched; the success path never trips the guard because a
successful save resets the form's dirty baseline.

Closes #82

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Author
Owner

This was generated by AI while landing a PR.

Landing audit — PR #84

Verdict: PASS

Check Result
CI (ci / build-and-test) success (6m41s) — full go + web suite; relied on, not re-run
Title convention feat(web): … Conventional Commits
AFK contract head afk/82, body carries Closes #82
Merge conflict none — 1 commit ahead of main, 0 behind
Diff vs issue #82 matches all acceptance criteria

Review notes:

  • props-save-close button added, primary, disabled under the same barSaveDisabled() as Save; awaits settingsApi()?.save() and clears props only on a true resolve.
  • 422 / client-validation failure leaves the form open with inline errors — no navigation. Plain Save and the unsaved-changes guard on Close are untouched.
  • Tests extend the Docheader.test.tsx props-mode block with the save-then-close success path and the 422 stay-open path; deep-link assertion includes props-save-close.

Awaiting free-text merge confirmation.

> *This was generated by AI while landing a PR.* ## Landing audit — PR #84 **Verdict: PASS** | Check | Result | | --- | --- | | CI (`ci / build-and-test`) | ✅ success (6m41s) — full go + web suite; relied on, not re-run | | Title convention | ✅ `feat(web): …` Conventional Commits | | AFK contract | ✅ head `afk/82`, body carries `Closes #82` | | Merge conflict | ✅ none — 1 commit ahead of `main`, 0 behind | | Diff vs issue #82 | ✅ matches all acceptance criteria | **Review notes:** - `props-save-close` button added, `primary`, disabled under the same `barSaveDisabled()` as Save; awaits `settingsApi()?.save()` and clears `props` only on a `true` resolve. - 422 / client-validation failure leaves the form open with inline errors — no navigation. Plain Save and the unsaved-changes guard on Close are untouched. - Tests extend the `Docheader.test.tsx` props-mode block with the save-then-close success path and the 422 stay-open path; deep-link assertion includes `props-save-close`. Awaiting free-text merge confirmation.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Cloonar/deckle!84
No description provided.