Skip to content

Commit 8bfc638

Browse files
committed
make all use loadpath not add button
1 parent b0870ff commit 8bfc638

6 files changed

Lines changed: 15 additions & 9 deletions

File tree

src/processors/applePanelsProcessor.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,8 @@ class ApplePanelsProcessor extends BaseProcessor {
366366
fontWeight: btn.DisplayImageWeight === 'bold' ? 'bold' : 'normal',
367367
},
368368
});
369-
page.addButton(button);
369+
// Load path: do not record as a user mutation
370+
page._loadButton(button);
370371

371372
if (btn.Rect) {
372373
const rect = this.parseRect(btn.Rect);

src/processors/astericsGridProcessor.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,8 @@ class AstericsGridProcessor extends BaseProcessor {
917917
colorConfig,
918918
activeColorSchemeDefinition
919919
);
920-
page.addButton(button);
920+
// Load path: do not record as a user mutation
921+
page._loadButton(button);
921922

922923
const buttonX = element.x || 0;
923924
const buttonY = element.y || 0;

src/processors/dotProcessor.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@ class DotProcessor extends BaseProcessor {
166166
tree.addPage(page);
167167

168168
// Add a self button so single-node graphs yield one button
169-
page.addButton(
169+
// Load path: do not record as a user mutation
170+
page._loadButton(
170171
new AACButton({
171172
id: `${node.id}_self`,
172173
label: node.label,
@@ -191,7 +192,8 @@ class DotProcessor extends BaseProcessor {
191192

192193
targetPageId: edge.to,
193194
});
194-
fromPage.addButton(button);
195+
// Load path: do not record as a user mutation
196+
fromPage._loadButton(button);
195197
}
196198
}
197199

src/processors/opmlProcessor.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ class OpmlProcessor extends BaseProcessor {
7878
message: '',
7979
targetPageId: childText.replace(/[^a-zA-Z0-9]/g, '_'),
8080
});
81-
page.addButton(button);
81+
// Load path: do not record as a user mutation
82+
page._loadButton(button);
8283

8384
const { page: childPage, childPages: grandChildren } = this.processOutline(
8485
child,

src/processors/snapProcessor.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,8 @@ class SnapProcessor extends BaseProcessor {
705705
// Add to the intended parent page
706706
const parentPage = tree.getPage(parentUniqueId);
707707
if (parentPage) {
708-
parentPage.addButton(button);
708+
// Load path: do not record as a user mutation
709+
parentPage._loadButton(button);
709710

710711
// Add button to grid layout if position data is available
711712
const gridPositionStr = String(btnRow.GridPosition || '');

src/processors/touchchatProcessor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,8 @@ class TouchChatProcessor extends BaseProcessor {
406406
button.x = absoluteX;
407407
button.y = absoluteY;
408408

409-
// Add button to page
410-
page.addButton(button);
409+
// Add button to page (load path: do not record as a user mutation)
410+
page._loadButton(button);
411411

412412
// Place button in grid (handle span)
413413
for (let r = absoluteY; r < absoluteY + safeSpanY && r < 10; r++) {
@@ -518,7 +518,7 @@ class TouchChatProcessor extends BaseProcessor {
518518
const page = Object.values(tree.pages).find(
519519
(p) => p.id === (numericToRid.get(btnRow.id) || String(btnRow.id))
520520
);
521-
if (page) page.addButton(button);
521+
if (page) page._loadButton(button); // load path: do not record as a user mutation
522522
});
523523
} catch (_e) {
524524
// console.log('No direct page buttons found:', e);

0 commit comments

Comments
 (0)