@firstpick/pi-package-webui 0.8.4 → 0.8.5
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/README.md +1 -1
- package/bin/pi-webui.mjs +8 -1
- package/package.json +1 -1
- package/public/app.js +45 -0
- package/public/index.html +1 -1
- package/public/service-worker.js +1 -1
- package/tests/boot-failure-diagnostics.test.mjs +2 -2
- package/tests/codex-fast-mode-static.test.mjs +2 -2
- package/tests/composer-action-grid-reorder-static.test.mjs +2 -2
- package/tests/fast-mode-client-static.test.mjs +1 -1
- package/tests/feature-decision-output-popup-static.test.mjs +1 -1
- package/tests/http-endpoints-harness.test.mjs +17 -7
- package/tests/mobile-continuity-tablet-static.test.mjs +2 -2
- package/tests/mobile-foundation-static.test.mjs +2 -2
- package/tests/mobile-phone-experience-static.test.mjs +1 -1
- package/tests/mobile-static.test.mjs +1 -0
- package/tests/open-issue-wizard-static.test.mjs +1 -1
- package/tests/optional-feature-migration-frontend.test.mjs +3 -0
- package/tests/persistent-ui-layout-static.test.mjs +2 -2
- package/tests/questionnaire-dialog.test.mjs +2 -2
- package/tests/side-panel-section-reorder-static.test.mjs +2 -2
package/README.md
CHANGED
|
@@ -171,7 +171,7 @@ Troubleshooting:
|
|
|
171
171
|
|
|
172
172
|
### Optional-feature startup audit and migration
|
|
173
173
|
|
|
174
|
-
Every Web UI server start performs one bounded, read-only startup audit of optional features before the first normal Pi RPC tab starts. HTTP diagnostics and the browser are available immediately: the persistent status surface shows **Checking optional features…** and elapsed time while the browser reads the server-owned cached snapshot. The browser never scans package directories or Pi settings itself. A successful audit reports a truthful **Core ready · N optional features ready** summary;
|
|
174
|
+
Every Web UI server start performs one bounded, read-only startup audit of optional features before the first normal Pi RPC tab starts. HTTP diagnostics and the browser are available immediately: the persistent status surface shows **Checking optional features…** and elapsed time while the browser reads the server-owned cached snapshot. The browser never scans package directories or Pi settings itself. A successful audit reports a truthful **Core ready · N optional features ready** summary and automatically dismisses that non-actionable confirmation after five seconds; actionable, degraded, and failed states remain visible until resolved. Fresh minimal installs and upgrades whose companions are already registered or enabled as top-level resources require no confirmation.
|
|
175
175
|
|
|
176
176
|
When an older bundled Web UI feature needs restoration, the banner offers **Migrate…** and **Later**. **Migrate…** opens the single combined confirmation—there is no separate review screen. Previously enabled features are preselected, previously disabled features and features disabled in this browser are not, and the expandable **Choose features** area can adjust the batch. **Later** persists the dismissal so the migration banner does not return on every server start; a non-blocking **Migrate…** action remains in the Optional features panel.
|
|
177
177
|
|
package/bin/pi-webui.mjs
CHANGED
|
@@ -8771,7 +8771,14 @@ function readSupervisorCursorFromEnv() {
|
|
|
8771
8771
|
}
|
|
8772
8772
|
|
|
8773
8773
|
async function packageNameForResourcePath(resourcePath) {
|
|
8774
|
-
let
|
|
8774
|
+
let canonicalResourcePath = resourcePath;
|
|
8775
|
+
try {
|
|
8776
|
+
canonicalResourcePath = await realpath(resourcePath);
|
|
8777
|
+
} catch {
|
|
8778
|
+
// Keep lexical lookup for missing or virtual resources.
|
|
8779
|
+
}
|
|
8780
|
+
|
|
8781
|
+
let current = path.dirname(canonicalResourcePath);
|
|
8775
8782
|
while (current && current !== path.dirname(current)) {
|
|
8776
8783
|
if (PACKAGE_NAME_CACHE.has(current)) return PACKAGE_NAME_CACHE.get(current) || undefined;
|
|
8777
8784
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firstpick/pi-package-webui",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.5",
|
|
4
4
|
"description": "Pi Web UI companion package with a local browser UI CLI plus /webui-start and /webui-status commands.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/Firstp1ck/pi-coding-agent-forge/tree/main/pi-package-webui#readme",
|
package/public/app.js
CHANGED
|
@@ -2857,6 +2857,7 @@ const optionalFeatureInstallMessages = new Map();
|
|
|
2857
2857
|
const optionalFeatureInstallStates = new Map();
|
|
2858
2858
|
const optionalFeatureInstallProgressTimers = new Map();
|
|
2859
2859
|
const optionalFeatureMigrationResultEvents = new Set();
|
|
2860
|
+
const OPTIONAL_FEATURE_READY_AUTO_DISMISS_MS = 5_000;
|
|
2860
2861
|
let optionalFeatureBatchState = null;
|
|
2861
2862
|
let optionalFeatureMigrationSnapshot = {
|
|
2862
2863
|
phase: "checking",
|
|
@@ -2870,6 +2871,9 @@ let optionalFeatureMigrationSnapshot = {
|
|
|
2870
2871
|
};
|
|
2871
2872
|
let optionalFeatureMigrationCheckingStartedAt = Date.now();
|
|
2872
2873
|
let optionalFeatureMigrationRenderTimer = null;
|
|
2874
|
+
let optionalFeatureMigrationReadyDismissTimer = null;
|
|
2875
|
+
let optionalFeatureMigrationPendingReadyDismissKey = "";
|
|
2876
|
+
let optionalFeatureMigrationDismissedReadyKey = "";
|
|
2873
2877
|
let optionalFeatureMigrationDialogState = null;
|
|
2874
2878
|
let optionalFeatureMigrationLastPhase = "";
|
|
2875
2879
|
let optionalFeatureMigrationCompletionFocusKey = "";
|
|
@@ -34196,6 +34200,38 @@ function ensureOptionalFeatureMigrationRenderTimer() {
|
|
|
34196
34200
|
}
|
|
34197
34201
|
}
|
|
34198
34202
|
|
|
34203
|
+
function clearOptionalFeatureReadyDismissTimer() {
|
|
34204
|
+
if (optionalFeatureMigrationReadyDismissTimer) clearTimeout(optionalFeatureMigrationReadyDismissTimer);
|
|
34205
|
+
optionalFeatureMigrationReadyDismissTimer = null;
|
|
34206
|
+
optionalFeatureMigrationPendingReadyDismissKey = "";
|
|
34207
|
+
}
|
|
34208
|
+
|
|
34209
|
+
function optionalFeatureReadyDismissKey(snapshot = optionalFeatureMigrationSnapshot) {
|
|
34210
|
+
return snapshot.phase === "ready" ? String(snapshot.revision || "pending") : "";
|
|
34211
|
+
}
|
|
34212
|
+
|
|
34213
|
+
function scheduleOptionalFeatureReadyDismiss(key) {
|
|
34214
|
+
if (!key) {
|
|
34215
|
+
clearOptionalFeatureReadyDismissTimer();
|
|
34216
|
+
if (optionalFeatureMigrationSnapshot.phase !== "ready") optionalFeatureMigrationDismissedReadyKey = "";
|
|
34217
|
+
return;
|
|
34218
|
+
}
|
|
34219
|
+
if (optionalFeatureMigrationDismissedReadyKey === key) return;
|
|
34220
|
+
if (optionalFeatureMigrationReadyDismissTimer && optionalFeatureMigrationPendingReadyDismissKey === key) return;
|
|
34221
|
+
clearOptionalFeatureReadyDismissTimer();
|
|
34222
|
+
optionalFeatureMigrationPendingReadyDismissKey = key;
|
|
34223
|
+
optionalFeatureMigrationReadyDismissTimer = setTimeout(() => {
|
|
34224
|
+
optionalFeatureMigrationReadyDismissTimer = null;
|
|
34225
|
+
optionalFeatureMigrationPendingReadyDismissKey = "";
|
|
34226
|
+
if (optionalFeatureReadyDismissKey() !== key || optionalFeatureRestartNotice) return;
|
|
34227
|
+
optionalFeatureMigrationDismissedReadyKey = key;
|
|
34228
|
+
const surface = elements.optionalFeatureMigrationSurface;
|
|
34229
|
+
if (!surface) return;
|
|
34230
|
+
surface.replaceChildren();
|
|
34231
|
+
surface.hidden = true;
|
|
34232
|
+
}, OPTIONAL_FEATURE_READY_AUTO_DISMISS_MS);
|
|
34233
|
+
}
|
|
34234
|
+
|
|
34199
34235
|
function optionalFeatureMigrationAction(label, handler, className = "") {
|
|
34200
34236
|
const button = make("button", className, label);
|
|
34201
34237
|
button.type = "button";
|
|
@@ -34248,6 +34284,14 @@ function renderOptionalFeatureMigrationSurface() {
|
|
|
34248
34284
|
const summary = snapshot.summary || {};
|
|
34249
34285
|
const conflicts = (snapshot.features || []).filter((feature) => feature.state === "conflict");
|
|
34250
34286
|
const progress = snapshot.progress;
|
|
34287
|
+
const readyDismissKey = optionalFeatureReadyDismissKey(snapshot);
|
|
34288
|
+
const readyCanAutoDismiss = Boolean(readyDismissKey && !optionalFeatureRestartNotice);
|
|
34289
|
+
if (readyCanAutoDismiss && optionalFeatureMigrationDismissedReadyKey === readyDismissKey) {
|
|
34290
|
+
surface.replaceChildren();
|
|
34291
|
+
surface.hidden = true;
|
|
34292
|
+
ensureOptionalFeatureMigrationRenderTimer();
|
|
34293
|
+
return;
|
|
34294
|
+
}
|
|
34251
34295
|
const card = make("div", `optional-feature-migration-card phase-${snapshot.phase}`);
|
|
34252
34296
|
const copy = make("div", "optional-feature-migration-copy");
|
|
34253
34297
|
const title = make("strong", "optional-feature-migration-title");
|
|
@@ -34334,6 +34378,7 @@ function renderOptionalFeatureMigrationSurface() {
|
|
|
34334
34378
|
surface.replaceChildren(card);
|
|
34335
34379
|
surface.hidden = false;
|
|
34336
34380
|
ensureOptionalFeatureMigrationRenderTimer();
|
|
34381
|
+
scheduleOptionalFeatureReadyDismiss(readyCanAutoDismiss ? readyDismissKey : "");
|
|
34337
34382
|
if (focusKey && focusKey !== optionalFeatureMigrationCompletionFocusKey) {
|
|
34338
34383
|
optionalFeatureMigrationCompletionFocusKey = focusKey;
|
|
34339
34384
|
queueMicrotask(() => card.isConnected && card.focus({ preventScroll: true }));
|
package/public/index.html
CHANGED
package/public/service-worker.js
CHANGED
|
@@ -84,7 +84,7 @@ function makeEnvironment({
|
|
|
84
84
|
removeEventListener(name) { listeners.delete(name); },
|
|
85
85
|
};
|
|
86
86
|
const document = {
|
|
87
|
-
currentScript: new FakeElement({ dataset: { appSrc: "/app.js?v=
|
|
87
|
+
currentScript: new FakeElement({ dataset: { appSrc: "/app.js?v=113" } }),
|
|
88
88
|
readyState: "complete",
|
|
89
89
|
querySelector(selector) {
|
|
90
90
|
return {
|
|
@@ -232,7 +232,7 @@ for (const moduleName of startupModuleNames) {
|
|
|
232
232
|
assert.ok(serviceWorker.includes(`"/${moduleName}"`), `the PWA app shell should include every app.js startup module: ${moduleName}`);
|
|
233
233
|
}
|
|
234
234
|
assert.match(serviceWorker, /pi-webui-pwa-v\d+/, "the app-shell cache should retain a versioned identity");
|
|
235
|
-
assert.ok(html.indexOf('id="webuiBootLoader"') < html.indexOf("/app.js?v=
|
|
235
|
+
assert.ok(html.indexOf('id="webuiBootLoader"') < html.indexOf("/app.js?v=113"), "the inline loader should own app module startup");
|
|
236
236
|
assert.doesNotMatch(html, /<script type="module" src="\/app\.js/, "the app module should not bypass the guarded loader");
|
|
237
237
|
|
|
238
238
|
console.log("boot-failure-diagnostics.test.mjs passed");
|
|
@@ -54,7 +54,7 @@ assert.match(app, /statusKey === CODEX_FAST_MODE_STATUS_KEY[\s\S]*?applyCodexFas
|
|
|
54
54
|
assert.match(readme, /### Compact live output mode[\s\S]*?select \*\*Compact\*\*[\s\S]*?`compact-v1`/, "README should document Compact mode with the stable wire identifier");
|
|
55
55
|
assert.match(readme, /### Codex subscription Fast mode[\s\S]*?service_tier: "priority"[\s\S]*?1\.5× faster[\s\S]*?2× Standard credits[\s\S]*?2\.5×/, "README should separately document subscription Fast mode and its cost semantics");
|
|
56
56
|
// Intent preserved: browser-asset changes must advance the coherent cache tuple.
|
|
57
|
-
assert.match(serviceWorker, /pi-webui-pwa-
|
|
58
|
-
assert.match(html, /data-app-src="\/app\.js\?v=
|
|
57
|
+
assert.match(serviceWorker, /pi-webui-pwa-v72/, "PWA cache identity should be bumped for changed browser assets");
|
|
58
|
+
assert.match(html, /data-app-src="\/app\.js\?v=113"/, "browser module URL should be cache-busted for Fast-mode wiring");
|
|
59
59
|
|
|
60
60
|
console.log("codex-fast-mode-static.test.mjs passed");
|
|
@@ -57,7 +57,7 @@ assert.match(app, /event\.key === COMPOSER_ACTION_ORDER_STORAGE_KEY\) restoreCom
|
|
|
57
57
|
assert.match(app, /initializeComposerActionOrdering\(\);[\s\S]*restoreSidePanelSectionOrder\(\);/, "composer ordering should initialize during guarded app startup");
|
|
58
58
|
|
|
59
59
|
assert.match(html, /styles\.css\?v=98/, "changed composer styles should advance the stylesheet revision");
|
|
60
|
-
assert.match(html, /app\.js\?v=
|
|
61
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
60
|
+
assert.match(html, /app\.js\?v=113/, "changed composer behavior should advance the app revision");
|
|
61
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v72"/, "changed browser assets should advance the PWA cache identity");
|
|
62
62
|
|
|
63
63
|
console.log("composer-action-grid-reorder-static.test.mjs passed");
|
|
@@ -155,7 +155,7 @@ assert.match(worker, /pi-webui-pwa-v\d+[\s\S]*?"\/fast-output-live\.mjs"/, "PWA
|
|
|
155
155
|
assert.match(html, /<label for="fastOutputModeSelect">Compact mode \(Experimental\)<\/label>/, "the sidebar should mark compact mode as experimental");
|
|
156
156
|
assert.match(html, /Lightweight browser rendering; Markdown final output; live thinking expanded; stored thinking grouped and collapsed/, "the sidebar should distinguish compact rendering from model inference");
|
|
157
157
|
// Intent preserved: the guarded PWA entry point must advance whenever app wiring changes.
|
|
158
|
-
assert.match(html, /id="webuiBootLoader"[^>]*data-app-src="\/app\.js\?v=
|
|
158
|
+
assert.match(html, /id="webuiBootLoader"[^>]*data-app-src="\/app\.js\?v=113"/, "the guarded PWA entry point should cache-bust browser wiring");
|
|
159
159
|
assert.match(JSON.parse(packageRaw).scripts.check, /node --check public\/fast-output-live\.mjs/, "package checks should parse the compact helper");
|
|
160
160
|
|
|
161
161
|
const events = createFastModeOutputEvents();
|
|
@@ -167,6 +167,6 @@ assert.match(app, /case "webui_connected":[\s\S]*clearFeatureDecisionStateForTab
|
|
|
167
167
|
assert.match(app, /statusKey === FEATURE_DECISION_OUTPUT_STATUS_KEY[\s\S]*handleFeatureDecisionOutputStatus[\s\S]*return;[\s\S]*statusKey === FEATURE_CATEGORY_STATUS_KEY[\s\S]*return;[\s\S]*statusEntries\.set/, "both feature statuses should be intercepted before generic footer storage while preserving category handling");
|
|
168
168
|
|
|
169
169
|
assert.match(html, /\/styles\.css\?v=98/, "integrated stylesheet changes should advance the cache query");
|
|
170
|
-
assert.match(html, /\/app\.js\?v=
|
|
170
|
+
assert.match(html, /\/app\.js\?v=113/, "integrated app changes should advance the cache query");
|
|
171
171
|
|
|
172
172
|
console.log("feature decision-output popup static checks passed");
|
|
@@ -341,13 +341,23 @@ async function runOptionalFeatureFocus() {
|
|
|
341
341
|
await request("127.0.0.1", "/api/optional-feature-migration/recheck", { method: "POST", body: {} });
|
|
342
342
|
}
|
|
343
343
|
|
|
344
|
-
const
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
344
|
+
const summaryFileAlias = path.join(workflowPolicyAgentDir, "extensions", "session-summary.ts");
|
|
345
|
+
await mkdir(path.dirname(summaryFileAlias), { recursive: true });
|
|
346
|
+
await symlink(path.join(root, "session-summary.ts"), summaryFileAlias);
|
|
347
|
+
try {
|
|
348
|
+
const resourceTab = await request("127.0.0.1", "/api/tabs", { method: "POST", body: { cwd, title: "configured optional package" } });
|
|
349
|
+
assert.equal(resourceTab.status, 201, resourceTab.body?.error);
|
|
350
|
+
const rpcArgs = (await readJsonLines(fakePiCliLog)).filter(({ event }) => event === "rpc").at(-1)?.args || [];
|
|
351
|
+
const normalizedArgs = rpcArgs.map((arg) => String(arg).replace(/\\/g, "/"));
|
|
352
|
+
const normalizedSummaryAlias = summaryFileAlias.replace(/\\/g, "/");
|
|
353
|
+
assert.equal(normalizedArgs.filter((arg) => arg.endsWith("/pi-extension-aur-review/index.ts")).length, 1);
|
|
354
|
+
assert.equal(normalizedArgs.filter((arg) => arg.endsWith("/pi-package-webui/index.ts")).length, 1);
|
|
355
|
+
assert.equal(normalizedArgs.filter((arg) => arg.endsWith("/pi-package-webui/session-summary.ts")).length, 1, "the started WebUI package should contribute one canonical summary extension");
|
|
356
|
+
assert.equal(normalizedArgs.includes(normalizedSummaryAlias), false, "a top-level file symlink into the WebUI package must not duplicate the canonical summary extension");
|
|
357
|
+
await request("127.0.0.1", "/api/tabs/close", { method: "POST", body: { ids: [resourceTab.body?.data?.tab?.id] } });
|
|
358
|
+
} finally {
|
|
359
|
+
await rm(summaryFileAlias, { force: true });
|
|
360
|
+
}
|
|
351
361
|
|
|
352
362
|
const batchPlan = await request("127.0.0.1", "/api/optional-features");
|
|
353
363
|
const batchRevision = batchPlan.body?.data?.revision;
|
|
@@ -47,9 +47,9 @@ assert.match(css, /html\[data-tablet-shell="v2"\] \.mobile-shell-nav[\s\S]*?widt
|
|
|
47
47
|
assert.match(css, /html\[data-tablet-shell="v2"\] \.mobile-shell-surface[\s\S]*?width: min\(30rem, 72vw\)/, "tablet inspector must be a bounded right-side sheet");
|
|
48
48
|
assert.match(css, /html\[data-tablet-shell="v2"\] \.file-viewer-pane[\s\S]*?position: fixed[\s\S]*?inset: 0/, "tablet files must default to full-screen replacement");
|
|
49
49
|
assert.match(css, /and \(pointer: coarse\)[\s\S]*?min-height: 44px/, "coarse tablet pointers must retain the 44px target floor");
|
|
50
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
50
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v72"/, "continuity/tablet assets need a coherent cache identity");
|
|
51
51
|
assert.match(html, /styles\.css\?v=98/, "tablet CSS must have a coherent HTML revision");
|
|
52
|
-
assert.match(html, /app\.js\?v=
|
|
52
|
+
assert.match(html, /app\.js\?v=113/, "continuity app logic must have a coherent HTML revision");
|
|
53
53
|
assert.match(readme, /tabletShell=v2/, "tablet preview and rollback must be documented");
|
|
54
54
|
|
|
55
55
|
console.log("mobile-continuity-tablet-static.test.mjs passed");
|
|
@@ -38,9 +38,9 @@ assert.match(server, /"mobile-shell-state\.mjs"/, "the server allowlist must ser
|
|
|
38
38
|
assert.match(server, /"transcript-renderer\.mjs"/, "the server allowlist must serve the transcript startup module");
|
|
39
39
|
assert.match(serviceWorker, /"\/mobile-shell-state\.mjs"/, "the PWA shell must cache the new startup module");
|
|
40
40
|
assert.match(serviceWorker, /"\/transcript-renderer\.mjs"/, "the PWA shell must cache the transcript startup module");
|
|
41
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
41
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v72"/, "the cache identity must change with the startup graph");
|
|
42
42
|
assert.match(html, /styles\.css\?v=98/, "the stylesheet revision must change with mobile/tablet CSS fixes");
|
|
43
|
-
assert.match(html, /app\.js\?v=
|
|
43
|
+
assert.match(html, /app\.js\?v=113/, "the app revision must change with continuity/tablet wiring");
|
|
44
44
|
assert.match(serviceWorker, /const APP_SHELL_NETWORK_TIMEOUT_MS = 8_000;[\s\S]*?event\.waitUntil\([\s\S]*?cache\.put\(request, response\.clone\(\)\)[\s\S]*?return networkResponse;/, "runtime cache writes must extend the event lifetime without blocking bounded network responses");
|
|
45
45
|
assert.match(serviceWorker, /MOBILE_NAVIGATION_MESSAGE_TYPE = "pi-webui:navigate:v1"/, "the service worker must use a versioned active-client navigation message");
|
|
46
46
|
assert.match(serviceWorker, /client\.postMessage\(\{ type: MOBILE_NAVIGATION_MESSAGE_TYPE, target \}\)/, "existing clients must receive only a validated target message");
|
|
@@ -60,6 +60,6 @@ assert.match(css, /data-mobile-presentation="essential"/, "Essential presentatio
|
|
|
60
60
|
assert.match(css, /html\[data-mobile-shell="v2"\] body\.mobile-keyboard-open \.widget-area,[\s\S]*?\.composer-actions-button \{ display: block !important; \}/, "v2 keyboard mode must keep run widgets and the actions entry available");
|
|
61
61
|
assert.match(css, /@media \(prefers-reduced-motion: reduce\)/, "reduced-motion behavior is required");
|
|
62
62
|
assert.match(css, /@media \(forced-colors: active\)/, "forced-color affordances are required");
|
|
63
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
63
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v72"/, "browser asset changes need a coherent cache tuple");
|
|
64
64
|
|
|
65
65
|
console.log("mobile-phone-experience-static.test.mjs passed");
|
|
@@ -2005,6 +2005,7 @@ assert.ok(mochaBackground.length > 8000, "Catppuccin Mocha background image shou
|
|
|
2005
2005
|
assert.match(server, /resolveCodexUsageAuth/, "server should use the lock-safe Codex OAuth compatibility adapter");
|
|
2006
2006
|
assert.match(server, /DefaultPackageManager/, "server should use Pi's package resolver when controlling Web UI tab extension loading");
|
|
2007
2007
|
assert.match(server, /WEBUI_RESOURCE_EXCLUDED_PACKAGES = new Set\(\[WEBUI_PACKAGE\]\)/, "server should exclude only the Web UI package itself from normal Pi resource loading");
|
|
2008
|
+
assert.match(server, /async function packageNameForResourcePath\(resourcePath\)[\s\S]*canonicalResourcePath = await realpath\(resourcePath\)[\s\S]*path\.dirname\(canonicalResourcePath\)/, "package ownership checks should canonicalize file symlinks before walking package ancestors");
|
|
2008
2009
|
assert.match(server, /const args = \["--mode", "rpc", "--no-extensions", "--no-skills", "--no-prompt-templates", "--no-themes"\]/, "Web UI tabs should disable implicit resource loading before adding resolved resource paths");
|
|
2009
2010
|
assert.match(server, /normalPiResourcePathsForTab[\s\S]*WEBUI_RESOURCE_EXCLUDED_PACKAGES\.has\(packageName\)[\s\S]*continue/, "Web UI tab resource resolution should retain separately configured optional packages and prevent only self-loading duplication");
|
|
2010
2011
|
assert.match(server, /startedWebuiResourcePaths\(resourceType\)/, "Web UI tabs should load Web UI-owned resources from the started package");
|
|
@@ -69,7 +69,7 @@ assert.match(server, /"issue-bot-client\.mjs"/, "the static allowlist must serve
|
|
|
69
69
|
assert.match(serviceWorker, /"\/issue-wizard-state\.mjs"/, "the PWA shell must keep caching the pure wizard module");
|
|
70
70
|
assert.match(serviceWorker, /"\/issue-bot-client\.mjs"/, "the PWA shell must cache the browser client module");
|
|
71
71
|
// Intent preserved: changing the public startup graph advances the PWA cache identity.
|
|
72
|
-
assert.match(serviceWorker, /pi-webui-pwa-
|
|
72
|
+
assert.match(serviceWorker, /pi-webui-pwa-v72/, "the PWA cache name must change with browser wiring updates");
|
|
73
73
|
assert.match(packageJson, /node --check public\/issue-wizard-state\.mjs/, "the package check must keep syntax-checking the pure wizard module");
|
|
74
74
|
assert.match(packageJson, /node --check public\/issue-bot-client\.mjs/, "the package check must syntax-check the browser client module");
|
|
75
75
|
|
|
@@ -61,6 +61,9 @@ assert.match(app, /source\.onopen[\s\S]*refreshOptionalFeaturePackageStatuses\(\
|
|
|
61
61
|
const timerSource = sourceBetween("function refreshOptionalFeatureMigrationElapsedText", "function optionalFeatureMigrationAction");
|
|
62
62
|
assert.doesNotMatch(timerSource, /renderOptionalFeatureMigrationSurface\(\)/, "elapsed ticks must not replace and re-announce the entire live region");
|
|
63
63
|
assert.match(timerSource, /querySelector\("\.optional-feature-migration-detail"\)/, "elapsed ticks should update only the detail node");
|
|
64
|
+
assert.match(app, /const OPTIONAL_FEATURE_READY_AUTO_DISMISS_MS = 5_000;/, "a successful startup audit should remain readable briefly before dismissal");
|
|
65
|
+
assert.match(timerSource, /scheduleOptionalFeatureReadyDismiss[\s\S]*setTimeout[\s\S]*optionalFeatureReadyDismissKey\(\) !== key \|\| optionalFeatureRestartNotice[\s\S]*surface\.hidden = true/, "ready feedback should auto-dismiss only while the same ready snapshot remains non-actionable");
|
|
66
|
+
assert.match(surfaceSource, /readyCanAutoDismiss[\s\S]*scheduleOptionalFeatureReadyDismiss\(readyCanAutoDismiss \? readyDismissKey : ""\)/, "rendering should schedule dismissal only for non-actionable ready feedback");
|
|
64
67
|
|
|
65
68
|
assert.match(css, /\.optional-feature-migration-surface[\s\S]*\.optional-feature-migration-dialog[\s\S]*@media \(max-width: 34rem\)/, "migration surfaces should have desktop and responsive styling");
|
|
66
69
|
assert.match(css, /\.optional-feature-migration-card:focus-visible/, "focused completion summary should have a visible focus treatment");
|
|
@@ -261,7 +261,7 @@ assert.match(
|
|
|
261
261
|
|
|
262
262
|
// --- Coherent browser asset revisions --------------------------------------
|
|
263
263
|
|
|
264
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
265
|
-
assert.match(html, /data-app-src="\/app\.js\?v=
|
|
264
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v72"/, "changed browser assets should advance the PWA cache identity");
|
|
265
|
+
assert.match(html, /data-app-src="\/app\.js\?v=113"/, "the boot loader should request the updated app module revision");
|
|
266
266
|
|
|
267
267
|
console.log("persistent-ui-layout-static.test.mjs passed");
|
|
@@ -505,7 +505,7 @@ assert.match(css, /\.questionnaire-options button\s*\{\s*min-height:\s*3\.35rem/
|
|
|
505
505
|
assert.match(css, /@media \(prefers-reduced-motion: reduce\)\s*\{[\s\S]*?\*, \*::before, \*::after[\s\S]*?transition-duration:\s*1ms !important/, "global reduced-motion rules must cover questionnaire transitions");
|
|
506
506
|
|
|
507
507
|
assert.match(html, /styles\.css\?v=98/, "questionnaire CSS needs the current stylesheet revision");
|
|
508
|
-
assert.match(html, /app\.js\?v=
|
|
509
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
508
|
+
assert.match(html, /app\.js\?v=113/, "questionnaire behavior needs the current app revision");
|
|
509
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v72"/, "questionnaire public assets need a coherent PWA cache revision");
|
|
510
510
|
|
|
511
511
|
console.log("questionnaire-dialog.test.mjs passed");
|
|
@@ -62,7 +62,7 @@ assert.match(
|
|
|
62
62
|
"section headers should expose model-picker-style grab, dragging, and insertion-marker affordances",
|
|
63
63
|
);
|
|
64
64
|
assert.match(html, /styles\.css\?v=98/, "changed side-panel styles should advance the stylesheet revision");
|
|
65
|
-
assert.match(html, /app\.js\?v=
|
|
66
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
65
|
+
assert.match(html, /app\.js\?v=113/, "changed side-panel behavior should advance the app revision");
|
|
66
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v72"/, "changed browser assets should advance the PWA cache identity");
|
|
67
67
|
|
|
68
68
|
console.log("side-panel-section-reorder-static.test.mjs passed");
|