Skip to content

Show when the editor saves, and keep a change through a quick reload - #267

Merged
PhilReinking merged 9 commits into
mainfrom
fix/bits-280-save-status
Oct 13, 2026
Merged

PhilReinking merged 9 commits into
mainfrom
fix/bits-280-save-status

Conversation

@PhilReinking

@PhilReinking PhilReinking commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Every editor save runs through one store action that tracks it and keeps the request for Retry. Settings pages keep their Save buttons.
  • The status sits in the workbench until the top bar's save-status slot from Give the editor pages one top bar #265 lands.
  • Saves waiting at page leave go out with fetch keepalive, so a phone doesn't drop them. Closing the red bar only hides it. Below lg it 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 useBeforeUnload never adds its listener (own ticket).

🤖 Generated with Claude Code

PhilReinking and others added 2 commits October 13, 2026 01:06
…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 PhilReinking left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread resources/js/Jetstream/Banner.vue Outdated
Comment on lines +137 to +140
this.notice.$patch((state) => {
state.failedSaves = {};
state.retries = {};
});

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

PhilReinking and others added 2 commits October 13, 2026 01:38
…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 PhilReinking left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

PhilReinking and others added 2 commits October 13, 2026 02:02
…cus ring

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@PhilReinking PhilReinking left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK at f6f8f54, CI green. Both new commits hold.

The new phone test fails on dabdd5a, the other is a guard. The built app CSS has max-lg:hidden under .ipt below 1024 px, after the flex rule, so the button really hides on phones while a save failed and stays on other banners.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@PhilReinking PhilReinking left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

PhilReinking added a commit that referenced this pull request Oct 13, 2026
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>

@PhilReinking PhilReinking left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK at 1e2d0c0, CI green. Both merges of main change only CHANGELOG.md and the imports in Edit.vue by hand: useSaveOnLeave, D9Skeleton and ref are all kept and used. The PR's own lines against main are the reviewed ones from 4ace217, and every changelog line stays.

@PhilReinking
PhilReinking merged commit cde128f into main Oct 13, 2026
6 checks passed
@PhilReinking
PhilReinking deleted the fix/bits-280-save-status branch October 13, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant