fix(main-updated): refresh section DOM on accept even without the debug panel
The changes-accepted handler was registered only when debugPanel existed, so with debug off an accepted edit updated the model but never re-rendered. Found by a headless-browser edit smoke test through markitect md-render. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Assistant: claude-code Assistant-Model: sonnet Assistant-Process: 299063@bnt-lap001 Assistant-Session: 53eb1e1c-c13a-4277-9ce2-3702960d93f7
This commit is contained in:
parent
172660c7fe
commit
4fe036a338
1 changed files with 10 additions and 5 deletions
|
|
@ -189,6 +189,16 @@ const MarkitectMain = {
|
|||
});
|
||||
|
||||
// Setup section manager event handlers
|
||||
if (this.sectionManager) {
|
||||
// The DOM refresh must not depend on the optional debug panel.
|
||||
this.sectionManager.on('changes-accepted', (data) => {
|
||||
if (this.debugPanel) {
|
||||
this.debugPanel.addMessage(`Changes accepted for section: ${data.sectionId}`, 'SUCCESS');
|
||||
}
|
||||
this.updateSectionDOM(data.sectionId);
|
||||
});
|
||||
}
|
||||
|
||||
if (this.sectionManager && this.debugPanel) {
|
||||
this.sectionManager.on('sections-created', (data) => {
|
||||
this.debugPanel.addMessage(`Created ${data.count} sections`, 'INFO');
|
||||
|
|
@ -198,11 +208,6 @@ const MarkitectMain = {
|
|||
this.debugPanel.addMessage(`Edit started for section: ${data.sectionId}`, 'DEBUG');
|
||||
});
|
||||
|
||||
this.sectionManager.on('changes-accepted', (data) => {
|
||||
this.debugPanel.addMessage(`Changes accepted for section: ${data.sectionId}`, 'SUCCESS');
|
||||
this.updateSectionDOM(data.sectionId);
|
||||
});
|
||||
|
||||
this.sectionManager.on('changes-cancelled', (data) => {
|
||||
this.debugPanel.addMessage(`Changes cancelled for section: ${data.sectionId}`, 'WARNING');
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue