Fix export block ordering, stale per-step UI, and cross-step block loss
Exporters now interleave text/code/table blocks in the same order they appear in the editor's Blocks panel (via a shared stepContentGroups helper) instead of grouping by kind, so exported docs match the guide editor's ordering. selectStep() now also refreshes the Focused View controls and Blocks panel (previously only done by renderAll), so switching steps no longer leaves the previous step's blocks/focused-view sliders on screen. It also flushes any pending edits on the outgoing step before switching, so a later guide-wide reload (e.g. applying an annotation style to the whole guide) can't discard unsaved text-block edits on other steps.
This commit is contained in:
@@ -1281,13 +1281,19 @@ class GuideEditor {
|
||||
|
||||
async selectStep(stepId) {
|
||||
if (!this.stepMap.has(stepId)) return;
|
||||
// Persist any unsaved edits on the outgoing step before switching, so a
|
||||
// later guide-wide reload (e.g. applyStyleAcross('guide')) doesn't
|
||||
// discard them by re-fetching a stale on-disk copy.
|
||||
if (this.pendingSave) await this.flushStep();
|
||||
this.selectedStepId = stepId;
|
||||
this.selectedAnnotationId = null;
|
||||
this.canvas.select(null);
|
||||
this.syncStepFields();
|
||||
this.syncFocusedControls();
|
||||
this.renderStepList();
|
||||
this.renderCanvas();
|
||||
this.renderAnnotationPanel();
|
||||
this.renderBlocksPanel();
|
||||
this.emitMeta();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user