Skip to content

Commit 92f92a5

Browse files
committed
feat: remove snippets count tracking from the title
1 parent cc6189c commit 92f92a5

3 files changed

Lines changed: 8 additions & 35 deletions

File tree

src/extensionsIntegrated/CustomSnippets/UIHelper.js

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
/* eslint-disable no-invalid-this */
2222
define(function (require, exports, module) {
2323
const StringUtils = require("utils/StringUtils");
24-
const Global = require("./global");
2524
const Strings = require("strings");
2625

2726
/** @type {Object} Reference to the panel instance, set via init() */
@@ -150,7 +149,9 @@ define(function (require, exports, module) {
150149
$addNewSnippetBtn.removeClass("hidden");
151150
$filterSnippetsPanel.removeClass("hidden");
152151

153-
_updateListTabTitle();
152+
if (_panel) {
153+
_panel.setTitle(Strings.CUSTOM_SNIPPETS_PANEL_TITLE);
154+
}
154155

155156
$("#filter-snippets-input").val("");
156157
}
@@ -211,24 +212,13 @@ define(function (require, exports, module) {
211212
}
212213

213214
/**
214-
* Updates the tab title to show the list view format: "Custom Snippets (N)"
215-
* @private
216-
*/
217-
function _updateListTabTitle() {
218-
if (!_panel) {
219-
return;
220-
}
221-
const snippetCount = Global.SnippetHintsList.length;
222-
const countText = snippetCount > 0 ? ` (${snippetCount})` : "";
223-
_panel.setTitle(Strings.CUSTOM_SNIPPETS_PANEL_TITLE + countText);
224-
}
225-
226-
/**
227-
* Initializes the tab title for the list view.
228-
* This is called when the panel is first opened to ensure the snippet count is displayed.
215+
* Resets the tab title back to the default list view title.
216+
* Called when the panel is first opened or toggled visible.
229217
*/
230218
function initializeListViewToolbarTitle() {
231-
_updateListTabTitle();
219+
if (_panel) {
220+
_panel.setTitle(Strings.CUSTOM_SNIPPETS_PANEL_TITLE);
221+
}
232222
}
233223

234224
/**

src/extensionsIntegrated/CustomSnippets/helper.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -569,20 +569,6 @@ define(function (require, exports, module) {
569569
$("#edit-file-extn-box").val("");
570570
}
571571

572-
/**
573-
* Updates the snippets count which is displayed in the toolbar at the left side
574-
* @private
575-
*/
576-
function updateSnippetsCount() {
577-
const count = Global.SnippetHintsList.length;
578-
const $countSpan = $("#snippets-count");
579-
if (count > 0) {
580-
$countSpan.text(`(${count})`);
581-
} else {
582-
$countSpan.text("");
583-
}
584-
}
585-
586572
/**
587573
* validates and sanitizes file extension input
588574
*
@@ -932,7 +918,6 @@ define(function (require, exports, module) {
932918
exports.isSnippetSupportedInFile = isSnippetSupportedInFile;
933919
exports.hasExactMatchingSnippet = hasExactMatchingSnippet;
934920
exports.getMatchingSnippets = getMatchingSnippets;
935-
exports.updateSnippetsCount = updateSnippetsCount;
936921
exports.sanitizeFileExtensionInput = sanitizeFileExtensionInput;
937922
exports.handleFileExtensionInput = handleFileExtensionInput;
938923
exports.handleFileExtensionKeypress = handleFileExtensionKeypress;

src/extensionsIntegrated/CustomSnippets/snippetsList.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,6 @@ define(function (require, exports, module) {
180180
console.error("failed to delete custom snippet correctly:", error);
181181
});
182182

183-
// update the snippets count in toolbar
184-
Helper.updateSnippetsCount();
185183
// Refresh the entire list to properly handle filtering
186184
showSnippetsList();
187185
}

0 commit comments

Comments
 (0)