File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -487,6 +487,22 @@ export class AACPage {
487487 this . _pendingMutations . push ( { type : 'addButton' , button } ) ;
488488 }
489489
490+ /**
491+ * Internal load-path button push: adds a button to the page WITHOUT recording a mutation.
492+ * Used by processors during loadIntoTree so the loaded baseline isn't treated as user changes.
493+ * Not part of the public API — consumers should always use addButton.
494+ */
495+ _loadButton ( button : AACButton ) : void {
496+ this . buttons . push ( button ) ;
497+
498+ /**
499+ * Discard all recorded mutations on this page.
500+ * Useful as an escape hatch after loadIntoTree if the consumer wants a clean baseline.
501+ */
502+ clearMutations ( ) : void {
503+ this . _pendingMutations = [ ] ;
504+ }
505+
490506 /**
491507 * Get the list of pending mutations for this page (read-only)
492508 */
Original file line number Diff line number Diff line change @@ -1749,8 +1749,8 @@ class GridsetProcessor extends BaseProcessor {
17491749 } ,
17501750 } ) ;
17511751
1752- // Add button to page
1753- page . addButton ( button ) ;
1752+ // Add button to page (load path: do not record as a user mutation)
1753+ page . _loadButton ( button ) ;
17541754
17551755 // Place button in grid layout (handle colspan/rowspan)
17561756 for ( let r = cellY ; r < cellY + rowSpan && r < maxRows ; r ++ ) {
You can’t perform that action at this time.
0 commit comments