@trops/dash-core 0.1.475 → 0.1.477

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