@firstpick/pi-package-webui 0.9.9 → 0.10.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/DEVELOPMENT.md +42 -13
- package/README.md +7 -7
- package/TECHNICAL.md +8 -8
- package/bin/pi-webui.mjs +197 -63
- package/index.ts +23 -33
- package/lib/git-workflow-preferences.mjs +51 -12
- package/lib/tui-model-profile-selector.mjs +183 -0
- package/lib/tui-resource-selector.mjs +173 -0
- package/package.json +1 -1
- package/public/app.js +220 -73
- package/public/index.html +2 -2
- package/public/service-worker.js +1 -1
- package/public/styles.css +63 -15
- package/tests/boot-failure-diagnostics.test.mjs +3 -3
- package/tests/browser/intercom-conversation-viewer.spec.mjs +76 -53
- package/tests/browser/user-noticeable-fixes.spec.mjs +51 -0
- package/tests/codex-fast-mode-static.test.mjs +2 -2
- package/tests/composer-action-grid-reorder-static.test.mjs +3 -3
- package/tests/control-visibility-static.test.mjs +3 -3
- package/tests/controls-layout-static.test.mjs +3 -3
- package/tests/durable-rpc-supervisor-harness.test.mjs +9 -0
- package/tests/events-tree-context-menu-static.test.mjs +3 -3
- package/tests/fast-mode-client-static.test.mjs +1 -1
- package/tests/feature-decision-output-popup-static.test.mjs +2 -2
- package/tests/file-viewer-image-static.test.mjs +3 -3
- package/tests/fixtures/fake-pi.mjs +3 -3
- package/tests/guided-git-activation-static.test.mjs +24 -12
- package/tests/guided-git-fallback-runtime.test.mjs +209 -270
- package/tests/guided-git-fallback-ui-static.test.mjs +2 -2
- package/tests/guided-git-message-reliability-static.test.mjs +2 -1
- package/tests/guided-git-optional-feature.test.mjs +8 -5
- package/tests/http-endpoints-harness.test.mjs +22 -4
- package/tests/intercom-conversation-viewer-static.test.mjs +7 -6
- package/tests/intercom-tag-layout-static.test.mjs +35 -16
- package/tests/intercom-tag-overflow-layout.test.mjs +87 -0
- package/tests/main-output-loading-static.test.mjs +3 -3
- package/tests/middle-button-drag-scroll-static.test.mjs +3 -3
- package/tests/mobile-continuity-tablet-static.test.mjs +3 -3
- package/tests/mobile-foundation-static.test.mjs +3 -3
- package/tests/mobile-phone-experience-static.test.mjs +1 -1
- package/tests/mobile-static.test.mjs +11 -6
- package/tests/open-issue-wizard-static.test.mjs +1 -1
- package/tests/persistent-ui-layout-static.test.mjs +3 -3
- package/tests/prompt-input-vertical-scroll-static.test.mjs +3 -3
- package/tests/questionnaire-dialog.test.mjs +3 -3
- package/tests/remote-auth-settings-harness.test.mjs +18 -3
- package/tests/resource-tui-extension.test.mjs +2 -1
- package/tests/session-sampling-ui-static.test.mjs +3 -3
- package/tests/side-panel-section-height-removal-static.test.mjs +3 -3
- package/tests/subagent-observability-static.test.mjs +2 -2
- package/tests/syntax-highlighting-static.test.mjs +3 -3
- package/tests/theme-customizer-static.test.mjs +1 -1
- package/tests/tui-model-profile-selector.test.mjs +102 -0
- package/tests/tui-resource-selector.test.mjs +74 -0
- package/tests/webui-settings-locking.test.mjs +32 -1
- package/tests/windows-drive-cwd-picker-static.test.mjs +3 -3
|
@@ -144,55 +144,71 @@ test.afterAll(async () => {
|
|
|
144
144
|
await rm(tempRoot, { recursive: true, force: true }).catch(() => {});
|
|
145
145
|
});
|
|
146
146
|
|
|
147
|
-
test("the 32-conversation
|
|
147
|
+
test("the 32-conversation strip reaches half the input and keeps overflow chats recognizable", async ({ page }) => {
|
|
148
148
|
await page.setViewportSize({ width: 900, height: 760 });
|
|
149
149
|
await page.goto(baseURL);
|
|
150
150
|
const container = page.locator("#intercomConversationTags");
|
|
151
|
-
const tags = container.locator(":scope > .composer-intercom-tag");
|
|
152
|
-
const
|
|
153
|
-
const
|
|
151
|
+
const tags = container.locator(":scope > .composer-intercom-tag[data-intercom-conversation-id]");
|
|
152
|
+
const overflow = container.locator(":scope > .composer-intercom-tag.overflow");
|
|
153
|
+
const menu = container.locator(":scope > .composer-intercom-overflow-menu");
|
|
154
154
|
|
|
155
155
|
await expect(tags).toHaveCount(expectedConversationCount);
|
|
156
|
-
await expect(
|
|
157
|
-
|
|
156
|
+
await expect(overflow).toBeVisible();
|
|
157
|
+
const hiddenCount = Number((await overflow.textContent())?.slice(1));
|
|
158
|
+
assert.ok(hiddenCount > 0 && hiddenCount < expectedConversationCount, `the desktop strip should keep some complete tags visible and hide the rest (${hiddenCount})`);
|
|
158
159
|
|
|
159
160
|
const layout = await container.evaluate((element) => {
|
|
160
161
|
const containerRect = element.getBoundingClientRect();
|
|
161
|
-
const
|
|
162
|
+
const inputRect = document.querySelector("#promptInput").getBoundingClientRect();
|
|
163
|
+
const visibleRects = [...element.querySelectorAll(":scope > .composer-intercom-tag:not([hidden])")].map((tag) => tag.getBoundingClientRect());
|
|
164
|
+
const visibleConversationRects = [...element.querySelectorAll(":scope > .composer-intercom-tag[data-intercom-conversation-id]:not([hidden])")].map((tag) => tag.getBoundingClientRect());
|
|
165
|
+
const overflowRect = element.querySelector(":scope > .composer-intercom-tag.overflow").getBoundingClientRect();
|
|
166
|
+
const firstConversationRect = visibleConversationRects[0];
|
|
162
167
|
return {
|
|
163
|
-
|
|
164
|
-
|
|
168
|
+
containerWidth: containerRect.width,
|
|
169
|
+
inputWidth: inputRect.width,
|
|
165
170
|
rootFontSize: Number.parseFloat(getComputedStyle(document.documentElement).fontSize),
|
|
166
|
-
widths:
|
|
167
|
-
|
|
168
|
-
|
|
171
|
+
widths: visibleConversationRects.map((rect) => rect.width),
|
|
172
|
+
rowCenters: visibleRects.map((rect) => rect.top + rect.height / 2),
|
|
173
|
+
firstConversationRightGap: containerRect.right - firstConversationRect.right,
|
|
174
|
+
firstConversationLeft: firstConversationRect.left,
|
|
175
|
+
overflowLeft: overflowRect.left,
|
|
176
|
+
allContained: visibleRects.every((rect) => rect.left >= containerRect.left - 0.5 && rect.right <= containerRect.right + 0.5),
|
|
169
177
|
};
|
|
170
178
|
});
|
|
171
|
-
assert.ok(layout.
|
|
172
|
-
assert.ok(layout.
|
|
173
|
-
assert.ok(layout.
|
|
174
|
-
assert.ok(Math.min(...layout.
|
|
175
|
-
assert.ok(layout.
|
|
179
|
+
assert.ok(layout.containerWidth <= layout.inputWidth / 2 + 1, `the desktop tag strip should stop at the input midpoint (${layout.containerWidth} > ${layout.inputWidth / 2})`);
|
|
180
|
+
assert.ok(layout.containerWidth >= layout.inputWidth * 0.45, `the desktop tag strip should use the available half-width instead of the old compact cap (${layout.containerWidth} < ${layout.inputWidth * 0.45})`);
|
|
181
|
+
assert.ok(layout.allContained, "every visible desktop conversation tag should stay within the measured strip");
|
|
182
|
+
assert.ok(Math.max(...layout.rowCenters) - Math.min(...layout.rowCenters) <= 1, "visible conversations and +X should remain vertically aligned on one row");
|
|
183
|
+
assert.ok(layout.firstConversationRightGap <= 1, `the newest conversation should start at the right edge (${layout.firstConversationRightGap}px gap)`);
|
|
184
|
+
assert.ok(layout.firstConversationLeft > layout.overflowLeft, "older conversations and +X should extend left toward the input midpoint");
|
|
185
|
+
assert.ok(Math.min(...layout.widths) >= 44, `visible desktop conversation targets should remain recognizable (minimum ${Math.min(...layout.widths)}px)`);
|
|
186
|
+
assert.ok(Math.max(...layout.widths) <= 13 * layout.rootFontSize + 1, `direct conversation tags should stay within 13rem (maximum ${Math.max(...layout.widths)}px)`);
|
|
176
187
|
|
|
177
|
-
await
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
await expect(
|
|
182
|
-
const
|
|
183
|
-
|
|
188
|
+
await overflow.click();
|
|
189
|
+
await expect(menu).toBeVisible();
|
|
190
|
+
await expect(overflow).toHaveAttribute("aria-expanded", "true");
|
|
191
|
+
const hiddenItems = menu.locator(":scope > .composer-intercom-overflow-menu-item:not([hidden])");
|
|
192
|
+
await expect(hiddenItems).toHaveCount(hiddenCount);
|
|
193
|
+
const longMenuItem = hiddenItems.filter({ hasText: longPeerName });
|
|
194
|
+
await expect(longMenuItem).toHaveCount(1);
|
|
195
|
+
await expect(longMenuItem).toBeVisible();
|
|
196
|
+
const fullVisualLabel = await longMenuItem.locator(".composer-intercom-tag-label").textContent();
|
|
197
|
+
assert.ok(fullVisualLabel?.includes(longPeerName), "the overflow menu should retain the full long conversation label in the DOM");
|
|
198
|
+
await expect(longMenuItem).toHaveAttribute("aria-label", `Open agent conversation ${fullVisualLabel}`);
|
|
199
|
+
await expect(longMenuItem).toHaveAttribute("title", `${fullVisualLabel} · 1 message`);
|
|
184
200
|
|
|
185
|
-
await
|
|
201
|
+
await longMenuItem.click();
|
|
186
202
|
await expect(page.locator("#intercomConversationDialog")).toBeVisible();
|
|
187
203
|
await expect(page.locator("#intercomConversationParticipants")).toContainText(`${longPeerName} (${longPeerId})`);
|
|
188
204
|
await expect(page.locator("#intercomConversationTranscript")).toContainText("Long-label conversation selected correctly");
|
|
189
205
|
await page.locator("#intercomConversationCloseButton").click();
|
|
190
|
-
await expect(
|
|
206
|
+
await expect(overflow).toBeFocused();
|
|
191
207
|
});
|
|
192
208
|
|
|
193
209
|
test("conversation tag opens a safe chat dialog, refreshes, and restores focus", async ({ page }) => {
|
|
194
210
|
await page.goto(baseURL);
|
|
195
|
-
const tags = page.locator("#intercomConversationTags .composer-intercom-tag");
|
|
211
|
+
const tags = page.locator("#intercomConversationTags > .composer-intercom-tag[data-intercom-conversation-id]");
|
|
196
212
|
const tag = tags.filter({
|
|
197
213
|
has: page.locator(".composer-intercom-tag-label").filter({ hasText: /↔ Browser Peer \(peer-browser\)$/ }),
|
|
198
214
|
});
|
|
@@ -261,7 +277,7 @@ test("conversation tag opens a safe chat dialog, refreshes, and restores focus",
|
|
|
261
277
|
await expect(stableTagLabel).toHaveAttribute("data-stable-visual-marker", "retained");
|
|
262
278
|
});
|
|
263
279
|
|
|
264
|
-
test("conversation
|
|
280
|
+
test("conversation overflow remains reachable through the narrow composer disclosure", async ({ page }) => {
|
|
265
281
|
await page.setViewportSize({ width: 390, height: 760 });
|
|
266
282
|
await page.goto(baseURL);
|
|
267
283
|
const more = page.locator("#composerActionsButton");
|
|
@@ -269,39 +285,46 @@ test("conversation tags remain reachable through the narrow composer disclosure"
|
|
|
269
285
|
await more.focus();
|
|
270
286
|
await more.press("Enter");
|
|
271
287
|
const tags = page.locator("#intercomConversationTags");
|
|
272
|
-
const tagButtons = tags.locator(":scope > .composer-intercom-tag");
|
|
273
|
-
const
|
|
274
|
-
has: page.locator(".composer-intercom-tag-label").filter({ hasText: /↔ Browser Peer \(peer-browser\)$/ }),
|
|
275
|
-
});
|
|
288
|
+
const tagButtons = tags.locator(":scope > .composer-intercom-tag[data-intercom-conversation-id]");
|
|
289
|
+
const overflow = tags.locator(":scope > .composer-intercom-tag.overflow");
|
|
276
290
|
await expect(tags).toBeVisible();
|
|
277
291
|
await expect(tagButtons).toHaveCount(expectedConversationCount);
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}
|
|
292
|
+
await expect(overflow).toBeVisible();
|
|
293
|
+
await expect(overflow).toHaveCSS("min-height", "44px");
|
|
294
|
+
|
|
282
295
|
const layout = await tags.evaluate((element) => {
|
|
283
296
|
const containerRect = element.getBoundingClientRect();
|
|
284
|
-
const
|
|
297
|
+
const contextStyle = getComputedStyle(element.parentElement);
|
|
298
|
+
const contextContentWidth = element.parentElement.clientWidth
|
|
299
|
+
- Number.parseFloat(contextStyle.paddingLeft)
|
|
300
|
+
- Number.parseFloat(contextStyle.paddingRight);
|
|
301
|
+
const visibleRects = [...element.querySelectorAll(":scope > .composer-intercom-tag:not([hidden])")].map((button) => button.getBoundingClientRect());
|
|
285
302
|
return {
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
widths:
|
|
289
|
-
heights:
|
|
290
|
-
|
|
291
|
-
allContained:
|
|
303
|
+
containerWidth: containerRect.width,
|
|
304
|
+
contextContentWidth,
|
|
305
|
+
widths: visibleRects.map((rect) => rect.width),
|
|
306
|
+
heights: visibleRects.map((rect) => rect.height),
|
|
307
|
+
rowCenters: visibleRects.map((rect) => rect.top + rect.height / 2),
|
|
308
|
+
allContained: visibleRects.every((rect) => rect.left >= containerRect.left - 0.5 && rect.right <= containerRect.right + 0.5),
|
|
292
309
|
};
|
|
293
310
|
});
|
|
294
|
-
assert.ok(layout.
|
|
295
|
-
assert.ok(layout.
|
|
296
|
-
assert.ok(Math.min(...layout.widths) >= 44, `every narrow touch target should be at least 44px wide (minimum ${Math.min(...layout.widths)})`);
|
|
297
|
-
assert.ok(Math.min(...layout.heights) >= 44, `every narrow touch target should be at least 44px high (minimum ${Math.min(...layout.heights)})`);
|
|
298
|
-
assert.ok(layout.
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
await
|
|
302
|
-
|
|
311
|
+
assert.ok(layout.containerWidth >= layout.contextContentWidth - 1, `the narrow conversation strip should use the full disclosed row (${layout.containerWidth} < ${layout.contextContentWidth})`);
|
|
312
|
+
assert.ok(layout.allContained, "every visible narrow conversation tag should stay within the tag container");
|
|
313
|
+
assert.ok(Math.min(...layout.widths) >= 44, `every visible narrow touch target should be at least 44px wide (minimum ${Math.min(...layout.widths)})`);
|
|
314
|
+
assert.ok(Math.min(...layout.heights) >= 44, `every visible narrow touch target should be at least 44px high (minimum ${Math.min(...layout.heights)})`);
|
|
315
|
+
assert.ok(Math.max(...layout.rowCenters) - Math.min(...layout.rowCenters) <= 1, "narrow conversation tags should stay vertically aligned on one row before disclosure");
|
|
316
|
+
|
|
317
|
+
const hiddenCount = Number((await overflow.textContent())?.slice(1));
|
|
318
|
+
await overflow.click();
|
|
319
|
+
const hiddenItems = tags.locator(":scope > .composer-intercom-overflow-menu > .composer-intercom-overflow-menu-item:not([hidden])");
|
|
320
|
+
await expect(hiddenItems).toHaveCount(hiddenCount);
|
|
321
|
+
for (let index = 0; index < hiddenCount; index += 1) await expect(hiddenItems.nth(index)).toHaveCSS("min-height", "44px");
|
|
322
|
+
const longMenuItem = hiddenItems.filter({ hasText: longPeerName });
|
|
323
|
+
await expect(longMenuItem).toBeVisible();
|
|
324
|
+
await longMenuItem.focus();
|
|
325
|
+
await longMenuItem.press("Enter");
|
|
303
326
|
await expect(page.locator("#intercomConversationDialog")).toBeVisible();
|
|
304
|
-
await expect(page.locator("#intercomConversationParticipants")).toContainText(
|
|
327
|
+
await expect(page.locator("#intercomConversationParticipants")).toContainText(`${longPeerName} (${longPeerId})`);
|
|
305
328
|
await expect(page.locator("#intercomConversationCloseButton")).toBeVisible();
|
|
306
329
|
});
|
|
307
330
|
|
|
@@ -202,3 +202,54 @@ test("Escape closes the composer options menu while its trigger keeps focus", as
|
|
|
202
202
|
await page.keyboard.press("Escape");
|
|
203
203
|
await expect(panel).toBeHidden();
|
|
204
204
|
});
|
|
205
|
+
|
|
206
|
+
test("a group with more than eight tabs keeps every titled row reachable", async ({ page }) => {
|
|
207
|
+
await page.setViewportSize({ width: 1280, height: 520 });
|
|
208
|
+
await page.goto(baseURL);
|
|
209
|
+
await expect(page.locator("#promptInput")).toBeVisible();
|
|
210
|
+
|
|
211
|
+
const groupedTabs = [];
|
|
212
|
+
for (let index = 1; index <= 9; index += 1) {
|
|
213
|
+
const title = `Overflow title ${index}`;
|
|
214
|
+
const response = await page.request.post(`${baseURL}/api/tabs`, { data: { title } });
|
|
215
|
+
assert.equal(response.ok(), true, `creating ${title} should succeed`);
|
|
216
|
+
const payload = await response.json();
|
|
217
|
+
groupedTabs.push({ id: payload.data.tab.id, title });
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
await page.evaluate((tabs) => {
|
|
221
|
+
localStorage.setItem("pi-webui-terminal-custom-groups-v1", JSON.stringify({
|
|
222
|
+
version: 1,
|
|
223
|
+
groups: [{ id: "overflow-group", title: "Overflow group", tabIds: tabs.map((tab) => tab.id) }],
|
|
224
|
+
}));
|
|
225
|
+
}, groupedTabs);
|
|
226
|
+
await page.reload();
|
|
227
|
+
|
|
228
|
+
const group = page.locator(".terminal-tab-custom-group");
|
|
229
|
+
await expect(group).toHaveCount(1);
|
|
230
|
+
await group.hover();
|
|
231
|
+
const menu = group.locator(".terminal-tab-group-menu");
|
|
232
|
+
await expect(menu).toBeVisible();
|
|
233
|
+
await expect(menu.locator(".terminal-tab-group-item")).toHaveCount(groupedTabs.length);
|
|
234
|
+
assert.deepEqual(
|
|
235
|
+
await menu.locator(".terminal-tab-group-item .terminal-tab-title").allTextContents(),
|
|
236
|
+
groupedTabs.map((tab) => tab.title),
|
|
237
|
+
"the group menu should preserve every server-provided tab title",
|
|
238
|
+
);
|
|
239
|
+
|
|
240
|
+
const bounds = await menu.evaluate((node) => {
|
|
241
|
+
const rect = node.getBoundingClientRect();
|
|
242
|
+
return { bottom: rect.bottom, viewportHeight: window.innerHeight, clientHeight: node.clientHeight, scrollHeight: node.scrollHeight };
|
|
243
|
+
});
|
|
244
|
+
assert.ok(bounds.bottom <= bounds.viewportHeight - 16, `the group menu should stay inside the viewport: ${JSON.stringify(bounds)}`);
|
|
245
|
+
assert.ok(bounds.scrollHeight > bounds.clientHeight, `nine group rows should use the bounded menu scroller: ${JSON.stringify(bounds)}`);
|
|
246
|
+
|
|
247
|
+
await menu.evaluate((node) => { node.scrollTop = node.scrollHeight; });
|
|
248
|
+
const lastRow = menu.locator(".terminal-tab-group-item").last();
|
|
249
|
+
const lastBounds = await lastRow.evaluate((node) => {
|
|
250
|
+
const row = node.getBoundingClientRect();
|
|
251
|
+
const scroller = node.parentElement.getBoundingClientRect();
|
|
252
|
+
return { rowTop: row.top, rowBottom: row.bottom, scrollerTop: scroller.top, scrollerBottom: scroller.bottom };
|
|
253
|
+
});
|
|
254
|
+
assert.ok(lastBounds.rowTop >= lastBounds.scrollerTop && lastBounds.rowBottom <= lastBounds.scrollerBottom, `the final titled row should be reachable by scrolling: ${JSON.stringify(lastBounds)}`);
|
|
255
|
+
});
|
|
@@ -55,7 +55,7 @@ assert.match(app, /statusKey === CODEX_FAST_MODE_STATUS_KEY[\s\S]*?applyCodexFas
|
|
|
55
55
|
assert.match(technical, /## Normal and compact output[\s\S]*?select \*\*Compact\*\*[\s\S]*?`compact-v1`/, "technical reference should document Compact mode with the stable identifier");
|
|
56
56
|
assert.match(development, /### Codex subscription Fast mode[\s\S]*?service_tier: "priority"[\s\S]*?1\.5× faster[\s\S]*?2× Standard credits[\s\S]*?2\.5×/, "development guide should document Fast-mode integration and cost semantics");
|
|
57
57
|
// Intent preserved: browser-asset changes must advance the coherent cache tuple.
|
|
58
|
-
assert.match(serviceWorker, /pi-webui-pwa-
|
|
59
|
-
assert.match(html, /data-app-src="\/app\.js\?v=
|
|
58
|
+
assert.match(serviceWorker, /pi-webui-pwa-v145/, "PWA cache identity should be bumped for changed browser assets");
|
|
59
|
+
assert.match(html, /data-app-src="\/app\.js\?v=177"/, "browser module URL should be cache-busted for Fast-mode wiring");
|
|
60
60
|
|
|
61
61
|
console.log("codex-fast-mode-static.test.mjs passed");
|
|
@@ -57,8 +57,8 @@ assert.match(app, /function initializeComposerActionOrdering\(\)[\s\S]*MutationO
|
|
|
57
57
|
assert.match(app, /event\.key === COMPOSER_ACTION_ORDER_STORAGE_KEY\) restoreComposerActionOrder\(\)[\s\S]*event\.key === COMPOSER_ACTION_LAYOUT_STORAGE_KEY\) restoreComposerActionSlotLayout\(\)/, "other tabs should apply persisted composer order and sparse-layout changes");
|
|
58
58
|
assert.match(app, /initializeComposerActionOrdering\(\);[\s\S]*restoreSidePanelSectionOrder\(\);/, "composer ordering should initialize during guarded app startup");
|
|
59
59
|
|
|
60
|
-
assert.match(html, /styles\.css\?v=
|
|
61
|
-
assert.match(html, /app\.js\?v=
|
|
62
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
60
|
+
assert.match(html, /styles\.css\?v=145/, "changed composer styles should advance the stylesheet revision");
|
|
61
|
+
assert.match(html, /app\.js\?v=177/, "changed composer behavior should advance the app revision");
|
|
62
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v145"/, "changed browser assets should advance the PWA cache identity");
|
|
63
63
|
|
|
64
64
|
console.log("composer-action-grid-reorder-static.test.mjs passed");
|
|
@@ -348,10 +348,10 @@ assert.match(
|
|
|
348
348
|
|
|
349
349
|
assert.match(
|
|
350
350
|
serviceWorker,
|
|
351
|
-
/const CACHE_NAME = "pi-webui-pwa-
|
|
351
|
+
/const CACHE_NAME = "pi-webui-pwa-v145";/,
|
|
352
352
|
"browser asset changes should advance the PWA cache identity",
|
|
353
353
|
);
|
|
354
|
-
assert.match(html, /styles\.css\?v=
|
|
355
|
-
assert.match(html, /data-app-src="\/app\.js\?v=
|
|
354
|
+
assert.match(html, /styles\.css\?v=145/, "visibility styles should advance the stylesheet query revision");
|
|
355
|
+
assert.match(html, /data-app-src="\/app\.js\?v=177"/, "visibility behavior should advance the app query revision");
|
|
356
356
|
|
|
357
357
|
console.log("control-visibility-static.test.mjs passed");
|
|
@@ -15,8 +15,8 @@ assert.equal((html.match(/class="control-row-label"[^>]*data-tooltip=/g) || []).
|
|
|
15
15
|
assert.match(app, /function initializeControlSettingTooltips\(\)[\s\S]*#sidePanelSectionControls \.control-row-label\[data-tooltip\][\s\S]*bindStyledTooltipEvents\(label\)[\s\S]*showFooterTooltip\(label\)/, "Controls help should use the viewport-safe floating tooltip for hover and keyboard access");
|
|
16
16
|
assert.match(html, /class="control-row remote-auth-control-row" hidden[\s\S]*id="remoteAuthToggle"/, "optional PIN protection should retain its guarded visibility");
|
|
17
17
|
assert.match(app, /remoteAuthToggle\?\.closest\("\.remote-auth-control-row"\)[\s\S]*remoteAuthRow\.hidden = false/, "loading remote status should reveal the optional PIN protection setting");
|
|
18
|
-
assert.match(html, /styles\.css\?v=
|
|
19
|
-
assert.match(html, /app\.js\?v=
|
|
20
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
18
|
+
assert.match(html, /styles\.css\?v=145/, "Controls stylesheet changes should advance the cache query");
|
|
19
|
+
assert.match(html, /app\.js\?v=177/, "Controls tooltip wiring should advance the app cache query");
|
|
20
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v145"/, "Controls browser assets should advance the PWA cache identity");
|
|
21
21
|
|
|
22
22
|
console.log("controls-layout-static.test.mjs passed");
|
|
@@ -170,6 +170,13 @@ try {
|
|
|
170
170
|
));
|
|
171
171
|
assert.equal(replacementStartup.cwd, changedCwd, "replacement child process should actually run in the requested cwd");
|
|
172
172
|
|
|
173
|
+
const featureRoutingStatus = await request("/api/prompt", { method: "POST", body: { tab: observedTabId, message: "fixture feature decision clear" } });
|
|
174
|
+
assert.equal(featureRoutingStatus.status, 200, "feature-routing capability status must be accepted before the server restarts");
|
|
175
|
+
await waitFor("feature-routing supervisor metadata", async () => {
|
|
176
|
+
const supervisorState = await readSupervisorState(paths);
|
|
177
|
+
return supervisorState?.tabs?.find((tab) => tab.id === observedTabId)?.metadata?.featureSystemPromptDetected === true;
|
|
178
|
+
});
|
|
179
|
+
|
|
173
180
|
const controlledPrompt = await request("/api/prompt", { method: "POST", body: { tab: observedTabId, message: streamPrompt } });
|
|
174
181
|
assert.equal(controlledPrompt.status, 200, "controlled-restart prompt must be accepted once");
|
|
175
182
|
const preRestartTab = (await tabs())[0];
|
|
@@ -219,6 +226,8 @@ try {
|
|
|
219
226
|
const reconnectEvents = await initialSseEvents(observedTabId);
|
|
220
227
|
const connectedEvent = reconnectEvents.find((event) => event.type === "webui_connected");
|
|
221
228
|
const replayGapEvent = reconnectEvents.find((event) => event.type === "webui_supervisor_replay_gap");
|
|
229
|
+
const featureRoutingReplay = reconnectEvents.find((event) => event.type === "extension_ui_request" && event.method === "setStatus" && event.statusKey === "feature-decision-output");
|
|
230
|
+
assert.equal(featureRoutingReplay?.replayed, true, "replacement server must replay persisted feature-routing capability evidence before another prompt");
|
|
222
231
|
assert.equal(connectedEvent?.supervisorReplayGap, true, "actual replacement server must report a truthful cursor-less replay gap");
|
|
223
232
|
assert.equal(Object.hasOwn(connectedEvent || {}, "supervisorGap"), false, "replacement server must use the browser's canonical replay-gap field");
|
|
224
233
|
assert.equal(replayGapEvent?.supervisorReplayGap, true, "replacement SSE must explicitly warn that authoritative replay recovery ran");
|
|
@@ -124,8 +124,8 @@ assert.match(styles, /\.event-log\[data-display-mode="compact"\] \.event\[data-e
|
|
|
124
124
|
assert.match(styles, /\.event-tree-context-menu \{[\s\S]*max-width: calc\(100vw - 1rem\)/, "the dedicated menu should remain viewport bounded");
|
|
125
125
|
|
|
126
126
|
// Cache tuple for this browser-asset change.
|
|
127
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
128
|
-
assert.match(html, /styles\.css\?v=
|
|
129
|
-
assert.match(html, /data-app-src="\/app\.js\?v=
|
|
127
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v145";/, "the PWA cache identity should advance");
|
|
128
|
+
assert.match(html, /styles\.css\?v=145/, "compact-mode styles should advance the stylesheet revision");
|
|
129
|
+
assert.match(html, /data-app-src="\/app\.js\?v=177"/, "the app query revision should advance");
|
|
130
130
|
|
|
131
131
|
console.log("events-tree-context-menu-static.test.mjs passed");
|
|
@@ -159,7 +159,7 @@ assert.match(worker, /pi-webui-pwa-v\d+[\s\S]*?"\/fast-output-live\.mjs"/, "PWA
|
|
|
159
159
|
assert.match(html, /<label for="fastOutputModeSelect">Compact mode \(Experimental\)<\/label>/, "the sidebar should mark compact mode as experimental");
|
|
160
160
|
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");
|
|
161
161
|
// Intent preserved: the guarded PWA entry point must advance whenever app wiring changes.
|
|
162
|
-
assert.match(html, /id="webuiBootLoader"[^>]*data-app-src="\/app\.js\?v=
|
|
162
|
+
assert.match(html, /id="webuiBootLoader"[^>]*data-app-src="\/app\.js\?v=177"/, "the guarded PWA entry point should cache-bust browser wiring");
|
|
163
163
|
assert.match(JSON.parse(packageRaw).scripts.check, /node --check public\/fast-output-live\.mjs/, "package checks should parse the compact helper");
|
|
164
164
|
|
|
165
165
|
const events = createFastModeOutputEvents();
|
|
@@ -166,7 +166,7 @@ assert.match(functionSource("closeTerminalTabs"), /clearFeatureDecisionStateForT
|
|
|
166
166
|
assert.match(app, /case "webui_connected":[\s\S]*clearFeatureDecisionStateForTab\(connectedTabId, \{ render: true \}\)[\s\S]*scheduleForegroundReconcile\("event stream reconnect", 0\)/, "reconnect should clear local state before authoritative replay");
|
|
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
|
-
assert.match(html, /\/styles\.css\?v=
|
|
170
|
-
assert.match(html, /\/app\.js\?v=
|
|
169
|
+
assert.match(html, /\/styles\.css\?v=145/, "integrated stylesheet changes should advance the cache query");
|
|
170
|
+
assert.match(html, /\/app\.js\?v=177/, "integrated app changes should advance the cache query");
|
|
171
171
|
|
|
172
172
|
console.log("feature decision-output popup static checks passed");
|
|
@@ -62,8 +62,8 @@ assert.match(css, /\.file-viewer-image img \{[\s\S]*max-width: 100%;[\s\S]*max-h
|
|
|
62
62
|
assert.match(readme, /PNG, JPEG, GIF, WebP, and AVIF/i, "the Files panel guide should list supported image formats");
|
|
63
63
|
assert.match(technical, /supported raster images[\s\S]*2 MiB/i, "the advanced reference should document image support and its size limit");
|
|
64
64
|
assert.match(development, /kind: "image"[\s\S]*base64/i, "the contributor guide should document the image response contract");
|
|
65
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
66
|
-
assert.match(html, /styles\.css\?v=
|
|
67
|
-
assert.match(html, /app\.js\?v=
|
|
65
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v145"/, "changed viewer assets should advance the PWA cache identity");
|
|
66
|
+
assert.match(html, /styles\.css\?v=145/, "changed image styles should advance the stylesheet revision");
|
|
67
|
+
assert.match(html, /app\.js\?v=177/, "changed image rendering should advance the app revision");
|
|
68
68
|
|
|
69
69
|
console.log("file viewer image static tests passed");
|
|
@@ -1600,9 +1600,9 @@ rl.on("line", (line) => {
|
|
|
1600
1600
|
{ name: "workflow", source: "extension", description: "Run and inspect JavaScript workflows" },
|
|
1601
1601
|
...(guidedGitActivationEnabled ? [
|
|
1602
1602
|
{ name: "git-guided-workflow", source: "extension", description: "Start Guided Git" },
|
|
1603
|
-
{ name: "git-staged-msg", source: "
|
|
1604
|
-
{ name: "git-branch-name", source: "
|
|
1605
|
-
{ name: "pr", source: "
|
|
1603
|
+
{ name: "git-staged-msg", source: "extension", description: "Generate commit messages" },
|
|
1604
|
+
{ name: "git-branch-name", source: "extension", description: "Generate branch names" },
|
|
1605
|
+
{ name: "pr", source: "extension", description: "Generate PR text" },
|
|
1606
1606
|
] : []),
|
|
1607
1607
|
...(statsPromptContextEnabled ? [{ name: "stats-webui", source: "extension", description: "Publish fixture stats dashboard" }] : []),
|
|
1608
1608
|
],
|
|
@@ -22,8 +22,10 @@ test("Guided Git activation is intercepted before generic status rendering and b
|
|
|
22
22
|
assert.match(app, /function handleInactiveTabEvent\(event\) \{\n if \(handleGuidedGitActivationRequest\(event\)\) return;/u);
|
|
23
23
|
assert.match(app, /guidedGitActivationController\.consume\(request, async \(tabId, activationIsCurrent\)/u);
|
|
24
24
|
assert.match(app, /startGitWorkflow\(tabId, \{ activationIsCurrent \}\)/u, "tab reset or close must invalidate an asynchronous activation start");
|
|
25
|
+
assert.match(app, /api\("\/api\/git-workflow\/preferences\?includeModels=false", \{ tabId \}\)/u, "configured startup must not wait for the setup-only model catalog RPC");
|
|
26
|
+
assert.match(server, /includeModels = url\.searchParams\.get\("includeModels"\) !== "false"[\s\S]*gitWorkflowPreferencesData\(tab, \{ includeModels \}\)/u, "the preferences route must expose the explicit lightweight startup read");
|
|
25
27
|
assert.match(app, /openNativeGitWorkflowSetupDialog\(\{\s+tabId,\s+activationIsCurrent,\s+onSaved: \(\) => startGitWorkflow\(tabId, \{ skipSetup: true, activationIsCurrent \}\),\s+\}\)/u, "setup and its local continuation must preserve the envelope tab and the same activation owner");
|
|
26
|
-
assert.match(app, /async function openNativeGitWorkflowSetupDialog\(\{ onSaved, tabId = activeTabId, activationIsCurrent = \(\) => true \} = \{\}\)[\s\S]*nativeCommandTabId = tabId[\s\S]*nativeCommandApi\("\/api\/git-workflow\/preferences", \{ tabId \}\)[\s\S]*const targetState = tabId === activeTabId \? currentState : tabStateCache\.get\(tabId\)/u, "setup loads
|
|
28
|
+
assert.match(app, /async function openNativeGitWorkflowSetupDialog\(\{ onSaved, tabId = activeTabId, activationIsCurrent = \(\) => true \} = \{\}\)[\s\S]*nativeCommandTabId = tabId[\s\S]*nativeCommandApi\("\/api\/git-workflow\/preferences", \{ tabId \}\)[\s\S]*const targetState = tabId === activeTabId \? currentState : tabStateCache\.get\(tabId\)/u, "setup still loads the full model catalog for the originating tab");
|
|
27
29
|
assert.match(app, /const setupOwner = Symbol\(tabId\);[\s\S]*const setupOwnsDialog = \(\) => guidedGitSetupDialogOwner === setupOwner;[\s\S]*const handleSetupClose = \(\) => \{\s+if \(!saveInFlight\) settleSetup\("cancelled"\);[\s\S]*if \(!activationIsCurrent\(\)\) \{\s+closeOwnedSetupDialog\(\);\s+settleSetup\("stale"\);/u, "Cancel must settle ownership, stale reset\/cwd\/session owners must fail closed, and an old response must not close a replacement setup dialog");
|
|
28
30
|
assert.match(app, /nativeCommandApi\("\/api\/git-workflow\/preferences", \{\s+method: "POST",\s+tabId,[\s\S]*if \(typeof onSaved === "function" && activationIsCurrent\(\)\)/u, "Save and its continuation must stay tab-bound and owner-guarded");
|
|
29
31
|
assert.match(app, /function resetGitWorkflowForTab[\s\S]*guidedGitLaunchPermits\.clearTab\(tabId\);[\s\S]*guidedGitActivationController\.clearTab\(tabId\);/u, "reset, cwd change, and new-session seams must invalidate permits and activation ownership together");
|
|
@@ -48,9 +50,10 @@ test("all visible Guided Git entry points prefer the extension launcher without
|
|
|
48
50
|
assert.match(app, /guidedGitLaunchBlockedReason\(guidedGitLaunchStateForTab\(tabId\), queueMessageCount\(queuedSnapshotForTab\(tabId\)\)\)/u, "busy admission must include streaming, compaction, canonical pending count, and the real tab-local queue snapshot");
|
|
49
51
|
});
|
|
50
52
|
|
|
51
|
-
test("
|
|
52
|
-
assert.
|
|
53
|
-
assert.match(app, /
|
|
53
|
+
test("native generation capabilities are extension-only and tab-local", () => {
|
|
54
|
+
assert.doesNotMatch(app, /startLegacyGuidedGitWorkflowFallback|temporary prompt-only Guided Git compatibility launcher/u);
|
|
55
|
+
assert.match(app, /function hasLoadedGuidedGitNativeCommand\(commandName, tabId\)[\s\S]*rpcOnly: true[\s\S]*source === "extension"/u);
|
|
56
|
+
assert.match(app, /guidedGitNativeCommandsAvailable[\s\S]*\["git-staged-msg", "git-branch-name", "pr"\]\.every/u);
|
|
54
57
|
assert.match(state, /function guidedGitLaunchModeForTabCatalog[\s\S]*return "extension"[\s\S]*return "fallback"[\s\S]*return "unavailable"/u);
|
|
55
58
|
assert.match(state, /createGuidedGitLaunchPermitController\(\{ maxTrackedTabs = 64, permitTtlMs = 15_000 \}/u);
|
|
56
59
|
assert.match(app, /claimStart: \(tabId, _payload, request, now\) => guidedGitLaunchPermits\.consume\(tabId, request\?\.guidedGitLaunchId, now\)/u, "only the browser client holding the exact envelope-correlated permit may claim activation");
|
|
@@ -60,19 +63,28 @@ test("temporary fallback and prompt capabilities are explicit and tab-local", ()
|
|
|
60
63
|
assert.match(server, /return \{ \.\.\.event, guidedGitLaunchId: pending\.launchId \};/u, "browser launch correlation belongs only to the trusted transport envelope");
|
|
61
64
|
assert.match(server, /GUIDED_GIT_LAUNCH_TTL_MS = 15_000/u);
|
|
62
65
|
assert.match(server, /guidedGitPendingLaunch: null/u, "pending launch state is bounded to one record per tab and dies with the tab");
|
|
63
|
-
assert.match(app, /
|
|
64
|
-
assert.match(app, /
|
|
65
|
-
assert.match(app, /
|
|
66
|
-
assert.match(app, /
|
|
67
|
-
assert.
|
|
66
|
+
assert.match(app, /hasLoadedGuidedGitNativeCommand\("git-staged-msg", tabId\)/u);
|
|
67
|
+
assert.match(app, /hasLoadedGuidedGitNativeCommand\("git-branch-name", tabId\)/u);
|
|
68
|
+
assert.match(app, /hasLoadedGuidedGitNativeCommand\("pr", tabId\)/u);
|
|
69
|
+
assert.match(app, /Same-named prompt templates are not used/u);
|
|
70
|
+
assert.doesNotMatch(`${app}\n${readme}\n${technical}\n${development}`, /pi-prompts-git-pr/u);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
test("server dispatch requires extension provenance and completes on a fresh native artifact", () => {
|
|
74
|
+
assert.match(server, /async function resolveGuidedGitNativeCommand[\s\S]*candidate\?\.source === "extension"[\s\S]*Same-named prompt templates are not used/u);
|
|
75
|
+
assert.match(server, /record\.nativeCommandName = nativeCommandName;\s+record\.message = gitWorkflowGenerationPrompt\(kind, preferences, nativeCommandName\)/u);
|
|
76
|
+
assert.match(server, /function guidedGitNativeCommandErrorFromEvent[\s\S]*event\?\.type !== "extension_error"[\s\S]*event\.extensionPath !== `command:\$\{commandName\}`/u);
|
|
77
|
+
assert.match(server, /if \(record\.nativeCommandError\) throw record\.nativeCommandError;[\s\S]*await assertGuidedGitNativeArtifactUpdated\(tab, record\);[\s\S]*finishGitWorkflowGeneration\(tab, record, \{ successful: true \}\)/u);
|
|
78
|
+
assert.match(server, /const target = path\.resolve\(base, `\$\{encodeURIComponent\(branch\)\}\.md`\)/u);
|
|
79
|
+
assert.match(development, /correlated `extension_error` event as the native command's terminal failure/u);
|
|
68
80
|
});
|
|
69
81
|
|
|
70
82
|
test("fixture, cache revisions, and layered docs expose the migration contract", () => {
|
|
71
83
|
assert.match(fakePi, /FAKE_PI_GUIDED_GIT_ACTIVATION/u);
|
|
72
84
|
assert.match(fakePi, /git-guided-workflow:webui-start/u);
|
|
73
|
-
assert.match(html, /styles\.css\?v=
|
|
74
|
-
assert.match(html, /app\.js\?v=
|
|
75
|
-
assert.match(serviceWorker, /pi-webui-pwa-
|
|
85
|
+
assert.match(html, /styles\.css\?v=145/u);
|
|
86
|
+
assert.match(html, /app\.js\?v=177/u);
|
|
87
|
+
assert.match(serviceWorker, /pi-webui-pwa-v145/u);
|
|
76
88
|
assert.match(serviceWorker, /"\/guided-git-command-state\.mjs"/u);
|
|
77
89
|
assert.match(readme, /pi-extension-git-guided-workflow/u);
|
|
78
90
|
assert.match(technical, /\/git-guided-workflow/u);
|