Skip to content

Commit b4235fb

Browse files
committed
feat(metrics): count toolbar button clicks
UI.toolbarBtn.terminal/appDrawer/extnMgr - one family so toolbar engagement groups together in analytics. The extension manager metric lives in ExtensionManagerDialog (the icon's live click handler), not in the feature-gated Phoenix-extension-store binding. Also picks up the regenerated Commands.md for the rebased view.enableAI command doc.
1 parent 3816cdd commit b4235fb

4 files changed

Lines changed: 14 additions & 2 deletions

File tree

docs/API-Reference/command/Commands.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,12 @@ Toggles problems panel visibility
542542
## VIEW\_TERMINAL
543543
Opens the terminal panel
544544

545+
**Kind**: global variable
546+
<a name="VIEW_ENABLE_AI"></a>
547+
548+
## VIEW\_ENABLE\_AI
549+
Toggles whether AI features are enabled
550+
545551
**Kind**: global variable
546552
<a name="TOGGLE_LINE_NUMBERS"></a>
547553

src/extensibility/ExtensionManagerDialog.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,10 @@ define(function (require, exports, module) {
432432
CommandManager.register(Strings.CMD_EXTENSION_MANAGER, Commands.FILE_EXTENSION_MANAGER, _showDialog, { supportsDesignMode: true });
433433

434434
AppInit.appReady(function () {
435-
$("#toolbar-extension-manager").click(_showDialog);
435+
$("#toolbar-extension-manager").click(function () {
436+
Metrics.countEvent(Metrics.EVENT_TYPE.UI, "toolbarBtn", "extnMgr");
437+
_showDialog();
438+
});
436439
});
437440

438441
// Unit tests

src/extensionsIntegrated/Terminal/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,7 @@ define(function (require, exports, module) {
889889
.insertBefore("#app-drawer-button");
890890

891891
$btn.on("click", function () {
892+
Metrics.countEvent(Metrics.EVENT_TYPE.UI, "toolbarBtn", "terminal");
892893
if (WorkspaceManager.isInDesignMode()) {
893894
CommandManager.execute(Commands.VIEW_TOGGLE_DESIGN_MODE);
894895
CommandManager.execute(CMD_VIEW_TERMINAL);

src/view/DefaultPanelView.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ define(function (require, exports, module) {
3131
CommandManager = require("command/CommandManager"),
3232
Strings = require("strings"),
3333
WorkspaceManager = require("view/WorkspaceManager"),
34-
PanelView = require("view/PanelView");
34+
PanelView = require("view/PanelView"),
35+
Metrics = require("utils/Metrics");
3536

3637
/**
3738
* Descriptors for each launcher button.
@@ -182,6 +183,7 @@ define(function (require, exports, module) {
182183
.attr("title", Strings.BOTTOM_PANEL_DEFAULT_TITLE);
183184

184185
$drawerBtn.on("click", function () {
186+
Metrics.countEvent(Metrics.EVENT_TYPE.UI, "toolbarBtn", "appDrawer");
185187
// Design mode collapses the editor and stretches live preview, which
186188
// leaves no room for the bottom tools panel. Exit design mode first
187189
// so the panel has somewhere to go.

0 commit comments

Comments
 (0)