@the-portland-company/shell 0.56.0 → 0.58.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.
@@ -402,9 +402,13 @@ declare function ChromeTopBarActions(): react_jsx_runtime.JSX.Element | null;
402
402
  /** True when any core-org membership carries a super-admin tier. */
403
403
  declare function useIsSuperAdmin(): boolean;
404
404
  /**
405
- * Sidebar footer: legal links for everyone; build metadata (env / commit /
406
- * version / date / author) ONLY for Super Administrators
407
- * (Reference/UI-Platform). Pass the app's build-time metadata in.
405
+ * Sidebar footer: legal links AND build metadata (env / commit / version /
406
+ * date / author) for every user. Reference/UI-Platform "Left bar — required
407
+ * elements" lists Meta unconditionally — it carries no Super Administrator
408
+ * gate. Gating it here (pre-2026-09-30) silently dropped the whole Meta row
409
+ * for every non-admin viewer, which is exactly the "Left Nav not adhering to
410
+ * UI/UX rules" violation DevNotes 83a4713 filed against Contacts. Pass the
411
+ * app's build-time metadata in; it now always reaches the rail.
408
412
  */
409
413
  declare function useChromeFooter(meta: {
410
414
  envLabel?: string;
@@ -402,9 +402,13 @@ declare function ChromeTopBarActions(): react_jsx_runtime.JSX.Element | null;
402
402
  /** True when any core-org membership carries a super-admin tier. */
403
403
  declare function useIsSuperAdmin(): boolean;
404
404
  /**
405
- * Sidebar footer: legal links for everyone; build metadata (env / commit /
406
- * version / date / author) ONLY for Super Administrators
407
- * (Reference/UI-Platform). Pass the app's build-time metadata in.
405
+ * Sidebar footer: legal links AND build metadata (env / commit / version /
406
+ * date / author) for every user. Reference/UI-Platform "Left bar — required
407
+ * elements" lists Meta unconditionally — it carries no Super Administrator
408
+ * gate. Gating it here (pre-2026-09-30) silently dropped the whole Meta row
409
+ * for every non-admin viewer, which is exactly the "Left Nav not adhering to
410
+ * UI/UX rules" violation DevNotes 83a4713 filed against Contacts. Pass the
411
+ * app's build-time metadata in; it now always reaches the rail.
408
412
  */
409
413
  declare function useChromeFooter(meta: {
410
414
  envLabel?: string;
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { broadcastLogout, watchLogout } from './chunk-LL6LSJAH.js';
3
- import { clearBetaBannerDismissal, standardPolitogyNav, NavAppShell, NavChromeProvider, FuelAction, NavDisplayAction, TopBarWidgetSlot, SupportAction, NotificationsAction, useChromeMe, useThemePreference, useNavChromeFetcher, useChromeOrgs } from './chunk-MR6TLHEE.js';
3
+ import { clearBetaBannerDismissal, standardPolitogyNav, NavAppShell, NavChromeProvider, FuelAction, NavDisplayAction, TopBarWidgetSlot, SpecOverlayAction, SupportAction, NotificationsAction, useChromeMe, useThemePreference, useNavChromeFetcher, useChromeOrgs } from './chunk-BV2QF7NY.js';
4
4
  import './chunk-U4RZPZET.js';
5
5
  import { NAV_DISPLAY_DEFAULT, resolveNavDisplay, isNavDisplayPreference, writeNavDisplayCookie, writeNavDisplayLocal, NAV_DISPLAY_STORAGE_KEY, readNavDisplayCookie } from './chunk-6UHJV2FH.js';
6
6
  import { resolveActiveOrg, isOrgId, writeActiveOrgCookie, ACTIVE_ORG_QUERY_PARAM, readActiveOrgCookie } from './chunk-W2HITMV5.js';
@@ -1031,18 +1031,71 @@ function AppDevNotes({
1031
1031
  }),
1032
1032
  [storagePrefix, identity.role]
1033
1033
  );
1034
- if (devNotes?.providedByApp) return /* @__PURE__ */ jsx(DevNotesSurface, { children });
1035
- return /* @__PURE__ */ jsx(DevNotesProvider, { adapter, user, config, children: /* @__PURE__ */ jsx(DevNotesSurface, { children }) });
1034
+ const activatedRef = useRef(false);
1035
+ const activationWaitersRef = useRef([]);
1036
+ const activate = useCallback(() => {
1037
+ if (activatedRef.current) return;
1038
+ activatedRef.current = true;
1039
+ const waiters = activationWaitersRef.current;
1040
+ activationWaitersRef.current = [];
1041
+ waiters.forEach((resolve) => resolve());
1042
+ }, []);
1043
+ const waitForActivation = useCallback(() => {
1044
+ if (activatedRef.current) return Promise.resolve();
1045
+ return new Promise((resolve) => {
1046
+ activationWaitersRef.current.push(resolve);
1047
+ });
1048
+ }, []);
1049
+ const lazyAdapter = useMemo(() => {
1050
+ const GATED_METHODS = [
1051
+ "fetchTasks",
1052
+ "fetchTaskTypes",
1053
+ "fetchTaskLists",
1054
+ "fetchCollaborators",
1055
+ "fetchCapabilities",
1056
+ "getAppLinkStatus",
1057
+ "fetchBugReports",
1058
+ "fetchBugReportTypes"
1059
+ ];
1060
+ const wrapped = { ...adapter };
1061
+ for (const method of GATED_METHODS) {
1062
+ const original = adapter[method].bind(adapter);
1063
+ wrapped[method] = (...args) => waitForActivation().then(() => original(...args));
1064
+ }
1065
+ let idleScheduled = false;
1066
+ const originalUnreadCounts = adapter.fetchUnreadCounts.bind(adapter);
1067
+ wrapped.fetchUnreadCounts = () => {
1068
+ if (idleScheduled || typeof window === "undefined") return originalUnreadCounts();
1069
+ idleScheduled = true;
1070
+ return new Promise((resolve, reject) => {
1071
+ const run = () => originalUnreadCounts().then(resolve, reject);
1072
+ const ric = window.requestIdleCallback;
1073
+ if (ric) ric(run);
1074
+ else setTimeout(run, 0);
1075
+ });
1076
+ };
1077
+ return wrapped;
1078
+ }, [adapter, waitForActivation]);
1079
+ if (devNotes?.providedByApp) return /* @__PURE__ */ jsx(DevNotesSurface, { activate, children });
1080
+ return /* @__PURE__ */ jsx(DevNotesProvider, { adapter: lazyAdapter, user, config, children: /* @__PURE__ */ jsx(DevNotesSurface, { activate, children }) });
1036
1081
  }
1037
1082
  var DevNotesTasksContext = createContext({
1038
1083
  ready: false,
1039
1084
  openTasks: () => {
1085
+ },
1086
+ activate: () => {
1040
1087
  }
1041
1088
  });
1042
- function DevNotesSurface({ children }) {
1089
+ function DevNotesSurface({
1090
+ activate,
1091
+ children
1092
+ }) {
1043
1093
  const [tasksOpen, setTasksOpen] = useState(false);
1044
- const openTasks = useCallback(() => setTasksOpen(true), []);
1045
- const tasksCtx = useMemo(() => ({ ready: true, openTasks }), [openTasks]);
1094
+ const openTasks = useCallback(() => {
1095
+ activate();
1096
+ setTasksOpen(true);
1097
+ }, [activate]);
1098
+ const tasksCtx = useMemo(() => ({ ready: true, openTasks, activate }), [openTasks, activate]);
1046
1099
  return /* @__PURE__ */ jsxs(DevNotesTasksContext.Provider, { value: tasksCtx, children: [
1047
1100
  children,
1048
1101
  tasksOpen ? /* @__PURE__ */ jsx(DevNotesTaskListModal, { open: true, onClose: () => setTasksOpen(false) }) : null,
@@ -1098,14 +1151,15 @@ function ChromeTopBarActions() {
1098
1151
  children: /* @__PURE__ */ jsx(ChromeDevNotesMenu, {})
1099
1152
  }
1100
1153
  ),
1154
+ /* @__PURE__ */ jsx(SpecOverlayAction, { orgId: state.orgId }),
1101
1155
  /* @__PURE__ */ jsx(SupportAction, { orgId: state.orgId }),
1102
1156
  /* @__PURE__ */ jsx(NotificationsAction, { orgId: state.orgId })
1103
1157
  ] });
1104
1158
  }
1105
1159
  function ChromeDevNotesMenu() {
1106
- const { ready, openTasks } = useContext(DevNotesTasksContext);
1160
+ const { ready, openTasks, activate } = useContext(DevNotesTasksContext);
1107
1161
  if (!ready) return null;
1108
- return /* @__PURE__ */ jsx(DevNotesMenu, { position: "top-right", onViewTasks: openTasks });
1162
+ return /* @__PURE__ */ jsx("span", { style: { display: "contents" }, onPointerDownCapture: activate, onFocusCapture: activate, onKeyDownCapture: activate, children: /* @__PURE__ */ jsx(DevNotesMenu, { position: "top-right", onViewTasks: openTasks }) });
1109
1163
  }
1110
1164
  function useIsSuperAdmin() {
1111
1165
  const state = useChromeState();
@@ -1121,10 +1175,9 @@ var FOOTER_LINKS = [
1121
1175
  }
1122
1176
  ];
1123
1177
  function useChromeFooter(meta) {
1124
- const isSuperAdmin = useIsSuperAdmin();
1125
1178
  return useMemo(
1126
- () => isSuperAdmin ? { links: FOOTER_LINKS, ...meta } : { links: FOOTER_LINKS },
1127
- [isSuperAdmin, meta.envLabel, meta.version, meta.commit, meta.commitDate, meta.commitAuthor]
1179
+ () => ({ links: FOOTER_LINKS, ...meta }),
1180
+ [meta.envLabel, meta.version, meta.commit, meta.commitDate, meta.commitAuthor]
1128
1181
  );
1129
1182
  }
1130
1183
  function useChromeIdentity(fallback) {