Enhancement: Safe Auto-Save Before Publish in Page Management Dialog #38
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🚀 Enhancement: Safe Auto-Save Before Publish in Page Management Dialog
Summary
This PR introduces a critical UX improvement to the Plugin Studio's Page Management Dialog by ensuring that pages are auto-saved before publishing. It also adds real-time feedback to users, preventing unintentional publishing of stale or unsaved data. This change affects both the dialog behavior and toolbar layout, and addresses reliability and workflow clarity.
✅ Key Changes
🧠 PageManagementDialog (
PageManagementDialog.tsx)Auto-Save on Publish
When a user clicks "Publish" for the current working page, the dialog:
User Feedback
"Saving before publish..."during the process🧩 Adapter Improvements (
PageManagementDialogAdapter.tsx)Wrapped
publishPage()in logic to:savePage()for the current page before publishingAdded console tracing to improve debuggability
🧰 GridToolbar (
GridToolbar.tsx)Toolbar Simplification
PageSelectoroutside conditional blocks so it’s always rendered, even when no page existsPageSelector)"Use the + button to create a new page")🛠 usePages Hook Fix
currentPage.layoutsandcurrentPage.modulesto avoid reference errors when saving.🔁 PluginStudioAdapter Refactor
Fixed potential infinite render loop caused by module state comparison:
isUpdatingModulesRefsafeguard flag to prevent recursionconvertedPageDatafromuseEffectdependency array🧪 Benefits