@trops/dash-core 0.1.475 → 0.1.476

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.
package/dist/index.js CHANGED
@@ -57732,6 +57732,12 @@ function NotificationsTab(_ref4) {
57732
57732
  // Notifications collection logic but scoped to one workspace.
57733
57733
  var widgetInstances = React.useMemo(function () {
57734
57734
  var out = [];
57735
+ // Dedup by stable id. WorkspaceModel auto-migrates legacy
57736
+ // non-paged workspaces by aliasing pages[0].layout = workspace.layout
57737
+ // (same reference), so visiting both yields duplicate pushes for
57738
+ // every widget. Same stableId formula as providerResolution.js
57739
+ // forEachWidget so the two stay consistent.
57740
+ var seen = new Set();
57735
57741
  var _visit = function visit(item) {
57736
57742
  if (!item) return;
57737
57743
  if (Array.isArray(item)) {
@@ -57739,26 +57745,31 @@ function NotificationsTab(_ref4) {
57739
57745
  return;
57740
57746
  }
57741
57747
  if (item.component) {
57742
- var _config$notifications;
57743
- var config = ComponentManager.resolve(item.component, item);
57744
- if ((config === null || config === void 0 || (_config$notifications = config.notifications) === null || _config$notifications === void 0 ? void 0 : _config$notifications.length) > 0) {
57745
- var _item$userPrefs;
57746
- out.push({
57747
- uuid: item.uuid || item.uuidString,
57748
- title: ((_item$userPrefs = item.userPrefs) === null || _item$userPrefs === void 0 ? void 0 : _item$userPrefs.title) || config.displayName || item.component,
57749
- "package": config["package"] || "Other",
57750
- // Scoped component id (e.g. "trops.google.GoogleWidget")
57751
- // disambiguates rows when several widgets share a
57752
- // title or display the same package label. Mirrors the
57753
- // Listeners tab convention so the user only learns one
57754
- // identification scheme.
57755
- component: item.component,
57756
- // Layout instance id disambiguates two widgets of the
57757
- // SAME component on the dashboard (e.g. two GitHub
57758
- // widgets in the same workspace).
57759
- itemId: item.id,
57760
- notifications: config.notifications
57761
- });
57748
+ var idPart = item.uuidString || item.uuid || item.id;
57749
+ var stableId = idPart != null ? "".concat(item.component, "|").concat(idPart) : null;
57750
+ if (stableId && seen.has(stableId)) ; else {
57751
+ var _config$notifications;
57752
+ if (stableId) seen.add(stableId);
57753
+ var config = ComponentManager.resolve(item.component, item);
57754
+ if ((config === null || config === void 0 || (_config$notifications = config.notifications) === null || _config$notifications === void 0 ? void 0 : _config$notifications.length) > 0) {
57755
+ var _item$userPrefs;
57756
+ out.push({
57757
+ uuid: item.uuid || item.uuidString,
57758
+ title: ((_item$userPrefs = item.userPrefs) === null || _item$userPrefs === void 0 ? void 0 : _item$userPrefs.title) || config.displayName || item.component,
57759
+ "package": config["package"] || "Other",
57760
+ // Scoped component id (e.g. "trops.google.GoogleWidget")
57761
+ // — disambiguates rows when several widgets share a
57762
+ // title or display the same package label. Mirrors the
57763
+ // Listeners tab convention so the user only learns one
57764
+ // identification scheme.
57765
+ component: item.component,
57766
+ // Layout instance id — disambiguates two widgets of the
57767
+ // SAME component on the dashboard (e.g. two GitHub
57768
+ // widgets in the same workspace).
57769
+ itemId: item.id,
57770
+ notifications: config.notifications
57771
+ });
57772
+ }
57762
57773
  }
57763
57774
  }
57764
57775
  if (Array.isArray(item.children)) item.children.forEach(_visit);