@firstpick/pi-package-webui 0.9.8 → 0.9.9
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 +882 -0
- package/README.md +1 -1
- package/TECHNICAL.md +415 -0
- package/bin/pi-webui.mjs +40 -1
- package/lib/windows-drive-roots.mjs +114 -0
- package/package.json +3 -1
- package/public/app.js +54 -17
- package/public/index.html +7 -3
- package/public/service-worker.js +1 -1
- package/public/styles.css +13 -1
- package/tests/boot-failure-diagnostics.test.mjs +3 -3
- package/tests/browser/windows-drive-parent.spec.mjs +198 -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/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/guided-git-activation-static.test.mjs +3 -3
- package/tests/guided-git-fallback-ui-static.test.mjs +2 -2
- package/tests/intercom-conversation-viewer-static.test.mjs +3 -3
- 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/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/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/windows-drive-cwd-picker-static.test.mjs +81 -0
- package/tests/windows-drive-roots.test.mjs +130 -0
package/public/app.js
CHANGED
|
@@ -541,6 +541,8 @@ const elements = {
|
|
|
541
541
|
pathPickerTitle: $("#pathPickerTitle"),
|
|
542
542
|
pathPickerCurrent: $("#pathPickerCurrent"),
|
|
543
543
|
pathPickerAddFastPickButton: $("#pathPickerAddFastPickButton"),
|
|
544
|
+
pathPickerPathInput: $("#pathPickerPathInput"),
|
|
545
|
+
pathPickerPathButton: $("#pathPickerPathButton"),
|
|
544
546
|
pathPickerCreateNameInput: $("#pathPickerCreateNameInput"),
|
|
545
547
|
pathPickerCreateButton: $("#pathPickerCreateButton"),
|
|
546
548
|
pathPickerSearchInput: $("#pathPickerSearchInput"),
|
|
@@ -24390,6 +24392,22 @@ function setPathPickerError(message) {
|
|
|
24390
24392
|
elements.pathPickerError.hidden = !message;
|
|
24391
24393
|
}
|
|
24392
24394
|
|
|
24395
|
+
function pathPickerEnteredPath() {
|
|
24396
|
+
return elements.pathPickerPathInput.value.trim();
|
|
24397
|
+
}
|
|
24398
|
+
|
|
24399
|
+
function updatePathPickerPathControls() {
|
|
24400
|
+
const loading = !!pathPickerState?.loading;
|
|
24401
|
+
elements.pathPickerPathInput.disabled = !pathPickerState || loading;
|
|
24402
|
+
elements.pathPickerPathButton.disabled = !pathPickerState || loading || !pathPickerEnteredPath();
|
|
24403
|
+
}
|
|
24404
|
+
|
|
24405
|
+
async function openPathPickerEnteredPath() {
|
|
24406
|
+
const cwd = pathPickerEnteredPath();
|
|
24407
|
+
if (!cwd || pathPickerState?.loading) return;
|
|
24408
|
+
await loadPathPickerDirectory(cwd);
|
|
24409
|
+
}
|
|
24410
|
+
|
|
24393
24411
|
function pathPickerCreateName() {
|
|
24394
24412
|
return elements.pathPickerCreateNameInput.value.trim();
|
|
24395
24413
|
}
|
|
@@ -24405,8 +24423,9 @@ function pathPickerCreateValidationError(name = pathPickerCreateName()) {
|
|
|
24405
24423
|
function updateCreateDirectoryControls() {
|
|
24406
24424
|
const busy = !!pathPickerState?.creatingDirectory;
|
|
24407
24425
|
const loading = !!pathPickerState?.loading;
|
|
24408
|
-
const
|
|
24409
|
-
|
|
24426
|
+
const canEdit = !!pathPickerState?.cwd && pathPickerState.selectable !== false && !loading && !busy;
|
|
24427
|
+
const canCreate = canEdit && !!pathPickerCreateName();
|
|
24428
|
+
elements.pathPickerCreateNameInput.disabled = !canEdit;
|
|
24410
24429
|
elements.pathPickerCreateButton.disabled = !canCreate;
|
|
24411
24430
|
elements.pathPickerCreateButton.textContent = busy ? "Creating…" : "Create directory";
|
|
24412
24431
|
}
|
|
@@ -24417,9 +24436,9 @@ function pathPickerSearchQuery() {
|
|
|
24417
24436
|
|
|
24418
24437
|
function updatePathPickerSearchControls() {
|
|
24419
24438
|
const loading = !!pathPickerState?.loading;
|
|
24420
|
-
const
|
|
24439
|
+
const canSearch = !!pathPickerState && (pathPickerState.selectable === false || !!pathPickerState.cwd);
|
|
24421
24440
|
const hasQuery = !!pathPickerSearchQuery();
|
|
24422
|
-
elements.pathPickerSearchInput.disabled =
|
|
24441
|
+
elements.pathPickerSearchInput.disabled = loading || !canSearch;
|
|
24423
24442
|
elements.pathPickerClearSearchButton.hidden = !hasQuery;
|
|
24424
24443
|
elements.pathPickerClearSearchButton.disabled = loading || !hasQuery;
|
|
24425
24444
|
}
|
|
@@ -24453,7 +24472,8 @@ function renderPathPickerDirectoryList() {
|
|
|
24453
24472
|
}
|
|
24454
24473
|
|
|
24455
24474
|
for (const directory of matches) {
|
|
24456
|
-
const
|
|
24475
|
+
const label = /[\\/]$/.test(directory.name) ? directory.name : `${directory.name}/`;
|
|
24476
|
+
const button = pathPickerButton(label, directory.cwd, () => loadPathPickerDirectory(directory.cwd, { focusAfterLoad: true }), `path-picker-directory${directory.hidden ? " hidden-directory" : ""}`);
|
|
24457
24477
|
button.setAttribute("role", "option");
|
|
24458
24478
|
elements.pathPickerList.append(button);
|
|
24459
24479
|
}
|
|
@@ -24552,7 +24572,7 @@ function fastPickLabel(pick) {
|
|
|
24552
24572
|
}
|
|
24553
24573
|
|
|
24554
24574
|
function currentFastPick() {
|
|
24555
|
-
if (!pathPickerState?.cwd) return null;
|
|
24575
|
+
if (!pathPickerState?.cwd || pathPickerState.selectable === false) return null;
|
|
24556
24576
|
return { cwd: pathPickerState.cwd, displayCwd: elements.pathPickerCurrent.textContent || pathPickerState.cwd };
|
|
24557
24577
|
}
|
|
24558
24578
|
|
|
@@ -24584,7 +24604,7 @@ function renderFastPicks() {
|
|
|
24584
24604
|
|
|
24585
24605
|
for (const pick of picks) {
|
|
24586
24606
|
const item = make("span", "path-picker-fast-pick");
|
|
24587
|
-
const jump = pathPickerButton(fastPickLabel(pick), pick.cwd, () => loadPathPickerDirectory(pick.cwd), "path-picker-fast-pick-button");
|
|
24607
|
+
const jump = pathPickerButton(fastPickLabel(pick), pick.cwd, () => loadPathPickerDirectory(pick.cwd, { focusAfterLoad: true }), "path-picker-fast-pick-button");
|
|
24588
24608
|
const remove = pathPickerButton("×", `Unpin ${pick.cwd}`, async () => {
|
|
24589
24609
|
await saveFastPicks(loadFastPicks().filter((item) => item.cwd !== pick.cwd));
|
|
24590
24610
|
}, "path-picker-fast-pick-remove");
|
|
@@ -24604,32 +24624,36 @@ async function addCurrentFastPick() {
|
|
|
24604
24624
|
|
|
24605
24625
|
function renderPathPicker(data) {
|
|
24606
24626
|
if (!pathPickerState) return;
|
|
24607
|
-
pathPickerState.cwd = data.cwd;
|
|
24627
|
+
pathPickerState.cwd = data.cwd || "";
|
|
24628
|
+
pathPickerState.displayCwd = data.displayCwd || pathPickerState.cwd;
|
|
24629
|
+
pathPickerState.selectable = data.selectable !== false;
|
|
24608
24630
|
pathPickerState.loading = false;
|
|
24609
24631
|
pathPickerState.directories = Array.isArray(data.directories) ? data.directories : [];
|
|
24610
24632
|
pathPickerState.filteredDirectories = pathPickerState.directories;
|
|
24611
|
-
elements.pathPickerCurrent.textContent =
|
|
24612
|
-
elements.pathPickerCurrent.title =
|
|
24613
|
-
elements.pathPickerChooseButton.disabled =
|
|
24633
|
+
elements.pathPickerCurrent.textContent = pathPickerState.displayCwd;
|
|
24634
|
+
elements.pathPickerCurrent.title = pathPickerState.cwd || pathPickerState.displayCwd;
|
|
24635
|
+
elements.pathPickerChooseButton.disabled = !pathPickerState.selectable || !pathPickerState.cwd;
|
|
24614
24636
|
elements.pathPickerChooseButton.textContent = "Use this directory";
|
|
24637
|
+
elements.pathPickerPathInput.value = "";
|
|
24615
24638
|
elements.pathPickerCreateNameInput.value = "";
|
|
24616
24639
|
elements.pathPickerSearchInput.value = "";
|
|
24617
24640
|
setPathPickerError(data.truncated ? "Showing the first 500 directories." : "");
|
|
24641
|
+
updatePathPickerPathControls();
|
|
24618
24642
|
updateCreateDirectoryControls();
|
|
24619
24643
|
renderFastPicks();
|
|
24620
24644
|
|
|
24621
24645
|
elements.pathPickerRoots.replaceChildren();
|
|
24622
24646
|
if (data.parent) {
|
|
24623
|
-
elements.pathPickerRoots.append(pathPickerButton("↑ Parent", data.parent, () => loadPathPickerDirectory(data.parent), "path-picker-root-button"));
|
|
24647
|
+
elements.pathPickerRoots.append(pathPickerButton("↑ Parent", data.parent, () => loadPathPickerDirectory(data.parent, { focusAfterLoad: true }), "path-picker-root-button"));
|
|
24624
24648
|
}
|
|
24625
24649
|
for (const root of data.roots || []) {
|
|
24626
|
-
elements.pathPickerRoots.append(pathPickerButton(root.label, root.cwd, () => loadPathPickerDirectory(root.cwd), "path-picker-root-button"));
|
|
24650
|
+
elements.pathPickerRoots.append(pathPickerButton(root.label, root.cwd, () => loadPathPickerDirectory(root.cwd, { focusAfterLoad: true }), "path-picker-root-button"));
|
|
24627
24651
|
}
|
|
24628
24652
|
|
|
24629
24653
|
renderPathPickerDirectoryList();
|
|
24630
24654
|
}
|
|
24631
24655
|
|
|
24632
|
-
async function loadPathPickerDirectory(cwd) {
|
|
24656
|
+
async function loadPathPickerDirectory(cwd, { focusAfterLoad = false } = {}) {
|
|
24633
24657
|
if (!pathPickerState) return;
|
|
24634
24658
|
const requestId = ++pathPickerState.requestId;
|
|
24635
24659
|
pathPickerState.loading = true;
|
|
@@ -24637,6 +24661,7 @@ async function loadPathPickerDirectory(cwd) {
|
|
|
24637
24661
|
elements.pathPickerChooseButton.disabled = true;
|
|
24638
24662
|
elements.pathPickerCurrent.textContent = "Loading…";
|
|
24639
24663
|
elements.pathPickerSearchStatus.textContent = "";
|
|
24664
|
+
updatePathPickerPathControls();
|
|
24640
24665
|
updateCreateDirectoryControls();
|
|
24641
24666
|
updatePathPickerSearchControls();
|
|
24642
24667
|
setPathPickerError("");
|
|
@@ -24646,12 +24671,15 @@ async function loadPathPickerDirectory(cwd) {
|
|
|
24646
24671
|
const response = await api(`/api/directories${query}`);
|
|
24647
24672
|
if (!pathPickerState || pathPickerState.requestId !== requestId) return;
|
|
24648
24673
|
renderPathPicker(response.data || {});
|
|
24674
|
+
if (focusAfterLoad) elements.pathPickerSearchInput.focus({ preventScroll: true });
|
|
24649
24675
|
} catch (error) {
|
|
24650
24676
|
if (!pathPickerState || pathPickerState.requestId !== requestId) return;
|
|
24651
24677
|
pathPickerState.loading = false;
|
|
24652
|
-
elements.pathPickerChooseButton.disabled =
|
|
24653
|
-
elements.pathPickerCurrent.textContent = pathPickerState.cwd || "Unable to load directory";
|
|
24678
|
+
elements.pathPickerChooseButton.disabled = !pathPickerState.selectable || !pathPickerState.cwd;
|
|
24679
|
+
elements.pathPickerCurrent.textContent = pathPickerState.displayCwd || pathPickerState.cwd || "Unable to load directory";
|
|
24680
|
+
elements.pathPickerCurrent.title = pathPickerState.cwd || pathPickerState.displayCwd || "";
|
|
24654
24681
|
setPathPickerError(error.message);
|
|
24682
|
+
updatePathPickerPathControls();
|
|
24655
24683
|
updateCreateDirectoryControls();
|
|
24656
24684
|
updatePathPickerSearchControls();
|
|
24657
24685
|
updateAddFastPickButton();
|
|
@@ -24708,9 +24736,10 @@ function pickCwd(tab, initialCwd, { title } = {}) {
|
|
|
24708
24736
|
|
|
24709
24737
|
return new Promise((resolve) => {
|
|
24710
24738
|
const pickerTab = tab || { id: "path-picker", title: "tab" };
|
|
24711
|
-
pathPickerState = { tabId: pickerTab.id, cwd: initialCwd, requestId: 0, loading: false, creatingDirectory: false, directories: [], filteredDirectories: [], resolve };
|
|
24739
|
+
pathPickerState = { tabId: pickerTab.id, cwd: initialCwd, displayCwd: initialCwd, selectable: true, requestId: 0, loading: false, creatingDirectory: false, directories: [], filteredDirectories: [], resolve };
|
|
24712
24740
|
elements.pathPickerTitle.textContent = title || `Choose CWD for ${pickerTab.title}`;
|
|
24713
24741
|
elements.pathPickerCurrent.textContent = "Loading…";
|
|
24742
|
+
elements.pathPickerPathInput.value = "";
|
|
24714
24743
|
elements.pathPickerCreateNameInput.value = "";
|
|
24715
24744
|
elements.pathPickerSearchInput.value = "";
|
|
24716
24745
|
elements.pathPickerSearchStatus.textContent = "";
|
|
@@ -24720,6 +24749,7 @@ function pickCwd(tab, initialCwd, { title } = {}) {
|
|
|
24720
24749
|
setPathPickerError("");
|
|
24721
24750
|
elements.pathPickerAddFastPickButton.disabled = true;
|
|
24722
24751
|
elements.pathPickerChooseButton.disabled = true;
|
|
24752
|
+
updatePathPickerPathControls();
|
|
24723
24753
|
updateCreateDirectoryControls();
|
|
24724
24754
|
updatePathPickerSearchControls();
|
|
24725
24755
|
initializeFastPicks().catch((error) => addEvent(`failed to initialize path fast picks: ${error.message}`, "error"));
|
|
@@ -51046,6 +51076,13 @@ elements.fileSelectionCommentInput?.addEventListener("keydown", (event) => {
|
|
|
51046
51076
|
event.preventDefault();
|
|
51047
51077
|
sendFileSelectionToSession();
|
|
51048
51078
|
});
|
|
51079
|
+
elements.pathPickerPathInput.addEventListener("input", updatePathPickerPathControls);
|
|
51080
|
+
elements.pathPickerPathInput.addEventListener("keydown", (event) => {
|
|
51081
|
+
if (event.key !== "Enter") return;
|
|
51082
|
+
event.preventDefault();
|
|
51083
|
+
openPathPickerEnteredPath().catch((error) => addEvent(error.message, "error"));
|
|
51084
|
+
});
|
|
51085
|
+
elements.pathPickerPathButton.addEventListener("click", () => openPathPickerEnteredPath().catch((error) => addEvent(error.message, "error")));
|
|
51049
51086
|
elements.pathPickerCreateNameInput.addEventListener("input", updateCreateDirectoryControls);
|
|
51050
51087
|
elements.pathPickerCreateNameInput.addEventListener("keydown", (event) => {
|
|
51051
51088
|
if (event.key !== "Enter") return;
|
package/public/index.html
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<link rel="manifest" href="/manifest.webmanifest" />
|
|
13
13
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
14
14
|
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
|
15
|
-
<link rel="stylesheet" href="/styles.css?v=
|
|
15
|
+
<link rel="stylesheet" href="/styles.css?v=143" />
|
|
16
16
|
<script>
|
|
17
17
|
// Public-only issue-bot runtime configuration. Keep disabled unless the gateway,
|
|
18
18
|
// Turnstile site key, exact CORS origin, and private-report destination are approved.
|
|
@@ -1677,6 +1677,10 @@
|
|
|
1677
1677
|
<p id="pathPickerCurrent" class="path-picker-current"></p>
|
|
1678
1678
|
<button id="pathPickerAddFastPickButton" type="button" class="path-picker-add-fast-pick">Pin this folder</button>
|
|
1679
1679
|
</div>
|
|
1680
|
+
<div class="path-picker-path-row" aria-label="Open a directory by path">
|
|
1681
|
+
<input id="pathPickerPathInput" class="path-picker-path-input" type="text" placeholder="Path, e.g. C:/ or D:/project" autocomplete="off" spellcheck="false" aria-label="Directory path" />
|
|
1682
|
+
<button id="pathPickerPathButton" type="button" class="path-picker-path-button">Go</button>
|
|
1683
|
+
</div>
|
|
1680
1684
|
<div id="pathPickerFastPicks" class="path-picker-fast-picks" aria-label="Pinned folders"></div>
|
|
1681
1685
|
<div id="pathPickerRoots" class="path-picker-roots"></div>
|
|
1682
1686
|
<div class="path-picker-create-row" aria-label="Create a new directory in the current directory">
|
|
@@ -1689,7 +1693,7 @@
|
|
|
1689
1693
|
</div>
|
|
1690
1694
|
<p id="pathPickerSearchStatus" class="path-picker-search-status muted" role="status" aria-live="polite"></p>
|
|
1691
1695
|
<div id="pathPickerList" class="path-picker-list" role="listbox" aria-label="Directories"></div>
|
|
1692
|
-
<p id="pathPickerError" class="path-picker-error" hidden></p>
|
|
1696
|
+
<p id="pathPickerError" class="path-picker-error" role="alert" hidden></p>
|
|
1693
1697
|
<menu>
|
|
1694
1698
|
<button id="pathPickerCancelButton" type="button">Cancel</button>
|
|
1695
1699
|
<button id="pathPickerChooseButton" type="button" class="primary">Use this directory</button>
|
|
@@ -1885,7 +1889,7 @@
|
|
|
1885
1889
|
</form>
|
|
1886
1890
|
</dialog>
|
|
1887
1891
|
|
|
1888
|
-
<script id="webuiBootLoader" data-app-src="/app.js?v=
|
|
1892
|
+
<script id="webuiBootLoader" data-app-src="/app.js?v=175">
|
|
1889
1893
|
(() => {
|
|
1890
1894
|
"use strict";
|
|
1891
1895
|
|
package/public/service-worker.js
CHANGED
package/public/styles.css
CHANGED
|
@@ -14672,12 +14672,19 @@ body.subagent-terminal-active .composer-remote-mic-consent {
|
|
|
14672
14672
|
color: var(--ctp-teal);
|
|
14673
14673
|
border-color: rgba(148, 226, 213, 0.30);
|
|
14674
14674
|
}
|
|
14675
|
+
.path-picker-path-row,
|
|
14675
14676
|
.path-picker-create-row {
|
|
14676
14677
|
display: grid;
|
|
14677
14678
|
grid-template-columns: minmax(0, 1fr) auto;
|
|
14678
14679
|
gap: 0.45rem;
|
|
14680
|
+
}
|
|
14681
|
+
.path-picker-path-row {
|
|
14682
|
+
margin: 0.72rem 0 0;
|
|
14683
|
+
}
|
|
14684
|
+
.path-picker-create-row {
|
|
14679
14685
|
margin: 0 0 0.72rem;
|
|
14680
14686
|
}
|
|
14687
|
+
.path-picker-path-input,
|
|
14681
14688
|
.path-picker-create-input {
|
|
14682
14689
|
min-width: 0;
|
|
14683
14690
|
width: 100%;
|
|
@@ -14686,11 +14693,14 @@ body.subagent-terminal-active .composer-remote-mic-consent {
|
|
|
14686
14693
|
border-color: rgba(137, 180, 250, 0.20);
|
|
14687
14694
|
background: rgba(var(--ctp-surface-rgb), 0.38);
|
|
14688
14695
|
}
|
|
14696
|
+
.path-picker-path-button,
|
|
14689
14697
|
.path-picker-create-button {
|
|
14690
14698
|
align-self: stretch;
|
|
14691
14699
|
color: var(--ctp-blue);
|
|
14692
14700
|
border-color: rgba(137, 180, 250, 0.32);
|
|
14693
14701
|
}
|
|
14702
|
+
.path-picker-path-button:hover,
|
|
14703
|
+
.path-picker-path-button:focus-visible,
|
|
14694
14704
|
.path-picker-create-button:hover,
|
|
14695
14705
|
.path-picker-create-button:focus-visible {
|
|
14696
14706
|
color: #11111b;
|
|
@@ -14701,7 +14711,7 @@ body.subagent-terminal-active .composer-remote-mic-consent {
|
|
|
14701
14711
|
display: grid;
|
|
14702
14712
|
grid-template-columns: minmax(0, 1fr) auto;
|
|
14703
14713
|
gap: 0.45rem;
|
|
14704
|
-
margin: 0 0 0.38rem;
|
|
14714
|
+
margin: 0.72rem 0 0.38rem;
|
|
14705
14715
|
}
|
|
14706
14716
|
.path-picker-search-input {
|
|
14707
14717
|
min-width: 0;
|
|
@@ -16307,9 +16317,11 @@ button.git-workflow-step { min-height: 1.9rem; }
|
|
|
16307
16317
|
.app-runner-stdin-send,
|
|
16308
16318
|
.app-runner-stdin-eof { width: 100%; }
|
|
16309
16319
|
.path-picker-current-row,
|
|
16320
|
+
.path-picker-path-row,
|
|
16310
16321
|
.path-picker-create-row,
|
|
16311
16322
|
.path-picker-search-row { grid-template-columns: 1fr; }
|
|
16312
16323
|
.path-picker-add-fast-pick,
|
|
16324
|
+
.path-picker-path-button,
|
|
16313
16325
|
.path-picker-create-button,
|
|
16314
16326
|
.path-picker-clear-search-button { width: 100%; }
|
|
16315
16327
|
.path-picker-fast-pick { grid-template-columns: minmax(0, 1fr) 44px; }
|
|
@@ -65,7 +65,7 @@ function makeEnvironment({
|
|
|
65
65
|
reload: new FakeElement(),
|
|
66
66
|
copyStatus: new FakeElement(),
|
|
67
67
|
};
|
|
68
|
-
const styleLink = new FakeElement({ href: "http://127.0.0.1:31415/styles.css?v=
|
|
68
|
+
const styleLink = new FakeElement({ href: "http://127.0.0.1:31415/styles.css?v=143", sheet: stylesheetLoaded ? {} : null });
|
|
69
69
|
const listeners = new Map();
|
|
70
70
|
const timers = new Map();
|
|
71
71
|
let timerId = 0;
|
|
@@ -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=175" } }),
|
|
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=175"), "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");
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { createServer } from "node:net";
|
|
3
|
+
import { mkdtemp, rm } from "node:fs/promises";
|
|
4
|
+
import { tmpdir } from "node:os";
|
|
5
|
+
import { dirname, join } from "node:path";
|
|
6
|
+
import { setTimeout as delay } from "node:timers/promises";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
8
|
+
import assert from "node:assert/strict";
|
|
9
|
+
import AxeBuilder from "@axe-core/playwright";
|
|
10
|
+
import { expect, test } from "@playwright/test";
|
|
11
|
+
|
|
12
|
+
const root = join(dirname(fileURLToPath(import.meta.url)), "..", "..");
|
|
13
|
+
const serverScript = join(root, "bin", "pi-webui.mjs");
|
|
14
|
+
const fakePi = join(root, "tests", "fixtures", "fake-pi.mjs");
|
|
15
|
+
const WINDOWS_DRIVES_PICKER_PATH = "::pi-webui-windows-drives::";
|
|
16
|
+
|
|
17
|
+
async function freePort() {
|
|
18
|
+
const server = createServer();
|
|
19
|
+
await new Promise((resolve) => server.listen(0, "127.0.0.1", resolve));
|
|
20
|
+
const { port } = server.address();
|
|
21
|
+
await new Promise((resolve) => server.close(resolve));
|
|
22
|
+
return port;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
let child;
|
|
26
|
+
let baseURL;
|
|
27
|
+
let tempRoot;
|
|
28
|
+
let output = "";
|
|
29
|
+
|
|
30
|
+
test.beforeAll(async () => {
|
|
31
|
+
const port = await freePort();
|
|
32
|
+
tempRoot = await mkdtemp(join(tmpdir(), "pi-webui-windows-drive-parent-"));
|
|
33
|
+
baseURL = `http://127.0.0.1:${port}`;
|
|
34
|
+
child = spawn(process.execPath, [serverScript, "--cwd", tempRoot, "--host", "127.0.0.1", "--port", String(port), "--pi", fakePi], {
|
|
35
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
36
|
+
env: {
|
|
37
|
+
...process.env,
|
|
38
|
+
PI_WEBUI_RPC_SUPERVISOR: "0",
|
|
39
|
+
PI_CODING_AGENT_DIR: join(tempRoot, "agent"),
|
|
40
|
+
PI_WEBUI_SETTINGS_FILE: join(tempRoot, "settings.json"),
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
child.stdout.on("data", (chunk) => { output += String(chunk); });
|
|
44
|
+
child.stderr.on("data", (chunk) => { output += String(chunk); });
|
|
45
|
+
for (let attempt = 0; attempt < 80; attempt += 1) {
|
|
46
|
+
if (child.exitCode !== null) break;
|
|
47
|
+
try {
|
|
48
|
+
const response = await fetch(`${baseURL}/api/health`, { signal: AbortSignal.timeout(500) });
|
|
49
|
+
if (response.ok) return;
|
|
50
|
+
} catch {
|
|
51
|
+
// Wait for the local server and fake Pi fixture.
|
|
52
|
+
}
|
|
53
|
+
await delay(100);
|
|
54
|
+
}
|
|
55
|
+
throw new Error(`Pi Web UI did not start:\n${output}`);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
test.afterAll(async () => {
|
|
59
|
+
child?.kill("SIGTERM");
|
|
60
|
+
if (child?.exitCode === null) await new Promise((resolve) => child.once("exit", resolve));
|
|
61
|
+
await rm(tempRoot, { recursive: true, force: true });
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
function directoryPayload(cwd, { parent = WINDOWS_DRIVES_PICKER_PATH, directories = [] } = {}) {
|
|
65
|
+
return {
|
|
66
|
+
cwd,
|
|
67
|
+
displayCwd: cwd,
|
|
68
|
+
parent,
|
|
69
|
+
roots: [],
|
|
70
|
+
directories,
|
|
71
|
+
truncated: false,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function virtualDrivesPayload() {
|
|
76
|
+
return {
|
|
77
|
+
cwd: "",
|
|
78
|
+
displayCwd: "This PC",
|
|
79
|
+
parent: null,
|
|
80
|
+
roots: [],
|
|
81
|
+
directories: ["C:\\", "D:\\", "E:\\"].map((cwd) => ({ name: cwd, cwd, displayCwd: cwd, hidden: false })),
|
|
82
|
+
truncated: false,
|
|
83
|
+
selectable: false,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
test("Windows drive Parent flow remains navigation-only, accessible, and cwd-safe", async ({ page }) => {
|
|
88
|
+
const directoryRequests = [];
|
|
89
|
+
const tabCreateBodies = [];
|
|
90
|
+
|
|
91
|
+
await page.route("**/api/path-fast-picks*", async (route) => {
|
|
92
|
+
await route.fulfill({
|
|
93
|
+
status: 200,
|
|
94
|
+
contentType: "application/json",
|
|
95
|
+
body: JSON.stringify({ ok: true, data: { picks: [{ cwd: "D:\\", displayCwd: "D:\\" }] } }),
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
await page.route(/\/api\/tabs(?:\?.*)?$/, async (route) => {
|
|
99
|
+
if (route.request().method() !== "POST") return route.fallback();
|
|
100
|
+
tabCreateBodies.push(route.request().postDataJSON());
|
|
101
|
+
await route.fulfill({ status: 400, contentType: "application/json", body: JSON.stringify({ ok: false, error: "test stopped after cwd submission" }) });
|
|
102
|
+
});
|
|
103
|
+
await page.route("**/api/directories*", async (route) => {
|
|
104
|
+
if (route.request().method() !== "GET") return route.fallback();
|
|
105
|
+
const requestedPath = new URL(route.request().url()).searchParams.get("path") || "";
|
|
106
|
+
directoryRequests.push(requestedPath);
|
|
107
|
+
if (requestedPath === WINDOWS_DRIVES_PICKER_PATH) {
|
|
108
|
+
await route.fulfill({ status: 200, contentType: "application/json", body: JSON.stringify({ ok: true, data: virtualDrivesPayload() }) });
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (requestedPath === "E:\\") {
|
|
112
|
+
await route.fulfill({ status: 400, contentType: "application/json", body: JSON.stringify({ ok: false, error: "Drive E is unavailable" }) });
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const data = requestedPath === "D:/project"
|
|
116
|
+
? directoryPayload("D:\\project", { parent: "D:\\" })
|
|
117
|
+
: directoryPayload(requestedPath === "D:\\" ? "D:\\" : "C:\\");
|
|
118
|
+
await route.fulfill({ status: 200, contentType: "application/json", body: JSON.stringify({ ok: true, data }) });
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
await page.setViewportSize({ width: 1280, height: 850 });
|
|
122
|
+
await page.goto(baseURL);
|
|
123
|
+
await expect(page.locator("#promptInput")).toBeVisible();
|
|
124
|
+
|
|
125
|
+
await page.keyboard.press("Control+k");
|
|
126
|
+
await page.locator("#commandPaletteInput").fill("Choose directory for new tab");
|
|
127
|
+
await page.keyboard.press("Enter");
|
|
128
|
+
|
|
129
|
+
const dialog = page.locator("#pathPickerDialog");
|
|
130
|
+
const current = page.locator("#pathPickerCurrent");
|
|
131
|
+
const search = page.locator("#pathPickerSearchInput");
|
|
132
|
+
const directPath = page.locator("#pathPickerPathInput");
|
|
133
|
+
const choose = page.locator("#pathPickerChooseButton");
|
|
134
|
+
await expect(dialog).toBeVisible();
|
|
135
|
+
await expect(current).toHaveText("C:\\");
|
|
136
|
+
|
|
137
|
+
await page.locator("#pathPickerFastPicks .path-picker-fast-pick-button", { hasText: "D:" }).click();
|
|
138
|
+
await expect(current).toHaveText("D:\\");
|
|
139
|
+
await expect(search).toBeFocused();
|
|
140
|
+
|
|
141
|
+
await page.getByRole("button", { name: "↑ Parent" }).click();
|
|
142
|
+
await expect(current).toHaveText("This PC");
|
|
143
|
+
await expect(search).toBeFocused();
|
|
144
|
+
await expect(choose).toBeDisabled();
|
|
145
|
+
await expect(page.locator("#pathPickerCreateNameInput")).toBeDisabled();
|
|
146
|
+
await expect(page.locator("#pathPickerCreateButton")).toBeDisabled();
|
|
147
|
+
await expect(page.locator("#pathPickerAddFastPickButton")).toBeDisabled();
|
|
148
|
+
await expect(search).toBeEnabled();
|
|
149
|
+
await expect(directPath).toBeEnabled();
|
|
150
|
+
|
|
151
|
+
const accessibility = await new AxeBuilder({ page }).include("#pathPickerDialog").disableRules(["aria-required-children"]).analyze();
|
|
152
|
+
const serious = accessibility.violations.filter((violation) => ["serious", "critical"].includes(violation.impact));
|
|
153
|
+
assert.deepEqual(serious, [], `This PC picker should have no serious/critical Axe violations: ${serious.map(({ id }) => id).join(", ")}`);
|
|
154
|
+
|
|
155
|
+
await search.fill("D");
|
|
156
|
+
await expect(page.locator("#pathPickerList .path-picker-directory")).toHaveCount(1);
|
|
157
|
+
await expect(page.locator("#pathPickerList .path-picker-directory")).toHaveText("D:\\");
|
|
158
|
+
await page.locator("#pathPickerClearSearchButton").click();
|
|
159
|
+
|
|
160
|
+
await page.locator("#pathPickerList .path-picker-directory", { hasText: "D:\\" }).click();
|
|
161
|
+
await expect(current).toHaveText("D:\\");
|
|
162
|
+
await expect(search).toBeFocused();
|
|
163
|
+
await page.getByRole("button", { name: "↑ Parent" }).click();
|
|
164
|
+
await expect(current).toHaveText("This PC");
|
|
165
|
+
await expect(search).toBeFocused();
|
|
166
|
+
|
|
167
|
+
await directPath.fill("D:/project");
|
|
168
|
+
await page.locator("#pathPickerList .path-picker-directory", { hasText: "E:\\" }).click();
|
|
169
|
+
const alert = page.locator("#pathPickerError");
|
|
170
|
+
await expect(alert).toHaveAttribute("role", "alert");
|
|
171
|
+
await expect(alert).toContainText("Drive E is unavailable");
|
|
172
|
+
await expect(current).toHaveText("This PC");
|
|
173
|
+
await expect(directPath).toHaveValue("D:/project");
|
|
174
|
+
|
|
175
|
+
await page.locator("#pathPickerPathButton").click();
|
|
176
|
+
await expect(current).toHaveText("D:\\project");
|
|
177
|
+
await expect(search).not.toBeFocused();
|
|
178
|
+
assert.ok(directoryRequests.includes("D:/project"), "direct path entry should preserve slash-form drive-qualified input");
|
|
179
|
+
|
|
180
|
+
await page.getByRole("button", { name: "↑ Parent" }).click();
|
|
181
|
+
await expect(current).toHaveText("D:\\");
|
|
182
|
+
await expect(search).toBeFocused();
|
|
183
|
+
await page.getByRole("button", { name: "↑ Parent" }).click();
|
|
184
|
+
await expect(current).toHaveText("This PC");
|
|
185
|
+
await expect(search).toBeFocused();
|
|
186
|
+
|
|
187
|
+
await page.evaluate(() => document.querySelector("#pathPickerChooseButton").click());
|
|
188
|
+
await expect(dialog).toBeVisible();
|
|
189
|
+
assert.deepEqual(tabCreateBodies, [], "the virtual empty cwd must not create a tab");
|
|
190
|
+
|
|
191
|
+
await page.locator("#pathPickerList .path-picker-directory", { hasText: "C:\\" }).click();
|
|
192
|
+
await expect(current).toHaveText("C:\\");
|
|
193
|
+
await expect(search).toBeFocused();
|
|
194
|
+
await choose.click();
|
|
195
|
+
await expect.poll(() => tabCreateBodies.length).toBe(1);
|
|
196
|
+
assert.deepEqual(tabCreateBodies, [{ cwd: "C:\\" }]);
|
|
197
|
+
assert.ok(tabCreateBodies.every(({ cwd }) => cwd && cwd !== WINDOWS_DRIVES_PICKER_PATH), "only a real drive root may reach tab creation");
|
|
198
|
+
});
|
|
@@ -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-v142/, "PWA cache identity should be bumped for changed browser assets");
|
|
59
|
+
assert.match(html, /data-app-src="\/app\.js\?v=175"/, "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=143/, "changed composer styles should advance the stylesheet revision");
|
|
61
|
+
assert.match(html, /app\.js\?v=175/, "changed composer behavior should advance the app revision");
|
|
62
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v142"/, "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-v142";/,
|
|
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=143/, "visibility styles should advance the stylesheet query revision");
|
|
355
|
+
assert.match(html, /data-app-src="\/app\.js\?v=175"/, "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=143/, "Controls stylesheet changes should advance the cache query");
|
|
19
|
+
assert.match(html, /app\.js\?v=175/, "Controls tooltip wiring should advance the app cache query");
|
|
20
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v142"/, "Controls browser assets should advance the PWA cache identity");
|
|
21
21
|
|
|
22
22
|
console.log("controls-layout-static.test.mjs passed");
|
|
@@ -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-v142";/, "the PWA cache identity should advance");
|
|
128
|
+
assert.match(html, /styles\.css\?v=143/, "compact-mode styles should advance the stylesheet revision");
|
|
129
|
+
assert.match(html, /data-app-src="\/app\.js\?v=175"/, "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=175"/, "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=143/, "integrated stylesheet changes should advance the cache query");
|
|
170
|
+
assert.match(html, /\/app\.js\?v=175/, "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-v142"/, "changed viewer assets should advance the PWA cache identity");
|
|
66
|
+
assert.match(html, /styles\.css\?v=143/, "changed image styles should advance the stylesheet revision");
|
|
67
|
+
assert.match(html, /app\.js\?v=175/, "changed image rendering should advance the app revision");
|
|
68
68
|
|
|
69
69
|
console.log("file viewer image static tests passed");
|
|
@@ -70,9 +70,9 @@ test("temporary fallback and prompt capabilities are explicit and tab-local", ()
|
|
|
70
70
|
test("fixture, cache revisions, and layered docs expose the migration contract", () => {
|
|
71
71
|
assert.match(fakePi, /FAKE_PI_GUIDED_GIT_ACTIVATION/u);
|
|
72
72
|
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-
|
|
73
|
+
assert.match(html, /styles\.css\?v=143/u);
|
|
74
|
+
assert.match(html, /app\.js\?v=175/u);
|
|
75
|
+
assert.match(serviceWorker, /pi-webui-pwa-v142/u);
|
|
76
76
|
assert.match(serviceWorker, /"\/guided-git-command-state\.mjs"/u);
|
|
77
77
|
assert.match(readme, /pi-extension-git-guided-workflow/u);
|
|
78
78
|
assert.match(technical, /\/git-guided-workflow/u);
|