fix: compact mode toggle updates instantly without restart

Toggle label visibility instead of rebuilding panel children.
Label always added to panel, just hidden when compact=true.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
thameem-abbas 2026-05-04 09:46:21 -04:00
parent 30b3ad0503
commit 87e45f43df

View file

@ -77,9 +77,8 @@ class CodeBurnIndicator extends PanelMenu.Button {
});
box.add_child(this._panelIcon);
if (!this._settings.get_boolean('compact-mode'))
box.add_child(this._panelLabel);
box.add_child(this._panelLabel);
this._panelLabel.visible = !this._settings.get_boolean('compact-mode');
this.add_child(box);
}
@ -180,8 +179,8 @@ class CodeBurnIndicator extends PanelMenu.Button {
}
_rebuildPanelButton() {
this.remove_all_children();
this._buildPanelButton();
const compact = this._settings.get_boolean('compact-mode');
this._panelLabel.visible = !compact;
this._updatePanel(this._lastPayload);
}