Repository navigation
Show when the editor saves, and keep a change through a quick reload - #267
Conversation
…gh a quick reload Editor saves now run through one helper in the notice store. It knows which saves wait or run, keeps a failed save to send again, and names the question by number and text. The workbench shows Saving…, Saved and Not saved with Retry; the red bar gets Retry and wraps. Leaving the page sends waiting saves and asks while a save waits, runs or failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PhilReinking
left a comment
There was a problem hiding this comment.
OK at 05f1987, CI green.
The new tests fail on main. Beyond the PR text: typing keeps the status on Saving… without a new announcement per key, a newer save of the same question drops the older Retry, several failures share one bar and one Retry, and Settings pages show no Retry they can't use. One should inline.
| this.notice.$patch((state) => { | ||
| state.failedSaves = {}; | ||
| state.retries = {}; | ||
| }); |
There was a problem hiding this comment.
Closing the red bar forgets the failed save: "Not saved" and Retry go away, and the browser no longer asks before a reload, although the change is still not on the server. Could closing only hide the bar and keep the failure for the status and the leave prompt?
…nd the leave prompt Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An XHR started in pagehide can be dropped, for example by mobile Safari. A save over keepalive's 64 KB limit goes the usual way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PhilReinking
left a comment
There was a problem hiding this comment.
OK at dabdd5a, CI green.
Both fixes hold, and the 5 new tests fail on 05f1987. Beyond the PR text: in axios 1.20 the fetch adapter sends the session cookie (withCredentials gives credentials "include") and the X-XSRF-TOKEN header like the XHR path. A failed save sent at page leave keeps Retry, and a retry then works as usual.
…cus ring Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PhilReinking
left a comment
There was a problem hiding this comment.
OK at 4ace217, CI green. I checked only the new commit.
The new test fails with the old Banner.vue and passes now. On a phone, a failed save without Retry (Settings) can be closed again. A failed save with Retry still hides the close button. The Retry button and the close button now use the same check.
Brings in the delete dialogs (#269) and the save status (#267). Conflicts: the old Workbench, Sidebar Block and Group stay deleted. Choice and policy rows keep their in-row delete button, which now asks first through useDeleteChoice; the list still does the delete so it can move focus once the row is gone (useDeleteChoice takes that delete). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # CHANGELOG.md # resources/js/Pages/Forms/Edit.vue
# Conflicts: # CHANGELOG.md
The editor now shows "Saving…", "Saved" or "Not saved" with Retry. A failed save names the question in the red bar and offers Retry there too. A reload right after typing sends the waiting save first, and the browser asks before leaving while a save waits or failed.
Fixes BITS-280
save-statusslot from Give the editor pages one top bar #265 lands.lgit can't be closed while it offers Retry: the status is off-screen there.Heads-up: editor save errors now name the question by number and text instead of an ID.
Tested: Vitest, lint, vue-tsc, build; the new tests fail on main. By hand at 1440 and 390: typing, a forced 500, Retry, quick reload, leaving after a failure.
Not tested: Safari and Firefox, including mobile Safari's keepalive save.
Known gap: the public form's
useBeforeUnloadnever adds its listener (own ticket).🤖 Generated with Claude Code