@firstpick/pi-package-webui 0.8.5 → 0.8.7
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 +18 -584
- package/bin/pi-webui-launcher.mjs +22 -0
- package/bin/pi-webui-update-supervisor.mjs +86 -0
- package/bin/pi-webui.mjs +933 -554
- package/index.ts +16 -6
- package/lib/component-update-state.mjs +21 -0
- package/lib/git-workflow-preferences.mjs +20 -2
- package/lib/optional-feature-catalog.mjs +1 -0
- package/lib/sampling-parameter-capabilities.mjs +160 -0
- package/lib/session-summary-core.mjs +4 -3
- package/lib/session-summary-preferences.mjs +16 -1
- package/lib/subagent-launch-slots.mjs +14 -2
- package/lib/trust-boundaries.mjs +16 -0
- package/lib/update/executor.mjs +99 -0
- package/lib/update/journal.mjs +175 -0
- package/lib/update/owners.mjs +70 -0
- package/lib/update/plan.mjs +134 -0
- package/lib/update/resolver.mjs +168 -0
- package/lib/update/supervisor.mjs +238 -0
- package/lib/update/verify.mjs +52 -0
- package/lib/update-commands.mjs +25 -13
- package/lib/webui-workspaces.mjs +17 -1
- package/lib/workspace-session-summaries.mjs +400 -0
- package/package.json +4 -4
- package/public/app.js +2487 -349
- package/public/index.html +200 -51
- package/public/middle-button-drag-scroll.mjs +154 -0
- package/public/sampling-parameter-controls.mjs +361 -0
- package/public/service-worker.js +5 -1
- package/public/stream-output-controller.mjs +327 -0
- package/public/styles.css +666 -71
- package/public/theme-contract.mjs +244 -0
- package/session-summary.ts +164 -4
- package/tests/aur-review-widget-static.test.mjs +2 -1
- package/tests/boot-failure-diagnostics.test.mjs +3 -3
- package/tests/browser/control-deck-component-updates.spec.mjs +20 -22
- package/tests/browser/interaction-continuity.spec.mjs +2 -2
- package/tests/browser/middle-button-drag-scroll.spec.mjs +145 -0
- package/tests/browser/persistent-ui-layout.spec.mjs +68 -23
- package/tests/browser/sampling-tooltip.spec.mjs +228 -0
- package/tests/browser/session-summary.spec.mjs +131 -3
- package/tests/browser/stream-output-isolation.spec.mjs +510 -0
- package/tests/browser/update-reconnect.spec.mjs +92 -0
- package/tests/codex-fast-mode-static.test.mjs +2 -2
- package/tests/common-options-submenus-interaction-static.test.mjs +172 -0
- package/tests/common-options-submenus-markup-static.test.mjs +152 -0
- package/tests/component-update-api-static.test.mjs +22 -61
- package/tests/composer-action-grid-reorder-static.test.mjs +3 -3
- package/tests/control-deck-component-updates-static.test.mjs +13 -237
- package/tests/durable-rpc-supervisor-harness.test.mjs +3 -1
- package/tests/fast-mode-client-static.test.mjs +3 -2
- package/tests/feature-decision-output-popup-static.test.mjs +2 -2
- package/tests/feature-system-prompt-optional-feature-static.test.mjs +49 -0
- package/tests/fixtures/fake-pi.mjs +269 -2
- package/tests/fixtures/update/tree-timeout-descendant.mjs +6 -0
- package/tests/fixtures/update/tree-timeout-parent.mjs +11 -0
- package/tests/git-footer-context-menu-static.test.mjs +58 -0
- package/tests/git-workflow-preferences.test.mjs +7 -1
- package/tests/guided-git-aur-review.test.mjs +4 -3
- package/tests/http-endpoints-harness.test.mjs +274 -23
- package/tests/middle-button-drag-scroll-static.test.mjs +24 -0
- package/tests/middle-button-drag-scroll.test.mjs +170 -0
- package/tests/mobile-continuity-tablet-static.test.mjs +3 -3
- package/tests/mobile-foundation-static.test.mjs +5 -6
- package/tests/mobile-phone-experience-static.test.mjs +1 -1
- package/tests/mobile-static.test.mjs +85 -50
- package/tests/native-parity.test.mjs +1 -1
- package/tests/open-issue-wizard-static.test.mjs +2 -3
- package/tests/optional-feature-migration-frontend.test.mjs +9 -5
- package/tests/persistent-ui-layout-static.test.mjs +13 -2
- package/tests/questionnaire-dialog.test.mjs +3 -3
- package/tests/remote-auth-settings-harness.test.mjs +43 -0
- package/tests/rpc-supervisor-host.test.mjs +11 -2
- package/tests/safety-guard-auto-review-harness.test.mjs +117 -0
- package/tests/safety-guard-auto-review-static.test.mjs +34 -0
- package/tests/sampling-native-controls-user-flow.test.mjs +752 -0
- package/tests/sampling-parameter-capabilities.test.mjs +167 -0
- package/tests/sampling-parameter-controls.test.mjs +241 -0
- package/tests/session-sampling-helper.test.mjs +228 -0
- package/tests/session-sampling-http.test.mjs +168 -0
- package/tests/session-sampling-ui-static.test.mjs +370 -0
- package/tests/session-summary-core.test.mjs +205 -10
- package/tests/side-panel-section-height-removal-static.test.mjs +34 -0
- package/tests/side-panel-section-reorder-static.test.mjs +3 -3
- package/tests/staged-content-hash-contract.test.mjs +52 -11
- package/tests/stream-lifecycle-core.test.mjs +134 -0
- package/tests/stream-output-controller.test.mjs +252 -0
- package/tests/stream-output-isolation-static.test.mjs +89 -0
- package/tests/streaming-ui-coupling.test.mjs +50 -0
- package/tests/subagent-gate-visibility.test.mjs +1 -1
- package/tests/subagent-launch-slots-static.test.mjs +1 -1
- package/tests/subagent-launch-slots.test.mjs +18 -1
- package/tests/theme-contract.test.mjs +104 -0
- package/tests/theme-customizer-static.test.mjs +82 -0
- package/tests/theme-scheme-mode.test.mjs +15 -0
- package/tests/ui-layout-settings.test.mjs +18 -1
- package/tests/update-api-harness.test.mjs +111 -0
- package/tests/update-commands.test.mjs +15 -45
- package/tests/update-executor-process-tree-harness.test.mjs +22 -0
- package/tests/update-journal-harness.test.mjs +59 -0
- package/tests/update-lock-multiprocess-harness.test.mjs +46 -0
- package/tests/update-owners.test.mjs +27 -0
- package/tests/update-plan.test.mjs +58 -0
- package/tests/update-resolver.test.mjs +56 -0
- package/tests/update-supervisor-harness.test.mjs +57 -0
- package/tests/update-tab-restore-harness.test.mjs +24 -0
- package/tests/update-verify.test.mjs +31 -0
- package/tests/workspace-files-live-updates-static.test.mjs +13 -4
- package/tests/workspace-session-summaries.test.mjs +288 -0
- package/webui-rpc-helper.mjs +119 -0
|
@@ -106,6 +106,10 @@ function generatedSummaryResponse() {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
async function installSummaryRoutes(page, requests, { configured = false, summary = null, generate = generatedSummaryResponse } = {}) {
|
|
109
|
+
const requestTabId = (route) => new URL(route.request().url()).searchParams.get("tab");
|
|
110
|
+
requests.getTabs = [];
|
|
111
|
+
requests.putTabs = [];
|
|
112
|
+
requests.generateTabs = [];
|
|
109
113
|
await page.route("**/api/commands?*", async (route) => {
|
|
110
114
|
await route.fulfill({
|
|
111
115
|
status: 200,
|
|
@@ -118,16 +122,21 @@ async function installSummaryRoutes(page, requests, { configured = false, summar
|
|
|
118
122
|
});
|
|
119
123
|
await page.route("**/api/session-summary/preferences?*", async (route) => {
|
|
120
124
|
const method = route.request().method();
|
|
125
|
+
const tabId = requestTabId(route);
|
|
121
126
|
if (method === "GET") {
|
|
122
127
|
requests.get += 1;
|
|
123
|
-
|
|
128
|
+
requests.getTabs.push(tabId);
|
|
129
|
+
const tabSummary = typeof summary === "function" ? summary(tabId) : summary;
|
|
130
|
+
await route.fulfill({ status: 200, contentType: "application/json", body: JSON.stringify({ ok: true, data: preferencesData({ configured, summary: tabSummary }) }) });
|
|
124
131
|
return;
|
|
125
132
|
}
|
|
133
|
+
requests.putTabs.push(tabId);
|
|
126
134
|
requests.put.push(JSON.parse(route.request().postData() || "{}"));
|
|
127
135
|
await route.fulfill({ status: 200, contentType: "application/json", body: JSON.stringify({ ok: true, data: preferencesData({ configured: true }) }) });
|
|
128
136
|
});
|
|
129
137
|
await page.route("**/api/session-summary/generate?*", async (route) => {
|
|
130
138
|
const request = JSON.parse(route.request().postData() || "{}");
|
|
139
|
+
requests.generateTabs.push(requestTabId(route));
|
|
131
140
|
requests.generate.push(request);
|
|
132
141
|
const response = await generate(request, requests.generate.length);
|
|
133
142
|
await route.fulfill({
|
|
@@ -143,7 +152,7 @@ test("first click opens confirmed setup, cancel has no side effect, and save ope
|
|
|
143
152
|
await installSummaryRoutes(page, requests);
|
|
144
153
|
await page.goto(baseURL);
|
|
145
154
|
|
|
146
|
-
const summaryButton = page.locator("
|
|
155
|
+
const summaryButton = page.locator(".terminal-tab.active[data-tab-id] > .terminal-tab-actions > .terminal-tab-summary-button");
|
|
147
156
|
await expect(summaryButton).toBeVisible();
|
|
148
157
|
await summaryButton.evaluate((button) => button.click());
|
|
149
158
|
await expect(page.locator("#nativeCommandDialog")).toBeVisible();
|
|
@@ -231,7 +240,7 @@ test("typed summary commands stay native, preserve failures, reset sessions, res
|
|
|
231
240
|
await route.fulfill({ status: 200, contentType: "application/json", body: JSON.stringify({ ok: true, data: {} }) });
|
|
232
241
|
});
|
|
233
242
|
await page.goto(baseURL);
|
|
234
|
-
await expect(page.locator("
|
|
243
|
+
await expect(page.locator(".terminal-tab.active[data-tab-id] > .terminal-tab-actions > .terminal-tab-summary-button")).toBeVisible();
|
|
235
244
|
|
|
236
245
|
const prompt = page.locator("#promptInput");
|
|
237
246
|
await prompt.fill("/summary");
|
|
@@ -269,3 +278,122 @@ test("typed summary commands stay native, preserve failures, reset sessions, res
|
|
|
269
278
|
await expect(page.locator("#tabBar [role=\"tab\"]")).toHaveCount(2);
|
|
270
279
|
await expect(page.locator("#sessionSummaryOverlay")).toBeHidden();
|
|
271
280
|
});
|
|
281
|
+
|
|
282
|
+
test("inactive and grouped tab actions keep setup, generation, and busy state scoped without activating the tab", async ({ page }) => {
|
|
283
|
+
const requests = { get: 0, put: [], generate: [] };
|
|
284
|
+
let releaseGeneration;
|
|
285
|
+
const generationReleased = new Promise((resolve) => { releaseGeneration = resolve; });
|
|
286
|
+
await installSummaryRoutes(page, requests, {
|
|
287
|
+
generate: async () => {
|
|
288
|
+
await generationReleased;
|
|
289
|
+
return generatedSummaryResponse();
|
|
290
|
+
},
|
|
291
|
+
});
|
|
292
|
+
await page.goto(baseURL);
|
|
293
|
+
await expect(page.locator(".terminal-tab[data-tab-id]").first()).toBeVisible();
|
|
294
|
+
const initialTabCount = await page.locator(".terminal-tab[data-tab-id]").count();
|
|
295
|
+
expect(initialTabCount).toBeGreaterThan(0);
|
|
296
|
+
await expect(page.locator(".terminal-tab-summary-button")).toHaveCount(initialTabCount);
|
|
297
|
+
|
|
298
|
+
const firstTabId = await page.locator(".terminal-tab[data-tab-id]").first().getAttribute("data-tab-id");
|
|
299
|
+
await page.locator("#newTabButton").evaluate((button) => button.click());
|
|
300
|
+
await page.locator("#newTabCurrentDirectoryButton").evaluate((button) => button.click());
|
|
301
|
+
const expectedTabCount = initialTabCount + 1;
|
|
302
|
+
await expect(page.locator(".terminal-tab[data-tab-id]")).toHaveCount(expectedTabCount);
|
|
303
|
+
await expect(page.locator(".terminal-tab-summary-button")).toHaveCount(expectedTabCount);
|
|
304
|
+
|
|
305
|
+
await page.reload();
|
|
306
|
+
await expect(page.locator(".terminal-tab[data-tab-id]")).toHaveCount(expectedTabCount);
|
|
307
|
+
await expect(page.locator(".terminal-tab-summary-button")).toHaveCount(expectedTabCount);
|
|
308
|
+
|
|
309
|
+
const activeTab = page.locator(".terminal-tab.active[data-tab-id]");
|
|
310
|
+
const activeTabId = await activeTab.getAttribute("data-tab-id");
|
|
311
|
+
expect(activeTabId).not.toBe(firstTabId);
|
|
312
|
+
const inactiveSummary = page.locator(`[data-tab-id="${firstTabId}"] > .terminal-tab-actions > .terminal-tab-summary-button`);
|
|
313
|
+
const activeSummary = page.locator(`[data-tab-id="${activeTabId}"] > .terminal-tab-actions > .terminal-tab-summary-button`);
|
|
314
|
+
await inactiveSummary.click();
|
|
315
|
+
await expect(page.locator("#nativeCommandDialog")).toBeVisible();
|
|
316
|
+
await expect(page.locator("#nativeCommandTitle")).toHaveText("/summary-setup");
|
|
317
|
+
await expect(page.locator(`[data-tab-id="${activeTabId}"]`)).toHaveClass(/active/);
|
|
318
|
+
|
|
319
|
+
await page.locator("#nativeCommandActions").getByRole("button", { name: "Save and generate" }).click();
|
|
320
|
+
await page.locator("#confirmationConfirmButton").click();
|
|
321
|
+
await expect.poll(() => requests.generate.length).toBe(1);
|
|
322
|
+
expect(requests.putTabs).toEqual([firstTabId]);
|
|
323
|
+
expect(requests.generateTabs).toEqual([firstTabId]);
|
|
324
|
+
await expect(inactiveSummary).toBeDisabled();
|
|
325
|
+
await expect(inactiveSummary).toHaveAttribute("aria-busy", "true");
|
|
326
|
+
await expect(activeSummary).toBeEnabled();
|
|
327
|
+
await expect(activeSummary).toHaveAttribute("aria-busy", "false");
|
|
328
|
+
await expect(page.locator(`[data-tab-id="${activeTabId}"]`)).toHaveClass(/active/);
|
|
329
|
+
|
|
330
|
+
releaseGeneration();
|
|
331
|
+
await expect(page.locator("#sessionSummaryOverlay")).toBeVisible();
|
|
332
|
+
await expect(page.locator("#sessionSummaryOverlayTitle")).toHaveText("Validated fixture title");
|
|
333
|
+
await expect(inactiveSummary).toBeEnabled();
|
|
334
|
+
await page.keyboard.press("Escape");
|
|
335
|
+
|
|
336
|
+
await page.locator(`.terminal-tab[data-tab-id="${activeTabId}"]`).dragTo(page.locator(`.terminal-tab[data-tab-id="${firstTabId}"]`));
|
|
337
|
+
const group = page.locator(".terminal-tab-custom-group");
|
|
338
|
+
await expect(group).toHaveCount(1);
|
|
339
|
+
await group.hover();
|
|
340
|
+
await expect(group.locator(".terminal-tab-group-item")).toHaveCount(2);
|
|
341
|
+
await expect(group.locator(".terminal-tab-group-item > .terminal-tab-actions > .terminal-tab-summary-button")).toHaveCount(2);
|
|
342
|
+
await group.locator(`[data-tab-id="${firstTabId}"] > .terminal-tab-actions > .terminal-tab-summary-button`).click();
|
|
343
|
+
await expect(page.locator("#sessionSummaryOverlayTitle")).toHaveText("Validated fixture title");
|
|
344
|
+
await expect(group.locator(`[data-tab-id="${activeTabId}"]`)).toHaveClass(/active/);
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
test("focus returns to a regenerated per-tab summary action after tab controls rerender", async ({ page }) => {
|
|
348
|
+
const requests = { get: 0, put: [], generate: [] };
|
|
349
|
+
await installSummaryRoutes(page, requests, { configured: true });
|
|
350
|
+
await page.goto(baseURL);
|
|
351
|
+
|
|
352
|
+
await expect(page.locator("#promptInput")).toBeFocused();
|
|
353
|
+
const summaryButton = page.locator(".terminal-tab.active[data-tab-id] > .terminal-tab-actions > .terminal-tab-summary-button, .terminal-tab-group.active .terminal-tab-group-item.active > .terminal-tab-actions > .terminal-tab-summary-button");
|
|
354
|
+
await expect(summaryButton).toHaveCount(1);
|
|
355
|
+
await summaryButton.evaluate((button) => button.click());
|
|
356
|
+
await expect(page.locator("#sessionSummaryOverlayTitle")).toHaveText("Validated fixture title");
|
|
357
|
+
await page.keyboard.press("Escape");
|
|
358
|
+
await expect(summaryButton).toBeFocused();
|
|
359
|
+
});
|
|
360
|
+
|
|
361
|
+
test("each terminal tab stacks Split and Summary across one horizontally divided action slot", async ({ page }) => {
|
|
362
|
+
const requests = { get: 0, put: [], generate: [] };
|
|
363
|
+
await installSummaryRoutes(page, requests, { configured: true });
|
|
364
|
+
await page.goto(baseURL);
|
|
365
|
+
|
|
366
|
+
await expect(page.locator("#splitTabButton")).toHaveCount(0);
|
|
367
|
+
const initialTabCount = await page.locator("[data-tab-id] > .terminal-tab-actions").count();
|
|
368
|
+
const activeGroup = page.locator(".terminal-tab-group.active");
|
|
369
|
+
if (await activeGroup.count()) await activeGroup.hover();
|
|
370
|
+
const activeActions = page.locator(".terminal-tab.active[data-tab-id] > .terminal-tab-actions, .terminal-tab-group.active .terminal-tab-group-item.active > .terminal-tab-actions");
|
|
371
|
+
await expect(activeActions).toHaveCount(1);
|
|
372
|
+
await expect(activeActions.locator(":scope > .terminal-tab-split-button")).toHaveCount(1);
|
|
373
|
+
await expect(activeActions.locator(":scope > .terminal-tab-summary-button")).toHaveCount(1);
|
|
374
|
+
const actionGeometry = await activeActions.evaluate((slot) => ({
|
|
375
|
+
slotWidth: slot.getBoundingClientRect().width,
|
|
376
|
+
splitWidth: slot.querySelector(".terminal-tab-split-button")?.getBoundingClientRect().width || 0,
|
|
377
|
+
summaryWidth: slot.querySelector(".terminal-tab-summary-button")?.getBoundingClientRect().width || 0,
|
|
378
|
+
slotHeight: slot.getBoundingClientRect().height,
|
|
379
|
+
tabHeight: slot.parentElement?.querySelector(":scope > .terminal-tab-button")?.getBoundingClientRect().height || 0,
|
|
380
|
+
splitHeight: slot.querySelector(".terminal-tab-split-button")?.getBoundingClientRect().height || 0,
|
|
381
|
+
summaryHeight: slot.querySelector(".terminal-tab-summary-button")?.getBoundingClientRect().height || 0,
|
|
382
|
+
}));
|
|
383
|
+
expect(Math.abs(actionGeometry.splitWidth - actionGeometry.slotWidth)).toBeLessThanOrEqual(1);
|
|
384
|
+
expect(Math.abs(actionGeometry.summaryWidth - actionGeometry.slotWidth)).toBeLessThanOrEqual(1);
|
|
385
|
+
expect(Math.abs(actionGeometry.slotHeight - actionGeometry.tabHeight)).toBeLessThan(1);
|
|
386
|
+
expect(Math.abs(actionGeometry.splitHeight - actionGeometry.summaryHeight)).toBeLessThan(1);
|
|
387
|
+
expect(Math.abs((actionGeometry.splitHeight + actionGeometry.summaryHeight) - actionGeometry.slotHeight)).toBeLessThan(2);
|
|
388
|
+
|
|
389
|
+
await activeActions.locator(":scope > .terminal-tab-split-button").click();
|
|
390
|
+
await expect(page.locator("[data-tab-id] > .terminal-tab-actions")).toHaveCount(initialTabCount + 1);
|
|
391
|
+
await expect(page.locator("#terminalSplitShell")).toBeVisible();
|
|
392
|
+
const splitTabId = await page.locator("#terminalSplitFrame").getAttribute("data-tab-id");
|
|
393
|
+
expect(splitTabId).toBeTruthy();
|
|
394
|
+
const splitControl = page.locator(`[data-tab-id="${splitTabId}"] > .terminal-tab-actions > .terminal-tab-split-button`);
|
|
395
|
+
await expect(splitControl).toHaveAttribute("aria-pressed", "true");
|
|
396
|
+
await splitControl.evaluate((button) => button.click());
|
|
397
|
+
await expect(page.locator("#terminalSplitShell")).toBeHidden();
|
|
398
|
+
await expect(splitControl).toHaveAttribute("aria-pressed", "false");
|
|
399
|
+
});
|