@the-portland-company/shell 0.53.1 → 0.55.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.
- package/CHANGELOG.md +32 -0
- package/dist/app-chrome.cjs +134 -10
- package/dist/app-chrome.cjs.map +1 -1
- package/dist/app-chrome.d.cts +19 -2
- package/dist/app-chrome.d.ts +19 -2
- package/dist/app-chrome.js +131 -7
- package/dist/app-chrome.js.map +1 -1
- package/dist/{chunk-XEFBZ3PR.js → chunk-K5GWJSHE.js} +6 -6
- package/dist/{chunk-XEFBZ3PR.js.map → chunk-K5GWJSHE.js.map} +1 -1
- package/dist/native.cjs +4 -4
- package/dist/native.cjs.map +1 -1
- package/dist/native.js +1 -1
- package/package.json +1 -1
package/dist/app-chrome.d.cts
CHANGED
|
@@ -35,8 +35,22 @@ type BootPhase = 'booting' | 'slow' | 'error' | 'done';
|
|
|
35
35
|
*/
|
|
36
36
|
type BootProgress = {
|
|
37
37
|
stageId: BootStageId;
|
|
38
|
-
/**
|
|
39
|
-
|
|
38
|
+
/**
|
|
39
|
+
* 0–100, real, monotonic. Callers that already know the weighted value
|
|
40
|
+
* (e.g. by calling `computeWeightedPct` themselves) pass it directly here;
|
|
41
|
+
* callers that only know stage completion/skip state may omit `pct` and
|
|
42
|
+
* pass `completedStageIds`/`skippedStageIds`/`currentStageProgress`
|
|
43
|
+
* instead, and the screen computes the weighted value itself.
|
|
44
|
+
*/
|
|
45
|
+
pct?: number;
|
|
46
|
+
/** Stages fully completed so far this boot (spec §7 weight table). */
|
|
47
|
+
completedStageIds?: readonly BootStageId[];
|
|
48
|
+
/** Stages that don't apply to this account/mode; their weight redistributes
|
|
49
|
+
* proportionally across the remaining stages (spec §4.1 principle 5). */
|
|
50
|
+
skippedStageIds?: readonly BootStageId[];
|
|
51
|
+
/** 0–1 sub-stage progress within `stageId`, for stages that stream a real
|
|
52
|
+
* counter (S4 universe records, S7 Tribes warmed) (spec §4.1 principle 4). */
|
|
53
|
+
currentStageProgress?: number;
|
|
40
54
|
/** The account's own status line for this stage (spec §8; tokens already
|
|
41
55
|
* filled, fallback already applied by the caller). */
|
|
42
56
|
label: string;
|
|
@@ -44,6 +58,9 @@ type BootProgress = {
|
|
|
44
58
|
/** Critical-stage failure: Retry / Sign out (spec §9.1). */
|
|
45
59
|
onRetry?: () => void;
|
|
46
60
|
onSignOut?: () => void;
|
|
61
|
+
/** Footer (spec §6, §14 `version.ts` + deploy environment). */
|
|
62
|
+
version?: string;
|
|
63
|
+
region?: string;
|
|
47
64
|
};
|
|
48
65
|
type LoadingScreenProps = {
|
|
49
66
|
/** Real pipeline progress, when the host app has one wired. */
|
package/dist/app-chrome.d.ts
CHANGED
|
@@ -35,8 +35,22 @@ type BootPhase = 'booting' | 'slow' | 'error' | 'done';
|
|
|
35
35
|
*/
|
|
36
36
|
type BootProgress = {
|
|
37
37
|
stageId: BootStageId;
|
|
38
|
-
/**
|
|
39
|
-
|
|
38
|
+
/**
|
|
39
|
+
* 0–100, real, monotonic. Callers that already know the weighted value
|
|
40
|
+
* (e.g. by calling `computeWeightedPct` themselves) pass it directly here;
|
|
41
|
+
* callers that only know stage completion/skip state may omit `pct` and
|
|
42
|
+
* pass `completedStageIds`/`skippedStageIds`/`currentStageProgress`
|
|
43
|
+
* instead, and the screen computes the weighted value itself.
|
|
44
|
+
*/
|
|
45
|
+
pct?: number;
|
|
46
|
+
/** Stages fully completed so far this boot (spec §7 weight table). */
|
|
47
|
+
completedStageIds?: readonly BootStageId[];
|
|
48
|
+
/** Stages that don't apply to this account/mode; their weight redistributes
|
|
49
|
+
* proportionally across the remaining stages (spec §4.1 principle 5). */
|
|
50
|
+
skippedStageIds?: readonly BootStageId[];
|
|
51
|
+
/** 0–1 sub-stage progress within `stageId`, for stages that stream a real
|
|
52
|
+
* counter (S4 universe records, S7 Tribes warmed) (spec §4.1 principle 4). */
|
|
53
|
+
currentStageProgress?: number;
|
|
40
54
|
/** The account's own status line for this stage (spec §8; tokens already
|
|
41
55
|
* filled, fallback already applied by the caller). */
|
|
42
56
|
label: string;
|
|
@@ -44,6 +58,9 @@ type BootProgress = {
|
|
|
44
58
|
/** Critical-stage failure: Retry / Sign out (spec §9.1). */
|
|
45
59
|
onRetry?: () => void;
|
|
46
60
|
onSignOut?: () => void;
|
|
61
|
+
/** Footer (spec §6, §14 `version.ts` + deploy environment). */
|
|
62
|
+
version?: string;
|
|
63
|
+
region?: string;
|
|
47
64
|
};
|
|
48
65
|
type LoadingScreenProps = {
|
|
49
66
|
/** Real pipeline progress, when the host app has one wired. */
|
package/dist/app-chrome.js
CHANGED
|
@@ -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-
|
|
3
|
+
import { clearBetaBannerDismissal, standardPolitogyNav, NavAppShell, NavChromeProvider, FuelAction, NavDisplayAction, TopBarWidgetSlot, SupportAction, NotificationsAction, useChromeMe, useThemePreference, useNavChromeFetcher, useChromeOrgs } from './chunk-K5GWJSHE.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';
|
|
@@ -78,6 +78,41 @@ function resolveIdentity(input) {
|
|
|
78
78
|
loaded: input.loaded ?? false
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
|
+
var BOOT_STAGE_TABLE = [
|
|
82
|
+
{ id: "s0_session", weight: 5, critical: true, waitsOn: "Politogy ID session resolution" },
|
|
83
|
+
{ id: "s1_org", weight: 10, critical: true, waitsOn: "Chrome API /api/chrome/me + orgs" },
|
|
84
|
+
{ id: "s2_uvp_connect", weight: 10, critical: true, waitsOn: "UVP data layer connection" },
|
|
85
|
+
{ id: "s3_district", weight: 5, critical: true, waitsOn: "uvp_geo_entitlements / uvp_boundaries scope" },
|
|
86
|
+
{ id: "s4_universe", weight: 25, critical: true, waitsOn: "UVP universe load + total count" },
|
|
87
|
+
{ id: "s5_layers", weight: 15, critical: false, waitsOn: "UVP enrichment layer joins" },
|
|
88
|
+
{ id: "s6_verified", weight: 10, critical: false, waitsOn: "VRM Verified tier computation" },
|
|
89
|
+
{ id: "s7_tribes", weight: 10, critical: false, waitsOn: "Tribes member_count + Hot Tribes warm-up" },
|
|
90
|
+
{ id: "s8_intelligence", weight: 5, critical: false, waitsOn: "Mode intelligence signals (Polling/Relationship/Petition)" },
|
|
91
|
+
{ id: "s9_shell", weight: 5, critical: true, waitsOn: "Shell paint-ready handoff" }
|
|
92
|
+
];
|
|
93
|
+
var BOOT_STAGE_ORDER = BOOT_STAGE_TABLE.map((s) => s.id);
|
|
94
|
+
var BOOT_STAGE_WEIGHTS = Object.fromEntries(
|
|
95
|
+
BOOT_STAGE_TABLE.map((s) => [s.id, s.weight])
|
|
96
|
+
);
|
|
97
|
+
function computeWeightedPct(args) {
|
|
98
|
+
const skipped = new Set(args.skippedStageIds ?? []);
|
|
99
|
+
const applicable = BOOT_STAGE_ORDER.filter((id) => !skipped.has(id));
|
|
100
|
+
const applicableWeightTotal = applicable.reduce((sum, id) => sum + BOOT_STAGE_WEIGHTS[id], 0);
|
|
101
|
+
if (applicableWeightTotal <= 0) return 100;
|
|
102
|
+
const redistributionFactor = 100 / applicableWeightTotal;
|
|
103
|
+
const completed = new Set(args.completedStageIds);
|
|
104
|
+
let pct = 0;
|
|
105
|
+
for (const id of applicable) {
|
|
106
|
+
const effectiveWeight = BOOT_STAGE_WEIGHTS[id] * redistributionFactor;
|
|
107
|
+
if (completed.has(id)) {
|
|
108
|
+
pct += effectiveWeight;
|
|
109
|
+
} else if (id === args.currentStageId) {
|
|
110
|
+
const progress = Math.min(1, Math.max(0, args.currentStageProgress ?? 0));
|
|
111
|
+
pct += effectiveWeight * progress;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return Math.min(100, pct);
|
|
115
|
+
}
|
|
81
116
|
var SYNTHETIC_STAGES = [
|
|
82
117
|
{ pct: 20, label: "Connecting to your organization\u2026" },
|
|
83
118
|
{ pct: 100, label: "Ready." }
|
|
@@ -156,7 +191,25 @@ function LoadingScreen({
|
|
|
156
191
|
phase: syntheticReady ? "done" : "booting"
|
|
157
192
|
};
|
|
158
193
|
}, [syntheticReady]);
|
|
159
|
-
const
|
|
194
|
+
const weightedPct = useMemo(() => {
|
|
195
|
+
if (!bootProgress) return void 0;
|
|
196
|
+
if (typeof bootProgress.pct === "number") return bootProgress.pct;
|
|
197
|
+
if (!bootProgress.completedStageIds && !bootProgress.skippedStageIds) return void 0;
|
|
198
|
+
return computeWeightedPct({
|
|
199
|
+
completedStageIds: bootProgress.completedStageIds ?? [],
|
|
200
|
+
skippedStageIds: bootProgress.skippedStageIds,
|
|
201
|
+
currentStageId: bootProgress.stageId,
|
|
202
|
+
currentStageProgress: bootProgress.currentStageProgress
|
|
203
|
+
});
|
|
204
|
+
}, [
|
|
205
|
+
bootProgress,
|
|
206
|
+
bootProgress?.pct,
|
|
207
|
+
bootProgress?.completedStageIds,
|
|
208
|
+
bootProgress?.skippedStageIds,
|
|
209
|
+
bootProgress?.stageId,
|
|
210
|
+
bootProgress?.currentStageProgress
|
|
211
|
+
]);
|
|
212
|
+
const pct = weightedPct ?? synthetic.pct;
|
|
160
213
|
const rawLabel = bootProgress?.label ?? synthetic.label;
|
|
161
214
|
const phase = bootProgress?.phase ?? synthetic.phase;
|
|
162
215
|
const isFinal = phase === "done" && pct >= 100;
|
|
@@ -279,11 +332,82 @@ function LoadingScreen({
|
|
|
279
332
|
children: announced
|
|
280
333
|
}
|
|
281
334
|
),
|
|
282
|
-
isError && (bootProgress?.onRetry || bootProgress?.onSignOut) && /* @__PURE__ */ jsxs(
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
335
|
+
isError && (bootProgress?.onRetry || bootProgress?.onSignOut) && /* @__PURE__ */ jsxs(
|
|
336
|
+
"div",
|
|
337
|
+
{
|
|
338
|
+
style: {
|
|
339
|
+
marginTop: "1.25rem",
|
|
340
|
+
display: "flex",
|
|
341
|
+
flexDirection: "column",
|
|
342
|
+
gap: "0.75rem",
|
|
343
|
+
alignItems: "center"
|
|
344
|
+
},
|
|
345
|
+
children: [
|
|
346
|
+
bootProgress?.onRetry && /* @__PURE__ */ jsx(
|
|
347
|
+
"button",
|
|
348
|
+
{
|
|
349
|
+
type: "button",
|
|
350
|
+
onClick: bootProgress.onRetry,
|
|
351
|
+
style: {
|
|
352
|
+
height: 40,
|
|
353
|
+
padding: "0 1.25rem",
|
|
354
|
+
borderRadius: "var(--radius-md, 8px)",
|
|
355
|
+
border: "none",
|
|
356
|
+
background: "var(--color-race-red, #dc2626)",
|
|
357
|
+
color: "#fff",
|
|
358
|
+
fontFamily: "var(--font-sans, ui-sans-serif, system-ui, sans-serif)",
|
|
359
|
+
fontSize: "0.875rem",
|
|
360
|
+
fontWeight: 600,
|
|
361
|
+
cursor: "pointer"
|
|
362
|
+
},
|
|
363
|
+
children: "Retry"
|
|
364
|
+
}
|
|
365
|
+
),
|
|
366
|
+
bootProgress?.onSignOut && /* @__PURE__ */ jsx(
|
|
367
|
+
"button",
|
|
368
|
+
{
|
|
369
|
+
type: "button",
|
|
370
|
+
onClick: bootProgress.onSignOut,
|
|
371
|
+
style: {
|
|
372
|
+
height: "auto",
|
|
373
|
+
padding: 0,
|
|
374
|
+
border: "none",
|
|
375
|
+
background: "transparent",
|
|
376
|
+
color: "rgba(255,255,255,0.38)",
|
|
377
|
+
fontFamily: "var(--font-sans, ui-sans-serif, system-ui, sans-serif)",
|
|
378
|
+
fontSize: "12.5px",
|
|
379
|
+
textDecoration: "underline",
|
|
380
|
+
cursor: "pointer"
|
|
381
|
+
},
|
|
382
|
+
children: "Sign out"
|
|
383
|
+
}
|
|
384
|
+
)
|
|
385
|
+
]
|
|
386
|
+
}
|
|
387
|
+
)
|
|
388
|
+
] }),
|
|
389
|
+
/* @__PURE__ */ jsxs(
|
|
390
|
+
"div",
|
|
391
|
+
{
|
|
392
|
+
style: {
|
|
393
|
+
position: "absolute",
|
|
394
|
+
left: 0,
|
|
395
|
+
right: 0,
|
|
396
|
+
bottom: 0,
|
|
397
|
+
display: "flex",
|
|
398
|
+
alignItems: "center",
|
|
399
|
+
justifyContent: "space-between",
|
|
400
|
+
padding: "0 32px 30px",
|
|
401
|
+
fontFamily: "var(--font-sans, ui-sans-serif, system-ui, sans-serif)",
|
|
402
|
+
fontSize: "12.5px",
|
|
403
|
+
color: "rgba(255,255,255,0.38)"
|
|
404
|
+
},
|
|
405
|
+
children: [
|
|
406
|
+
/* @__PURE__ */ jsx("span", { children: "Politogy VRM. Built for the long game." }),
|
|
407
|
+
/* @__PURE__ */ jsx("span", { style: { fontFamily: "var(--font-mono, ui-monospace, monospace)", letterSpacing: "0.04em" }, children: (bootProgress?.version ?? "v\u2014") + " \xB7 " + (bootProgress?.region ?? "\u2014") })
|
|
408
|
+
]
|
|
409
|
+
}
|
|
410
|
+
)
|
|
287
411
|
]
|
|
288
412
|
}
|
|
289
413
|
);
|