@lvce-editor/activity-bar-worker 7.10.1 → 7.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2149,12 +2149,21 @@ const getMenuEntryIds = () => {
2149
2149
  return [ActivityBar$3, ActivityBarAdditionalViews, Settings$1, ACCOUNT_MENU_ID, ACCOUNT_SUBMENU_ID];
2150
2150
  };
2151
2151
 
2152
+ const getBadgeText = badgeCount => {
2153
+ if (badgeCount <= 999) {
2154
+ return badgeCount ? String(badgeCount) : '';
2155
+ }
2156
+ const thousands = badgeCount / 1000;
2157
+ const roundedDown = Math.floor(thousands);
2158
+ return thousands > roundedDown ? `${roundedDown}K+` : `${roundedDown}K`;
2159
+ };
2160
+
2152
2161
  const updateItemsWithBadgeCount = async items => {
2153
2162
  try {
2154
2163
  const badgeCounts = await invoke('Layout.getBadgeCounts');
2155
2164
  const newItems = items.map(item => {
2156
2165
  const badgeCount = badgeCounts[item.id] || 0;
2157
- const badgeText = badgeCount ? String(badgeCount) : '';
2166
+ const badgeText = getBadgeText(badgeCount);
2158
2167
  return {
2159
2168
  ...item,
2160
2169
  badgeText
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/activity-bar-worker",
3
- "version": "7.10.1",
3
+ "version": "7.11.0",
4
4
  "description": "Explorer Worker",
5
5
  "repository": {
6
6
  "type": "git",