@firstpick/pi-package-webui 0.8.7 → 0.8.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/README.md +5 -0
- package/bin/pi-webui-rpc-supervisor.mjs +4 -1
- package/bin/pi-webui.mjs +9 -1
- package/lib/rpc-supervisor-protocol.mjs +6 -1
- package/package.json +1 -1
- package/public/app.js +679 -128
- package/public/index.html +49 -13
- package/public/service-worker.js +1 -1
- package/public/styles.css +836 -16
- package/tests/boot-failure-diagnostics.test.mjs +3 -3
- package/tests/browser/interaction-continuity.spec.mjs +58 -0
- package/tests/browser/mobile-foundation.spec.mjs +363 -5
- package/tests/browser/optimistic-prompt.spec.mjs +24 -10
- package/tests/browser/persistent-ui-layout.spec.mjs +2 -0
- package/tests/browser/side-panel-section-reorder.spec.mjs +16 -1
- package/tests/codex-fast-mode-static.test.mjs +2 -2
- package/tests/composer-action-grid-reorder-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-tree-search-layout-static.test.mjs +261 -0
- package/tests/fixtures/fake-pi.mjs +6 -2
- package/tests/http-endpoints-harness.test.mjs +6 -2
- package/tests/middle-button-drag-scroll-static.test.mjs +3 -3
- package/tests/mobile-compact-layout.test.mjs +60 -0
- package/tests/mobile-continuity-tablet-static.test.mjs +3 -3
- package/tests/mobile-foundation-static.test.mjs +12 -12
- package/tests/mobile-phone-experience-static.test.mjs +2 -2
- package/tests/mobile-static.test.mjs +226 -21
- package/tests/open-issue-wizard-static.test.mjs +1 -1
- package/tests/optional-feature-migration-frontend.test.mjs +4 -0
- package/tests/persistent-ui-layout-static.test.mjs +3 -3
- package/tests/prompt-routing-tab-status.test.mjs +8 -0
- package/tests/questionnaire-dialog.test.mjs +3 -3
- package/tests/rpc-supervisor-host.test.mjs +18 -1
- package/tests/rpc-supervisor-protocol.test.mjs +5 -0
- package/tests/session-sampling-ui-static.test.mjs +3 -3
- package/tests/side-panel-section-height-removal-static.test.mjs +3 -3
- package/tests/side-panel-section-reorder-static.test.mjs +23 -10
- package/tests/streaming-ui-coupling.test.mjs +8 -0
- package/tests/terminal-tab-workspace-static.test.mjs +15 -1
- package/tests/theme-customizer-static.test.mjs +1 -1
|
@@ -54,7 +54,7 @@ assert.match(app, /statusKey === CODEX_FAST_MODE_STATUS_KEY[\s\S]*?applyCodexFas
|
|
|
54
54
|
assert.match(readme, /### Compact live output mode[\s\S]*?select \*\*Compact\*\*[\s\S]*?`compact-v1`/, "README should document Compact mode with the stable wire identifier");
|
|
55
55
|
assert.match(readme, /### Codex subscription Fast mode[\s\S]*?service_tier: "priority"[\s\S]*?1\.5× faster[\s\S]*?2× Standard credits[\s\S]*?2\.5×/, "README should separately document subscription Fast mode and its cost semantics");
|
|
56
56
|
// Intent preserved: browser-asset changes must advance the coherent cache tuple.
|
|
57
|
-
assert.match(serviceWorker, /pi-webui-pwa-
|
|
58
|
-
assert.match(html, /data-app-src="\/app\.js\?v=
|
|
57
|
+
assert.match(serviceWorker, /pi-webui-pwa-v84/, "PWA cache identity should be bumped for changed browser assets");
|
|
58
|
+
assert.match(html, /data-app-src="\/app\.js\?v=121"/, "browser module URL should be cache-busted for Fast-mode wiring");
|
|
59
59
|
|
|
60
60
|
console.log("codex-fast-mode-static.test.mjs passed");
|
|
@@ -56,8 +56,8 @@ assert.match(app, /function initializeComposerActionOrdering\(\)[\s\S]*MutationO
|
|
|
56
56
|
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");
|
|
57
57
|
assert.match(app, /initializeComposerActionOrdering\(\);[\s\S]*restoreSidePanelSectionOrder\(\);/, "composer ordering should initialize during guarded app startup");
|
|
58
58
|
|
|
59
|
-
assert.match(html, /styles\.css\?v=
|
|
60
|
-
assert.match(html, /app\.js\?v=
|
|
61
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
59
|
+
assert.match(html, /styles\.css\?v=107/, "changed composer styles should advance the stylesheet revision");
|
|
60
|
+
assert.match(html, /app\.js\?v=121/, "changed composer behavior should advance the app revision");
|
|
61
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v84"/, "changed browser assets should advance the PWA cache identity");
|
|
62
62
|
|
|
63
63
|
console.log("composer-action-grid-reorder-static.test.mjs passed");
|
|
@@ -156,7 +156,7 @@ assert.match(worker, /pi-webui-pwa-v\d+[\s\S]*?"\/fast-output-live\.mjs"/, "PWA
|
|
|
156
156
|
assert.match(html, /<label for="fastOutputModeSelect">Compact mode \(Experimental\)<\/label>/, "the sidebar should mark compact mode as experimental");
|
|
157
157
|
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");
|
|
158
158
|
// Intent preserved: the guarded PWA entry point must advance whenever app wiring changes.
|
|
159
|
-
assert.match(html, /id="webuiBootLoader"[^>]*data-app-src="\/app\.js\?v=
|
|
159
|
+
assert.match(html, /id="webuiBootLoader"[^>]*data-app-src="\/app\.js\?v=121"/, "the guarded PWA entry point should cache-bust browser wiring");
|
|
160
160
|
assert.match(JSON.parse(packageRaw).scripts.check, /node --check public\/fast-output-live\.mjs/, "package checks should parse the compact helper");
|
|
161
161
|
|
|
162
162
|
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=107/, "integrated stylesheet changes should advance the cache query");
|
|
170
|
+
assert.match(html, /\/app\.js\?v=121/, "integrated app changes should advance the cache query");
|
|
171
171
|
|
|
172
172
|
console.log("feature decision-output popup static checks passed");
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import vm from "node:vm";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
|
|
7
|
+
const root = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
8
|
+
const [app, css] = await Promise.all([
|
|
9
|
+
readFile(join(root, "public", "app.js"), "utf8"),
|
|
10
|
+
readFile(join(root, "public", "styles.css"), "utf8"),
|
|
11
|
+
]);
|
|
12
|
+
|
|
13
|
+
function sourceBetween(source, startMarker, endMarker, label) {
|
|
14
|
+
const start = source.indexOf(startMarker);
|
|
15
|
+
const end = source.indexOf(endMarker, start + startMarker.length);
|
|
16
|
+
assert.ok(start >= 0 && end > start, `${label} source should be present`);
|
|
17
|
+
return source.slice(start, end);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const searchEntry = sourceBetween(app, "function appendFileSearchEntry(", "\nasync function revealFileTreeEntry(", "file search entry renderer");
|
|
21
|
+
const revealSearchEntry = sourceBetween(app, "async function revealFileTreeEntry(", "\nfunction appendFileTreeEntry(", "file search reveal behavior");
|
|
22
|
+
const clearSearch = sourceBetween(app, "function focusVisibleFileTreeSelection(", "\nasync function runFileTreeSearch(", "file search clear behavior");
|
|
23
|
+
const searchLabelCss = sourceBetween(css, ".file-tree-search-label {", "\n.file-tree-kind {", "file search row styles");
|
|
24
|
+
|
|
25
|
+
assert.match(
|
|
26
|
+
searchEntry,
|
|
27
|
+
/const contextPath = fileParentPath\(path\) \|\| "\.";[\s\S]*make\("span", "file-tree-name"[\s\S]*make\("span", "file-tree-search-path", contextPath\)/,
|
|
28
|
+
"search results should pair the prominent match name with compact parent-path context",
|
|
29
|
+
);
|
|
30
|
+
assert.doesNotMatch(searchEntry, /clearFileTreeSearch\(/, "opening a file or directory search result should not clear the active query");
|
|
31
|
+
assert.match(
|
|
32
|
+
searchEntry,
|
|
33
|
+
/const expanded = isDirectory && fileTreeState\.expanded\.has\(path\);[\s\S]*aria-expanded[\s\S]*fileTreeExpander\(expanded\)[\s\S]*toggleFileTreeDirectory\(path\)/,
|
|
34
|
+
"directory search results should expose and toggle their live expansion state without leaving search",
|
|
35
|
+
);
|
|
36
|
+
assert.match(
|
|
37
|
+
searchEntry,
|
|
38
|
+
/if \(isDirectory && expanded\)[\s\S]*entriesByPath\.get\(path\)[\s\S]*appendFileTreeEntry\(childList, child, 1\)/,
|
|
39
|
+
"expanded search directories should render their loaded children as a nested tree",
|
|
40
|
+
);
|
|
41
|
+
assert.doesNotMatch(revealSearchEntry, /clearFileTreeSearch\(/, "revealing a directory should preserve search while preparing the underlying tree state");
|
|
42
|
+
assert.match(
|
|
43
|
+
revealSearchEntry,
|
|
44
|
+
/fileTreeState\.selectedPath = targetPath;[\s\S]*loadFileTreeDirectory\(FILE_TREE_ROOT_PATH\)[\s\S]*fileTreeState\.expanded\.add/,
|
|
45
|
+
"context-menu reveal should still select, load, and expand the target behind the active search",
|
|
46
|
+
);
|
|
47
|
+
assert.match(
|
|
48
|
+
clearSearch,
|
|
49
|
+
/const selectedPath = normalizeFileTreePath[\s\S]*const selectedEntry = fileTreeState\.searchEntries\.find[\s\S]*const commitClear = \(\) => \{[\s\S]*fileTreeState\.searchQuery = "";[\s\S]*renderFileTree\(\);[\s\S]*focusVisibleFileTreeSelection\(selectedPath\)[\s\S]*revealFileTreeEntry\(selectedEntry, \{ expandTarget: selectedDirectoryExpanded \}\)\.then\(commitClear\)/,
|
|
50
|
+
"clearing search should prepare the selected branch before atomically restoring and focusing the normal tree",
|
|
51
|
+
);
|
|
52
|
+
assert.match(
|
|
53
|
+
searchLabelCss,
|
|
54
|
+
/\.file-tree-search-label \{[\s\S]*display: flex;[\s\S]*align-items: baseline;[\s\S]*white-space: nowrap;/,
|
|
55
|
+
"search result labels should remain on one compact line",
|
|
56
|
+
);
|
|
57
|
+
assert.match(
|
|
58
|
+
searchLabelCss,
|
|
59
|
+
/\.file-tree-search-item \{\s*grid-template-columns: auto auto minmax\(0, 1fr\) auto auto;/,
|
|
60
|
+
"search rows should preserve the normal tree column order for expander, icon, label, Git badge, and kind",
|
|
61
|
+
);
|
|
62
|
+
assert.doesNotMatch(searchLabelCss, /\.file-tree-search-label \{[\s\S]*?display: grid;/, "search labels should not return to the former two-line grid layout");
|
|
63
|
+
|
|
64
|
+
function fakeNode(tag, className = "", text = "") {
|
|
65
|
+
return {
|
|
66
|
+
tag,
|
|
67
|
+
className,
|
|
68
|
+
textContent: text,
|
|
69
|
+
children: [],
|
|
70
|
+
attributes: new Map(),
|
|
71
|
+
listeners: {},
|
|
72
|
+
dataset: {},
|
|
73
|
+
style: { setProperty() {} },
|
|
74
|
+
append(...children) { this.children.push(...children); },
|
|
75
|
+
setAttribute(name, value) { this.attributes.set(name, String(value)); },
|
|
76
|
+
addEventListener(name, listener) { this.listeners[name] = listener; },
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const toggledPaths = [];
|
|
81
|
+
const renderedChildren = [];
|
|
82
|
+
const fileTreeState = {
|
|
83
|
+
expanded: new Set(),
|
|
84
|
+
loading: new Set(),
|
|
85
|
+
selectedPath: "",
|
|
86
|
+
searchQuery: "webui",
|
|
87
|
+
entriesByPath: new Map([["packages", [{ name: "child.js", path: "packages/child.js", type: "file" }]]]),
|
|
88
|
+
};
|
|
89
|
+
const runtime = {
|
|
90
|
+
fileTreeState,
|
|
91
|
+
normalizeFileTreePath: (value) => String(value || "").replace(/^\/+|\/+$/g, ""),
|
|
92
|
+
fileTreeGitStatusForEntry: () => null,
|
|
93
|
+
fileTreeGitStatusClasses: () => "",
|
|
94
|
+
fileTreeGitStatusTitle: () => "",
|
|
95
|
+
fileParentPath: (value) => String(value || "").split("/").slice(0, -1).join("/"),
|
|
96
|
+
fileDisplayName: (value) => String(value || "").split("/").pop() || ".",
|
|
97
|
+
make: fakeNode,
|
|
98
|
+
fileTreeExpander: (expanded) => fakeNode("span", "file-tree-expander", expanded ? "▾" : "▸"),
|
|
99
|
+
fileEntryIcon: () => "DIR",
|
|
100
|
+
fileTreeGitStatusBadge: () => null,
|
|
101
|
+
openFileInViewer: () => {},
|
|
102
|
+
toggleFileTreeDirectory: async (path) => { toggledPaths.push(path); },
|
|
103
|
+
addEvent: () => {},
|
|
104
|
+
showFileContextMenu: () => {},
|
|
105
|
+
bindFileTreeDragAndDrop: () => {},
|
|
106
|
+
fileTreeOverflowButton: () => fakeNode("button", "file-tree-overflow-button", "⋯"),
|
|
107
|
+
appendFileTreeEntry: (parent, child, depth) => { renderedChildren.push({ child, depth }); parent.append(fakeNode("li", "file-tree-node", child.name)); },
|
|
108
|
+
};
|
|
109
|
+
vm.runInNewContext(`${searchEntry}\nthis.renderSearchEntry = appendFileSearchEntry;`, runtime);
|
|
110
|
+
|
|
111
|
+
const directory = { name: "packages", path: "packages", type: "directory", directory: true };
|
|
112
|
+
const collapsedParent = fakeNode("ul");
|
|
113
|
+
runtime.renderSearchEntry(collapsedParent, directory);
|
|
114
|
+
const collapsedButton = collapsedParent.children[0].children[0];
|
|
115
|
+
assert.equal(collapsedButton.attributes.get("aria-expanded"), "false", "search directories should initially report their collapsed state");
|
|
116
|
+
collapsedButton.listeners.click();
|
|
117
|
+
await Promise.resolve();
|
|
118
|
+
assert.deepEqual(toggledPaths, ["packages"], "clicking a search directory should toggle that directory in place");
|
|
119
|
+
assert.equal(fileTreeState.searchQuery, "webui", "clicking a search directory should preserve the active query");
|
|
120
|
+
|
|
121
|
+
fileTreeState.expanded.add("packages");
|
|
122
|
+
const expandedParent = fakeNode("ul");
|
|
123
|
+
runtime.renderSearchEntry(expandedParent, directory);
|
|
124
|
+
const expandedItem = expandedParent.children[0];
|
|
125
|
+
assert.equal(expandedItem.children[0].attributes.get("aria-expanded"), "true", "expanded search directories should expose their state");
|
|
126
|
+
assert.equal(expandedItem.children[2].className, "file-tree-list", "expanded search directories should append a nested child list");
|
|
127
|
+
assert.deepEqual(renderedChildren, [{ child: fileTreeState.entriesByPath.get("packages")[0], depth: 1 }], "expanded search directories should render cached children one level deeper");
|
|
128
|
+
|
|
129
|
+
function focusableTreeItem(path) {
|
|
130
|
+
return {
|
|
131
|
+
dataset: { path },
|
|
132
|
+
focusCalls: 0,
|
|
133
|
+
scrollCalls: 0,
|
|
134
|
+
focus() { this.focusCalls += 1; },
|
|
135
|
+
scrollIntoView() { this.scrollCalls += 1; },
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const nestedFile = { name: "child.js", path: "packages/child.js", type: "file" };
|
|
140
|
+
const clearState = {
|
|
141
|
+
selectedPath: nestedFile.path,
|
|
142
|
+
searchQuery: "child",
|
|
143
|
+
searchEntries: [nestedFile],
|
|
144
|
+
searchLoading: false,
|
|
145
|
+
searchTruncated: false,
|
|
146
|
+
searchTotal: 1,
|
|
147
|
+
expanded: new Set(["packages"]),
|
|
148
|
+
entriesByPath: new Map([["", [{ name: "packages", path: "packages", type: "directory", directory: true }]]]),
|
|
149
|
+
};
|
|
150
|
+
const selectedRow = focusableTreeItem(nestedFile.path);
|
|
151
|
+
let visibleRows = [];
|
|
152
|
+
let revealCall = null;
|
|
153
|
+
let resolveReveal;
|
|
154
|
+
let renderCalls = 0;
|
|
155
|
+
const revealReady = new Promise((resolve) => { resolveReveal = resolve; });
|
|
156
|
+
const searchInput = { value: "child", focusCalls: 0, focus() { this.focusCalls += 1; } };
|
|
157
|
+
const clearRuntime = {
|
|
158
|
+
fileTreeState: clearState,
|
|
159
|
+
fileTreeSearchTimer: null,
|
|
160
|
+
fileTreeSearchRequestSerial: 0,
|
|
161
|
+
FILE_TREE_ROOT_PATH: "",
|
|
162
|
+
elements: { fileTreeSearchInput: searchInput },
|
|
163
|
+
clearTimeout: () => {},
|
|
164
|
+
normalizeFileTreePath: runtime.normalizeFileTreePath,
|
|
165
|
+
fileTreeSearchQueryText: () => searchInput.value.trim(),
|
|
166
|
+
fileEntryByPath: () => nestedFile,
|
|
167
|
+
updateFileTreeSearchControls: () => {},
|
|
168
|
+
fileTreeEntriesStatus: () => "1 item.",
|
|
169
|
+
setFileTreeStatus: () => {},
|
|
170
|
+
renderFileTree: () => { renderCalls += 1; },
|
|
171
|
+
visibleFileTreeItems: () => visibleRows,
|
|
172
|
+
revealFileTreeEntry: (entry, options) => { revealCall = { entry, options }; return revealReady; },
|
|
173
|
+
addEvent: () => {},
|
|
174
|
+
};
|
|
175
|
+
vm.runInNewContext(`${clearSearch}\nthis.clearSearch = clearFileTreeSearch;`, clearRuntime);
|
|
176
|
+
clearRuntime.clearSearch({ focus: true });
|
|
177
|
+
assert.equal(searchInput.value, "", "clearing search should empty the field immediately");
|
|
178
|
+
assert.equal(clearState.searchQuery, "child", "the search result tree should remain rendered while the selected branch is prepared");
|
|
179
|
+
assert.equal(renderCalls, 0, "clearing should not flash a fully collapsed root tree before reveal completes");
|
|
180
|
+
assert.equal(revealCall?.entry, nestedFile, "the selected nested entry should be prepared before clearing search state");
|
|
181
|
+
assert.equal(revealCall?.options?.expandTarget, false, "revealing a selected file should not treat it as an expandable directory");
|
|
182
|
+
|
|
183
|
+
visibleRows = [selectedRow];
|
|
184
|
+
resolveReveal();
|
|
185
|
+
await revealReady;
|
|
186
|
+
await Promise.resolve();
|
|
187
|
+
assert.equal(clearState.searchQuery, "", "search state should clear after the selected branch is ready");
|
|
188
|
+
assert.equal(clearState.searchEntries.length, 0, "search matches should clear only during the final tree transition");
|
|
189
|
+
assert.equal(renderCalls, 1, "the prepared normal tree should render in one committed transition");
|
|
190
|
+
assert.equal(selectedRow.focusCalls, 1, "the selected row should receive focus after its ancestors are ready");
|
|
191
|
+
assert.equal(selectedRow.scrollCalls, 1, "the selected row should be scrolled into view after the transition");
|
|
192
|
+
assert.equal(searchInput.focusCalls, 0, "the search input should not steal focus back from the selected row");
|
|
193
|
+
|
|
194
|
+
const packageDirectory = { name: "package", path: "package", type: "directory", directory: true };
|
|
195
|
+
const libDirectory = { name: "lib", path: "package/lib", type: "directory", directory: true };
|
|
196
|
+
const integrationFile = { name: "remote-core.mjs", path: "package/lib/remote-core.mjs", type: "file" };
|
|
197
|
+
const integrationRow = focusableTreeItem(integrationFile.path);
|
|
198
|
+
const integrationState = {
|
|
199
|
+
selectedPath: integrationFile.path,
|
|
200
|
+
searchQuery: "webui",
|
|
201
|
+
searchEntries: [libDirectory],
|
|
202
|
+
searchLoading: false,
|
|
203
|
+
searchTruncated: false,
|
|
204
|
+
searchTotal: 1,
|
|
205
|
+
expanded: new Set([libDirectory.path]),
|
|
206
|
+
entriesByPath: new Map([
|
|
207
|
+
["", [packageDirectory]],
|
|
208
|
+
[libDirectory.path, [integrationFile]],
|
|
209
|
+
]),
|
|
210
|
+
};
|
|
211
|
+
const integrationInput = { value: "webui", focusCalls: 0, focus() { this.focusCalls += 1; } };
|
|
212
|
+
const integrationRenderModes = [];
|
|
213
|
+
const integrationLoadCalls = [];
|
|
214
|
+
let integrationVisibleRows = [];
|
|
215
|
+
const integrationRuntime = {
|
|
216
|
+
fileTreeState: integrationState,
|
|
217
|
+
fileTreeSearchTimer: null,
|
|
218
|
+
fileTreeSearchRequestSerial: 0,
|
|
219
|
+
FILE_TREE_ROOT_PATH: "",
|
|
220
|
+
elements: { fileTreeSearchInput: integrationInput },
|
|
221
|
+
clearTimeout: () => {},
|
|
222
|
+
normalizeFileTreePath: runtime.normalizeFileTreePath,
|
|
223
|
+
fileParentPath: runtime.fileParentPath,
|
|
224
|
+
fileTreeSearchQueryText: () => integrationInput.value.trim(),
|
|
225
|
+
fileEntryByPath: (path) => {
|
|
226
|
+
for (const entries of integrationState.entriesByPath.values()) {
|
|
227
|
+
const entry = entries.find((candidate) => candidate.path === path);
|
|
228
|
+
if (entry) return entry;
|
|
229
|
+
}
|
|
230
|
+
return null;
|
|
231
|
+
},
|
|
232
|
+
updateFileTreeSearchControls: () => {},
|
|
233
|
+
fileTreeEntriesStatus: () => "1 item.",
|
|
234
|
+
setFileTreeStatus: () => {},
|
|
235
|
+
visibleFileTreeItems: () => integrationVisibleRows,
|
|
236
|
+
loadFileTreeDirectory: async (path) => {
|
|
237
|
+
integrationLoadCalls.push(path);
|
|
238
|
+
if (path === packageDirectory.path) integrationState.entriesByPath.set(path, [libDirectory]);
|
|
239
|
+
return integrationState.entriesByPath.get(path) || [];
|
|
240
|
+
},
|
|
241
|
+
renderFileTree: () => {
|
|
242
|
+
const mode = integrationState.searchQuery ? "search" : "tree";
|
|
243
|
+
integrationRenderModes.push(mode);
|
|
244
|
+
if (mode === "tree" && integrationState.expanded.has(packageDirectory.path) && integrationState.expanded.has(libDirectory.path)) {
|
|
245
|
+
integrationVisibleRows = [integrationRow];
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
addEvent: () => {},
|
|
249
|
+
};
|
|
250
|
+
vm.runInNewContext(`${revealSearchEntry}\n${clearSearch}\nthis.clearSearch = clearFileTreeSearch;`, integrationRuntime);
|
|
251
|
+
integrationRuntime.clearSearch({ focus: true });
|
|
252
|
+
for (let index = 0; index < 12; index += 1) await Promise.resolve();
|
|
253
|
+
assert.deepEqual(integrationLoadCalls, ["", packageDirectory.path, libDirectory.path], "clearing should load the selected file's complete ancestor chain");
|
|
254
|
+
assert.equal(integrationState.expanded.has(packageDirectory.path), true, "the selected file's top-level directory should remain expanded");
|
|
255
|
+
assert.equal(integrationState.expanded.has(libDirectory.path), true, "the directory opened during search should remain expanded");
|
|
256
|
+
assert.equal(integrationRenderModes.at(-1), "tree", "the final render should restore the normal tree");
|
|
257
|
+
assert.equal(integrationRenderModes.slice(0, -1).every((mode) => mode === "search"), true, "ancestor preparation should retain the search results until the normal tree is ready");
|
|
258
|
+
assert.equal(integrationRow.focusCalls, 1, "the selected file should receive focus in the restored normal tree");
|
|
259
|
+
assert.equal(integrationRow.scrollCalls, 1, "the restored normal tree should scroll to the selected file");
|
|
260
|
+
|
|
261
|
+
console.log("file-tree-search-layout-static.test.mjs passed");
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
// isStreaming=true while a scripted flow runs.
|
|
18
18
|
// - FAKE_PI_STATS_PROMPT_CONTEXT=1: advertise /stats-webui and publish deterministic
|
|
19
19
|
// structured or malformed-subsection Prompt/context dashboard payloads.
|
|
20
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
20
21
|
import { createInterface } from "node:readline";
|
|
21
|
-
import { randomUUID } from "node:crypto";
|
|
22
22
|
import { appendFileSync } from "node:fs";
|
|
23
23
|
import {
|
|
24
24
|
BUILTIN_SAMPLING_APIS,
|
|
@@ -216,6 +216,9 @@ logJsonLine({
|
|
|
216
216
|
cwd: process.cwd(),
|
|
217
217
|
recoveryUrl: String(process.env.PI_WEBUI_RECOVERY_URL || ""),
|
|
218
218
|
recoveryTokenConfigured: Boolean(process.env.PI_WEBUI_RECOVERY_TOKEN),
|
|
219
|
+
recoveryTokenDigest: process.env.PI_WEBUI_RECOVERY_TOKEN
|
|
220
|
+
? createHash("sha256").update(process.env.PI_WEBUI_RECOVERY_TOKEN).digest("hex")
|
|
221
|
+
: "",
|
|
219
222
|
...(continuityModeEnabled ? { pid: process.pid, continuityMode: true } : {}),
|
|
220
223
|
});
|
|
221
224
|
|
|
@@ -487,7 +490,8 @@ function handleTranscriptContinuityPrompt(command, base) {
|
|
|
487
490
|
function handleMobileBlockerPrompt(command, base) {
|
|
488
491
|
if (String(command.message || "").trim() !== "fixture mobile blocker") return false;
|
|
489
492
|
respond({ ...base, data: { output: "mobile blocker fixture accepted" } });
|
|
490
|
-
|
|
493
|
+
// Model a handled extension command: it opens a dialog without starting an
|
|
494
|
+
// agent turn, so the browser must settle from the accepted prompt response.
|
|
491
495
|
emitEvent({
|
|
492
496
|
type: "extension_ui_request",
|
|
493
497
|
id: "fixture_blocker_12345678",
|
|
@@ -8,6 +8,7 @@ import { setTimeout as delay } from "node:timers/promises";
|
|
|
8
8
|
import { dirname, join } from "node:path";
|
|
9
9
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
10
10
|
import { terminateProcessTree } from "../lib/process-tree.mjs";
|
|
11
|
+
import { deriveSupervisorRecoveryToken } from "../lib/rpc-supervisor-protocol.mjs";
|
|
11
12
|
import { readSupervisorState, supervisorPaths, supervisorPidIsAlive } from "../lib/rpc-supervisor-state.mjs";
|
|
12
13
|
import { REQUIRED_THEME_TOKENS, serializeTheme } from "../public/theme-contract.mjs";
|
|
13
14
|
|
|
@@ -3848,12 +3849,15 @@ try {
|
|
|
3848
3849
|
body: recoveryBody,
|
|
3849
3850
|
});
|
|
3850
3851
|
assert.equal(wrongCredentialRecovery.status, 401, "recovery endpoint must reject an incorrect bearer credential");
|
|
3852
|
+
const liveRecoverySupervisorState = await readSupervisorState(await supervisorPaths({ agentDir: workflowPolicyAgentDir, port }));
|
|
3853
|
+
assert.ok(liveRecoverySupervisorState?.token, "recovery endpoint test needs the active supervisor credential");
|
|
3854
|
+
const retainedChildRecoveryToken = deriveSupervisorRecoveryToken(liveRecoverySupervisorState.token);
|
|
3851
3855
|
const invalidModeRecovery = await request("127.0.0.1", "/api/recovery/plan", {
|
|
3852
3856
|
method: "POST",
|
|
3853
|
-
headers: { authorization: `Bearer ${
|
|
3857
|
+
headers: { authorization: `Bearer ${retainedChildRecoveryToken}` },
|
|
3854
3858
|
body: { ...recoveryBody, mode: "apply" },
|
|
3855
3859
|
});
|
|
3856
|
-
assert.equal(invalidModeRecovery.status, 400, "recovery endpoint must accept plan-only mode exclusively");
|
|
3860
|
+
assert.equal(invalidModeRecovery.status, 400, "recovery endpoint must accept the stable managed-child credential and plan-only mode exclusively");
|
|
3857
3861
|
if (lan) {
|
|
3858
3862
|
const remoteRecovery = await request(lan, "/api/recovery/plan", {
|
|
3859
3863
|
method: "POST",
|
|
@@ -16,9 +16,9 @@ assert.match(app, /import \{ installMiddleButtonDragScroll \} from "\.\/middle-b
|
|
|
16
16
|
assert.match(app, /installMiddleButtonDragScroll\(\{[\s\S]*onDirection: \(\{ target, offsetY \}\)[\s\S]*noteChatUserScrollIntent\(\{ type: "middle-drag", deltaY: offsetY \}\)/, "chat auto-scroll direction should feed the existing follow/pause intent state");
|
|
17
17
|
assert.match(app, /event\?\.type === "middle-drag"\) return event\.deltaY > 0;/, "moving below the press point should be recognized as intent to read later chat output");
|
|
18
18
|
assert.match(css, /body\.middle-button-auto-scrolling,[\s\S]*cursor: all-scroll !important;[\s\S]*user-select: none !important;/, "active automatic scrolling should expose a directional-scroll affordance and suppress accidental selection");
|
|
19
|
-
assert.match(html, /styles\.css\?v=
|
|
20
|
-
assert.match(html, /app\.js\?v=
|
|
21
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
19
|
+
assert.match(html, /styles\.css\?v=107/, "changed drag-scroll styles should advance the stylesheet revision");
|
|
20
|
+
assert.match(html, /app\.js\?v=121/, "changed drag-scroll wiring should advance the app revision");
|
|
21
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v84";[\s\S]*"\/middle-button-drag-scroll\.mjs"/, "offline PWA installs should refresh and cache the new controller module");
|
|
22
22
|
assert.match(JSON.parse(packageJson).scripts.check, /node --check public\/middle-button-drag-scroll\.mjs/, "the package check should parse the startup-critical controller module");
|
|
23
23
|
|
|
24
24
|
console.log("middle-button-drag-scroll-static.test.mjs passed");
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
|
|
6
|
+
const root = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
7
|
+
const [html, css, app, readme, technical] = await Promise.all([
|
|
8
|
+
readFile(join(root, "public", "index.html"), "utf8"),
|
|
9
|
+
readFile(join(root, "public", "styles.css"), "utf8"),
|
|
10
|
+
readFile(join(root, "public", "app.js"), "utf8"),
|
|
11
|
+
readFile(join(root, "README.md"), "utf8"),
|
|
12
|
+
readFile(join(root, "TECHNICAL.md"), "utf8"),
|
|
13
|
+
]);
|
|
14
|
+
|
|
15
|
+
assert.match(html, /id="terminalTabsToggleButton"[^>]*aria-controls="terminalTabsDrawerContent"[^>]*aria-expanded="false"/, "terminal summary should control the collapsed drawer");
|
|
16
|
+
assert.match(html, /id="terminalTabsDrawerContent"[^>]*aria-label="Terminal navigation"[\s\S]*id="tabBar"[\s\S]*class="terminal-sidebar-actions"[^>]*aria-label="Tab and workspace actions"[\s\S]*id="closeAllTabsButton"/, "drawer should reuse canonical tabs and workspace actions");
|
|
17
|
+
assert.match(html, /id="terminalTabsBackdrop"[^>]*aria-label="Close terminal navigation"[^>]*hidden/, "drawer should expose an accessible backdrop close target");
|
|
18
|
+
assert.match(css, /body\.mobile-tabs-expanded \.terminal-tabs-shell \{[\s\S]*?position:\s*fixed;[\s\S]*?top:\s*0;[\s\S]*?right:\s*0;[\s\S]*?left:\s*0;[\s\S]*?width:\s*100vw;[\s\S]*?height:\s*var\(--visual-viewport-height, 100dvh\);[\s\S]*?border-radius:\s*0;/, "expanded terminal navigation should fill the visual viewport");
|
|
19
|
+
assert.match(css, /body\.mobile-tabs-expanded \.terminal-tabs \{[\s\S]*?position:\s*static;[\s\S]*?flex-direction:\s*column;[\s\S]*?overflow-y:\s*auto/, "drawer tabs should follow the vertical left-sidebar model");
|
|
20
|
+
assert.match(app, /function setMobileTabsExpanded\(expanded, \{ restoreFocus = false \} = \{\}\)[\s\S]*?setComposerActionsOpen\(false\)[\s\S]*?terminalTabsBackdrop\.hidden = !mobileTabsExpanded[\s\S]*?focusReturn\.focus/, "drawer state should coordinate competing surfaces and restore focus");
|
|
21
|
+
assert.match(app, /node\.addEventListener\("pointerenter", \(event\) => \{\n\s+if \(event\.pointerType === "touch"\) return;\n\s+scheduleFooterTooltip\(node\);/, "touch pointers should not schedule floating hover tooltips");
|
|
22
|
+
assert.match(app, /node\.addEventListener\("focus", \(\) => \{\n\s+if \(!node\.matches\(":focus-visible"\)\) return;\n\s+showFooterTooltip\(node\);/, "touch focus should not open a floating tooltip while keyboard focus remains supported");
|
|
23
|
+
assert.match(css, /@media \(hover: none\) and \(pointer: coarse\) \{[\s\S]*?\[data-tooltip\]:not\(:focus-visible\):not\(\.tooltip-open\)::before,[\s\S]*?::after \{[\s\S]*?display:\s*none !important;[\s\S]*?opacity:\s*0 !important;/, "coarse touch layouts should suppress hover-only pseudo tooltips");
|
|
24
|
+
assert.match(app, /function setMobileFooterExpanded\(expanded, \{ restoreFocus = false \} = \{\}\)[\s\S]*?button\.textContent = mobileFooterExpanded \? "−" : "Details"[\s\S]*?"Minimize Git footer details"[\s\S]*?activateDrawerModal\(elements\.statusBar, button[\s\S]*?setMobileFooterExpanded\(false, \{ restoreFocus: true \}\)/, "expanded mobile footer details should use a modal top minimize control with focus restoration");
|
|
25
|
+
assert.match(app, /const footerToggle = make\("button", "footer-details-toggle", mobileFooterExpanded \? "−" : "Details"\)[\s\S]*?aria-label[\s\S]*?setMobileFooterExpanded\(!mobileFooterExpanded, \{ restoreFocus: true \}\)/, "rendered footer details should expose only the minimize symbol while expanded");
|
|
26
|
+
assert.match(css, /html:not\(\[data-mobile-shell="v2"\]\):not\(\[data-tablet-shell="v2"\]\) body\.footer-details-expanded \.statusbar-git-footer \{[\s\S]*?position:\s*fixed;[\s\S]*?inset:\s*0;[\s\S]*?width:\s*100vw;[\s\S]*?height:\s*var\(--visual-viewport-height, 100dvh\);[\s\S]*?border-radius:\s*0;/, "legacy-mobile Git footer details should fill the complete visual viewport without owning v2 surfaces");
|
|
27
|
+
assert.match(css, /body\.footer-details-expanded \.statusbar-git-footer \{[\s\S]*?align-content:\s*start;[\s\S]*?grid-auto-rows:\s*max-content;[\s\S]*?body\.footer-details-expanded \.footer-line-main,[\s\S]*?body\.footer-details-expanded \.footer-line-meta \{[\s\S]*?grid-template-columns:\s*repeat\(2, minmax\(0, 1fr\)\);[\s\S]*?\.footer-line-main::before \{ content:\s*"Session"; \}[\s\S]*?\.footer-line-meta::before \{ content:\s*"Workspace, Git & runtime"; \}/, "expanded mobile Git details should pack compact two-column sections at the top of the overlay");
|
|
28
|
+
assert.match(css, /body\.footer-details-expanded \.footer-line-main > \.footer-metric:nth-child\(odd\):last-child \{ grid-column:\s*1 \/ -1; \}[\s\S]*?body\.footer-details-expanded \.footer-workspace,[\s\S]*?body\.footer-details-expanded \.footer-context,[\s\S]*?body\.footer-details-expanded \.footer-model,[\s\S]*?grid-column:\s*1 \/ -1;/, "odd metrics and long footer metadata should span the mobile details grid without leaving holes");
|
|
29
|
+
assert.match(css, /html:not\(\[data-mobile-shell="v2"\]\):not\(\[data-tablet-shell="v2"\]\) \.statusbar-git-footer \.git-footer-refresh-button \{ display:\s*none; \}[\s\S]*?body\.footer-details-expanded \.statusbar-git-footer \.git-footer-refresh-button \{[\s\S]*?display:\s*inline-grid;[\s\S]*?min-width:\s*44px;[\s\S]*?min-height:\s*44px;/, "legacy-mobile Git footer refresh should be available only in the expanded details overlay");
|
|
30
|
+
assert.match(css, /body\.footer-details-expanded \.side-panel-toggle-button,[\s\S]*?body\.footer-details-expanded \.side-panel-expand-button,[\s\S]*?body\.composer-actions-open \.side-panel-toggle-button,[\s\S]*?body\.composer-actions-open \.side-panel-expand-button,[\s\S]*?body\.mobile-tabs-expanded \.side-panel-toggle-button,[\s\S]*?body\.mobile-tabs-expanded \.side-panel-expand-button \{\n\s+display:\s*none !important;/, "full-screen mobile Git, More, and terminal overlays should hide both side-panel disclosure controls");
|
|
31
|
+
assert.match(css, /body\.mobile-tabs-expanded \.terminal-tabs-shell\[aria-modal="true"\] \{\n\s+z-index:\s*122;/, "the modal terminal drawer should retain its layer above the blurred backdrop while child menus are open");
|
|
32
|
+
assert.match(css, /\.terminal-tab-meta \{ display:\s*none; \}\n\s+\.terminal-tab-group > \.terminal-tab-group-button > \.terminal-tab-meta \{ display:\s*block; \}/, "mobile group buttons should retain the desktop cwd metadata while standalone tab metadata stays compact");
|
|
33
|
+
assert.match(css, /\.terminal-tabs:has\(> \.terminal-tab-group\.menu-open:not\(\.terminal-tab-subagent-group\)\) > \.terminal-new-tab-menu \{\n\s+display:\s*none;/, "mobile tabs should hide the overall new-tab menu only while a regular group exposes its scoped add action");
|
|
34
|
+
assert.match(css, /\.footer-details-toggle \{\n\s+display:\s*block;\n\s+min-width:\s*44px;\n\s+min-height:\s*44px;/, "collapsed Details should retain a 44px mobile touch target");
|
|
35
|
+
assert.match(app, /function runFooterControlAction\(action, event\) \{\n\s+if \(mobileFooterExpanded\) setMobileFooterExpanded\(false, \{ restoreFocus: false \}\);\n\s+return action\(event\);/, "footer actions should deactivate the full-screen footer before opening dialogs or other surfaces");
|
|
36
|
+
|
|
37
|
+
assert.match(html, /id="composerActionsButton"[^>]*aria-controls="composerActionsPanel"[^>]*aria-expanded="false"[^>]*>More<\/button>/, "composer should expose one labelled secondary-action trigger");
|
|
38
|
+
assert.match(html, /id="composerActionsPanel"[^>]*aria-label="More composer actions"[\s\S]*Session & workspace[\s\S]*Tools & commands[\s\S]*Context & modes/, "secondary actions should be grouped in task order");
|
|
39
|
+
assert.match(app, /function syncMobileComposerDisclosureLayout\(\)[\s\S]*?isMobileView\(\) && !isMobileShellV2Active\(\)[\s\S]*?composerActionsPanel\.append\(node\)/, "legacy mobile should reuse canonical secondary controls in the panel");
|
|
40
|
+
assert.match(css, /body\.mobile-composer-disclosure \.composer-input-row \{[\s\S]*?grid-template-columns:\s*minmax\(0, 1fr\) 44px/, "collapsed composer should keep the prompt and attachment control in the input row");
|
|
41
|
+
assert.match(html, /id="chat" class="chat" aria-live="polite"[\s\S]*?<\/div>\s*<div id="runIndicatorHost" class="run-indicator-host"><\/div>/, "mobile should mount the run indicator in a dedicated host immediately after the transcript");
|
|
42
|
+
assert.match(css, /\.chat \{\n\s+padding:\s*0\.62rem 0\.58rem;[\s\S]*?\.run-indicator-host \{\n\s+padding:\s*0 0\.58rem 0\.62rem;[\s\S]*?\.run-indicator-host > \.run-indicator-message \.run-indicator-row \{[\s\S]*?grid-template-columns:\s*auto auto minmax\(0, 1fr\);[\s\S]*?\.run-indicator-host > \.run-indicator-message \.run-indicator-meta \{[\s\S]*?text-overflow:\s*ellipsis;[\s\S]*?white-space:\s*nowrap;/, "mobile should preserve the one-line run indicator layout at the transcript edge from its separate host");
|
|
43
|
+
assert.match(css, /\.todo-widget:not\(\[open\]\) \.todo-widget-summary \{ display:\s*block; \}[\s\S]*?\.todo-widget:not\(\[open\]\) \.todo-widget-goal,[\s\S]*?\.todo-widget:not\(\[open\]\) \.todo-widget-progress \{ display:\s*none; \}[\s\S]*?\.todo-widget:not\(\[open\]\) \.todo-widget-title \{[\s\S]*?text-overflow:\s*ellipsis;[\s\S]*?white-space:\s*nowrap;/, "collapsed mobile todo progress should stay on one overflow-safe summary line until expanded");
|
|
44
|
+
assert.match(css, /\/\* Balanced phone density:[\s\S]*?--mobile-control-size:\s*40px;[\s\S]*?--mobile-page-gutter:\s*0\.5rem;[\s\S]*?--mobile-body-text:\s*0\.86rem;/, "balanced phone density should use one coherent compact scale");
|
|
45
|
+
assert.match(css, /body\.mobile-composer-disclosure \.composer-input-row \{ grid-template-columns:\s*minmax\(0, 1fr\) var\(--mobile-control-size\);[\s\S]*?body\.mobile-composer-disclosure \.composer-actions-panel \{[\s\S]*?padding:\s*calc\(3\.5rem \+ env\(safe-area-inset-top\)\)/, "legacy composer and full-screen More surfaces should use the compact scale");
|
|
46
|
+
assert.match(css, /html\[data-mobile-shell="v2"\] \.mobile-shell-appbar \{[\s\S]*?min-height:\s*calc\(68px \+ env\(safe-area-inset-top\)\);[\s\S]*?\.mobile-shell-nav \{[\s\S]*?min-height:\s*calc\(54px \+ env\(safe-area-inset-bottom\)\);/, "Mobile Experience v2 chrome should use the compact app bar and navigation heights");
|
|
47
|
+
assert.match(css, /html\[data-mobile-shell="v2"\] \.mobile-shell-session-button \{ grid-column:\s*1; grid-row:\s*1;[\s\S]*?#mobileSearchButton \{ grid-column:\s*2; grid-row:\s*1; \}[\s\S]*?#mobileMoreButton \{ grid-column:\s*3; grid-row:\s*1; \}[\s\S]*?\.mobile-shell-indicators \{ grid-row:\s*2;/, "v2 app-bar controls should share the first row instead of creating a sparse third row");
|
|
48
|
+
assert.match(css, /body\.mobile-composer-disclosure\.pi-run-active:not\(\.mobile-keyboard-open\) \.composer-row > #abortButton \{ order:\s*1; \}[\s\S]*?#steerButton \{ order:\s*2; \}[\s\S]*?#followUpButton \{ order:\s*3; \}[\s\S]*?\.composer-actions-button \{ order:\s*4; \}[\s\S]*?#sendButton \{ order:\s*5; \}/, "active primary controls should remain on one predictable row");
|
|
49
|
+
assert.match(css, /body\.mobile-composer-disclosure \.composer-actions-panel \{[\s\S]*?position:\s*fixed;[\s\S]*?inset:\s*0;[\s\S]*?width:\s*100vw;[\s\S]*?height:\s*var\(--visual-viewport-height, 100dvh\);[\s\S]*?max-height:\s*none;[\s\S]*?border-radius:\s*0;/, "secondary actions should use the complete visual viewport");
|
|
50
|
+
assert.match(app, /composerActionsButton\.textContent = shouldOpen \? "−" : "More";[\s\S]*?aria-label", shouldOpen \? "Minimize more composer actions" : "Show more composer actions"/, "the open More overlay should expose an accessible minimize symbol instead of a Less label");
|
|
51
|
+
assert.match(css, /body\.mobile-composer-disclosure\.composer-actions-open \.composer-actions-panel \{ display:\s*grid; \}[\s\S]*?body\.mobile-composer-disclosure\.composer-actions-open \.composer-actions-button \{[\s\S]*?position:\s*fixed;[\s\S]*?top:\s*max\(0\.65rem, env\(safe-area-inset-top\)\);[\s\S]*?right:\s*max\(0\.7rem, env\(safe-area-inset-right\)\);[\s\S]*?width:\s*44px;[\s\S]*?height:\s*44px;/, "secondary actions should appear only after disclosure and keep a 44px minimize control reachable at the top-right");
|
|
52
|
+
assert.match(html, /id="sidePanelEditButton"[^>]*aria-pressed="false"[^>]*aria-label="Edit Control Deck section order"/, "mobile Control Deck should expose a default-off Edit mode");
|
|
53
|
+
assert.match(app, /function isSidePanelSectionReorderingEnabled\(\) \{\n\s+return !isMobileView\(\) \|\| sidePanelSectionEditMode;[\s\S]*?function moveSidePanelSectionByOffset\(sectionId, offset\) \{\n\s+if \(!isSidePanelSectionReorderingEnabled\(\)\) return false;[\s\S]*?function beginSidePanelSectionPointerDrag\(event, sectionId\) \{\n\s+if \(!isSidePanelSectionReorderingEnabled\(\) \|\|/, "desktop Control Deck reordering should stay active while mobile fails closed until Edit is active");
|
|
54
|
+
assert.match(css, /\.side-panel-edit-button \{\n\s+display:\s*none;[\s\S]*?\.side-panel-section-toggle\[data-side-panel-section-toggle\] \{\n\s+cursor:\s*pointer;\n\s+touch-action:\s*manipulation;[\s\S]*?\.side-panel\.section-edit-mode \.side-panel-section-toggle\[data-side-panel-section-toggle\] \{[\s\S]*?cursor:\s*grab;[\s\S]*?touch-action:\s*none;[\s\S]*?@media \(max-width: 720px\), \(max-device-width: 720px\), \(pointer: coarse\) and \(hover: none\) \{[\s\S]*?\.side-panel-edit-button \{ display:\s*inline-flex;/, "desktop should hide Edit while mobile restores it and switches section headers to drag capture in Edit mode");
|
|
55
|
+
assert.match(css, /body\.mobile-composer-disclosure\.mobile-keyboard-open \.composer-row \{[\s\S]*?repeat\(4,[\s\S]*?body\.mobile-composer-disclosure\.mobile-keyboard-open \.composer-actions-button,[\s\S]*?display:\s*none !important/, "keyboard-open mode should retain primary controls and suppress secondary chrome");
|
|
56
|
+
|
|
57
|
+
assert.match(readme, /On a phone, tap the current terminal name to open full-screen terminal navigation[\s\S]*Grouped terminals use their title as a dropdown[\s\S]*tap \*\*More\*\* to open[\s\S]*in a full-screen overlay[\s\S]*Git footer \*\*Details\*\* opens full-screen with refresh inside and a top `−` button[\s\S]*Hover-only tooltips stay hidden on touch controls[\s\S]*\*\*Control Deck\*\*[\s\S]*tap \*\*Edit\*\*[\s\S]*tap \*\*Done\*\*/, "README should explain the full-screen mobile paths and explicit Control Deck editing");
|
|
58
|
+
assert.match(technical, /## Mobile layout[\s\S]*open full-screen terminal navigation[\s\S]*regular or subagent terminal-group title is a dropdown button[\s\S]*Git footer \*\*Details\*\* opens as a full-screen legacy-mobile overlay[\s\S]*Tap \*\*More\*\* to open[\s\S]*accessible top-right `−` control[\s\S]*Control Deck section reordering is always enabled on desktop[\s\S]*`Alt\+ArrowUp` \/ `Alt\+ArrowDown`[\s\S]*Mobile keeps the transient \*\*Edit\*\* \/ \*\*Done\*\* mode[\s\S]*Touch pointers do not schedule hover-only tooltips[\s\S]*Tablet layout, desktop tab placement/, "technical reference should document always-on desktop reordering and transient mobile Edit mode");
|
|
59
|
+
|
|
60
|
+
console.log("mobile compact layout contracts passed");
|
|
@@ -47,9 +47,9 @@ assert.match(css, /html\[data-tablet-shell="v2"\] \.mobile-shell-nav[\s\S]*?widt
|
|
|
47
47
|
assert.match(css, /html\[data-tablet-shell="v2"\] \.mobile-shell-surface[\s\S]*?width: min\(30rem, 72vw\)/, "tablet inspector must be a bounded right-side sheet");
|
|
48
48
|
assert.match(css, /html\[data-tablet-shell="v2"\] \.file-viewer-pane[\s\S]*?position: fixed[\s\S]*?inset: 0/, "tablet files must default to full-screen replacement");
|
|
49
49
|
assert.match(css, /and \(pointer: coarse\)[\s\S]*?min-height: 44px/, "coarse tablet pointers must retain the 44px target floor");
|
|
50
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
51
|
-
assert.match(html, /styles\.css\?v=
|
|
52
|
-
assert.match(html, /app\.js\?v=
|
|
50
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v84"/, "continuity/tablet assets need a coherent cache identity");
|
|
51
|
+
assert.match(html, /styles\.css\?v=107/, "tablet CSS must have a coherent HTML revision");
|
|
52
|
+
assert.match(html, /app\.js\?v=121/, "continuity app logic must have a coherent HTML revision");
|
|
53
53
|
assert.match(readme, /tabletShell=v2/, "tablet preview and rollback must be documented");
|
|
54
54
|
|
|
55
55
|
console.log("mobile-continuity-tablet-static.test.mjs passed");
|
|
@@ -16,9 +16,9 @@ const pkg = JSON.parse(packageRaw);
|
|
|
16
16
|
|
|
17
17
|
const assertionIntent = [
|
|
18
18
|
{
|
|
19
|
-
assertion: "
|
|
20
|
-
status: "
|
|
21
|
-
reason: "
|
|
19
|
+
assertion: "phone controls use the user-selected 40px minimum",
|
|
20
|
+
status: "preserved",
|
|
21
|
+
reason: "Balanced phone density restores a 40px floor while retaining safe areas and unchanged tablet and desktop sizing.",
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
assertion: "legacy mobile tab popover remains available when the v2 flag is off",
|
|
@@ -37,9 +37,9 @@ assert.match(pkg.scripts.check, /node --check public\/transcript-renderer\.mjs/,
|
|
|
37
37
|
assert.match(server, /STATIC_PUBLIC_FILE_EXTENSIONS[\s\S]*"\.mjs"/, "the server must serve typed startup modules from the public asset boundary");
|
|
38
38
|
assert.match(serviceWorker, /"\/mobile-shell-state\.mjs"/, "the PWA shell must cache the new startup module");
|
|
39
39
|
assert.match(serviceWorker, /"\/transcript-renderer\.mjs"/, "the PWA shell must cache the transcript startup module");
|
|
40
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
41
|
-
assert.match(html, /styles\.css\?v=
|
|
42
|
-
assert.match(html, /app\.js\?v=
|
|
40
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v84"/, "the cache identity must change with the startup graph");
|
|
41
|
+
assert.match(html, /styles\.css\?v=107/, "the stylesheet revision must change with mobile/tablet CSS fixes");
|
|
42
|
+
assert.match(html, /app\.js\?v=121/, "the app revision must change with continuity/tablet wiring");
|
|
43
43
|
assert.match(serviceWorker, /const APP_SHELL_NETWORK_TIMEOUT_MS = 8_000;[\s\S]*?event\.waitUntil\([\s\S]*?cache\.put\(request, response\.clone\(\)\)[\s\S]*?return networkResponse;/, "runtime cache writes must extend the event lifetime without blocking bounded network responses");
|
|
44
44
|
assert.match(serviceWorker, /MOBILE_NAVIGATION_MESSAGE_TYPE = "pi-webui:navigate:v1"/, "the service worker must use a versioned active-client navigation message");
|
|
45
45
|
assert.match(serviceWorker, /client\.postMessage\(\{ type: MOBILE_NAVIGATION_MESSAGE_TYPE, target \}\)/, "existing clients must receive only a validated target message");
|
|
@@ -47,8 +47,8 @@ assert.match(app, /function installMobileShellNavigationBridge\([\s\S]*?pi-webui
|
|
|
47
47
|
assert.match(app, /function updateVisualViewportVars\([\s\S]*?keyboardOpen && !isMobileShellV2Active\(\)/, "v2 must retain viewport measurement but suppress legacy keyboard mutation");
|
|
48
48
|
assert.match(app, /function syncMobileChatToBottomForInput\(\) \{\n if \(!isMobileView\(\) \|\| isMobileShellV2Active\(\)\) return;/, "v2 must suppress legacy forced chat scrolling");
|
|
49
49
|
assert.match(app, /function bindMobileViewChanges\([\s\S]*?applyMobileShellViewport\(\);[\s\S]*?if \(isMobileShellV2Active\(\)\) return;/, "v2 must bypass legacy breakpoint mutations");
|
|
50
|
-
assert.match(app, /function setMobileTabsExpanded\(expanded\) \{\n if \(isMobileShellV2Active\(\)\) return;/, "v2 must own surface visibility rather than the legacy tabs expander");
|
|
51
|
-
assert.match(app, /function setMobileFooterExpanded\(expanded\) \{\n if \(isMobileShellV2Active\(\)\) return;/, "v2 must suppress legacy footer expansion");
|
|
50
|
+
assert.match(app, /function setMobileTabsExpanded\(expanded, \{ restoreFocus = false \} = \{\}\) \{\n if \(isMobileShellV2Active\(\)\) return;/, "v2 must own surface visibility rather than the legacy tabs expander");
|
|
51
|
+
assert.match(app, /function setMobileFooterExpanded\(expanded, \{ restoreFocus = false \} = \{\}\) \{\n if \(isMobileShellV2Active\(\)\) return;/, "v2 must suppress legacy footer expansion");
|
|
52
52
|
assert.match(app, /function createBrowserPromptRequestId\(/, "browser prompt submission must mint an opaque request identity");
|
|
53
53
|
assert.match(app, /if \(kind === "prompt"\) bodyBase\.requestId = createBrowserPromptRequestId\(\)/, "the browser identity must travel with primary prompt submission and remain stable in the captured manual-retry body");
|
|
54
54
|
assert.match(server, /BROWSER_PROMPT_REQUEST_LIMIT = 256/, "server request deduplication must remain bounded");
|
|
@@ -61,10 +61,10 @@ assert.match(server, /SSE_BACKPRESSURE_MAX_PENDING_BYTES = 4 \* 1024 \* 1024/, "
|
|
|
61
61
|
assert.match(server, /res\.once\("drain", \(\) => flushSseClient\(client\)\)/, "healthy SSE clients must resume after transient write backpressure");
|
|
62
62
|
assert.match(server, /client\.tab\?\.sseClients\?\.delete\(client\)/, "eviction must remove only the slow client");
|
|
63
63
|
assert.match(server, /client\.res\?\.end\(\)/, "slow-client eviction must finish chunked SSE responses gracefully");
|
|
64
|
-
assert.match(css,
|
|
65
|
-
assert.match(css, /\.
|
|
66
|
-
assert.match(css, /\.composer-
|
|
67
|
-
assert.match(css, /
|
|
64
|
+
assert.match(css, /--mobile-control-size:\s*40px;/, "phone density should expose the selected 40px control floor");
|
|
65
|
+
assert.match(css, /\.terminal-tabs-toggle-button,[\s\S]*?\.terminal-close-all-button \{ min-height:\s*var\(--mobile-control-size\)/, "phone tab targets should use the shared compact control size");
|
|
66
|
+
assert.match(css, /\.side-panel-toggle-button,[\s\S]*?\.composer-attach-button,[\s\S]*?width:\s*var\(--mobile-control-size\);[\s\S]*?height:\s*var\(--mobile-control-size\);/, "phone icon controls should use the shared compact square size");
|
|
67
|
+
assert.match(css, /body\.mobile-composer-disclosure \.composer-input-row \{ grid-template-columns:\s*minmax\(0, 1fr\) var\(--mobile-control-size\);/, "legacy phone composer layout should reserve only the compact attachment width");
|
|
68
68
|
assert.match(css, /html\[data-mobile-shell="v2"\] \{ --mobile-shell-v2-active: 1; \}/, "new v2 CSS must be root-scoped");
|
|
69
69
|
|
|
70
70
|
console.log("mobile-foundation-static.test.mjs passed");
|
|
@@ -54,12 +54,12 @@ assert.match(app, /tabAppRunnerRunningRun\(tab\)/, "Activity must consume canoni
|
|
|
54
54
|
assert.match(app, /installMobilePhoneExperience\(\);/, "the phone shell must be installed at boot");
|
|
55
55
|
|
|
56
56
|
assert.match(css, /html\[data-mobile-shell="v2"\] \.mobile-shell-v2/, "mobile CSS must be root scoped");
|
|
57
|
-
assert.match(css,
|
|
57
|
+
assert.match(css, /--mobile-control-size:\s*40px;[\s\S]*?html\[data-mobile-shell="v2"\][\s\S]*?min-height:\s*var\(--mobile-control-size\)/, "phone v2 targets must use the selected 40px floor");
|
|
58
58
|
assert.match(css, /env\(safe-area-inset-bottom\)/, "bottom controls must honor safe areas");
|
|
59
59
|
assert.match(css, /data-mobile-presentation="essential"/, "Essential presentation must use progressive disclosures");
|
|
60
60
|
assert.match(css, /html\[data-mobile-shell="v2"\] body\.mobile-keyboard-open \.widget-area,[\s\S]*?\.composer-actions-button \{ display: block !important; \}/, "v2 keyboard mode must keep run widgets and the actions entry available");
|
|
61
61
|
assert.match(css, /@media \(prefers-reduced-motion: reduce\)/, "reduced-motion behavior is required");
|
|
62
62
|
assert.match(css, /@media \(forced-colors: active\)/, "forced-color affordances are required");
|
|
63
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
63
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v84"/, "browser asset changes need a coherent cache tuple");
|
|
64
64
|
|
|
65
65
|
console.log("mobile-phone-experience-static.test.mjs passed");
|