@firstpick/pi-package-webui 0.9.9 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DEVELOPMENT.md +42 -13
- package/README.md +7 -7
- package/TECHNICAL.md +8 -8
- package/bin/pi-webui.mjs +197 -63
- package/index.ts +23 -33
- package/lib/git-workflow-preferences.mjs +51 -12
- package/lib/tui-model-profile-selector.mjs +183 -0
- package/lib/tui-resource-selector.mjs +173 -0
- package/package.json +1 -1
- package/public/app.js +220 -73
- package/public/index.html +2 -2
- package/public/service-worker.js +1 -1
- package/public/styles.css +63 -15
- package/tests/boot-failure-diagnostics.test.mjs +3 -3
- package/tests/browser/intercom-conversation-viewer.spec.mjs +76 -53
- package/tests/browser/user-noticeable-fixes.spec.mjs +51 -0
- package/tests/codex-fast-mode-static.test.mjs +2 -2
- package/tests/composer-action-grid-reorder-static.test.mjs +3 -3
- package/tests/control-visibility-static.test.mjs +3 -3
- package/tests/controls-layout-static.test.mjs +3 -3
- package/tests/durable-rpc-supervisor-harness.test.mjs +9 -0
- package/tests/events-tree-context-menu-static.test.mjs +3 -3
- package/tests/fast-mode-client-static.test.mjs +1 -1
- package/tests/feature-decision-output-popup-static.test.mjs +2 -2
- package/tests/file-viewer-image-static.test.mjs +3 -3
- package/tests/fixtures/fake-pi.mjs +3 -3
- package/tests/guided-git-activation-static.test.mjs +24 -12
- package/tests/guided-git-fallback-runtime.test.mjs +209 -270
- package/tests/guided-git-fallback-ui-static.test.mjs +2 -2
- package/tests/guided-git-message-reliability-static.test.mjs +2 -1
- package/tests/guided-git-optional-feature.test.mjs +8 -5
- package/tests/http-endpoints-harness.test.mjs +22 -4
- package/tests/intercom-conversation-viewer-static.test.mjs +7 -6
- package/tests/intercom-tag-layout-static.test.mjs +35 -16
- package/tests/intercom-tag-overflow-layout.test.mjs +87 -0
- package/tests/main-output-loading-static.test.mjs +3 -3
- package/tests/middle-button-drag-scroll-static.test.mjs +3 -3
- package/tests/mobile-continuity-tablet-static.test.mjs +3 -3
- package/tests/mobile-foundation-static.test.mjs +3 -3
- package/tests/mobile-phone-experience-static.test.mjs +1 -1
- package/tests/mobile-static.test.mjs +11 -6
- package/tests/open-issue-wizard-static.test.mjs +1 -1
- package/tests/persistent-ui-layout-static.test.mjs +3 -3
- package/tests/prompt-input-vertical-scroll-static.test.mjs +3 -3
- package/tests/questionnaire-dialog.test.mjs +3 -3
- package/tests/remote-auth-settings-harness.test.mjs +18 -3
- package/tests/resource-tui-extension.test.mjs +2 -1
- package/tests/session-sampling-ui-static.test.mjs +3 -3
- package/tests/side-panel-section-height-removal-static.test.mjs +3 -3
- package/tests/subagent-observability-static.test.mjs +2 -2
- package/tests/syntax-highlighting-static.test.mjs +3 -3
- package/tests/theme-customizer-static.test.mjs +1 -1
- package/tests/tui-model-profile-selector.test.mjs +102 -0
- package/tests/tui-resource-selector.test.mjs +74 -0
- package/tests/webui-settings-locking.test.mjs +32 -1
- package/tests/windows-drive-cwd-picker-static.test.mjs +3 -3
|
@@ -54,7 +54,7 @@ assert.match(readme, /fallback model and its own reasoning effort[\s\S]*tries th
|
|
|
54
54
|
assert.match(technical, /## Guided Git generation profiles[\s\S]*strict one-retry policy[\s\S]*model and reasoning effort are restored[\s\S]*dead Pi process cannot run the fallback/i, "technical reference should document configuration and operational limits");
|
|
55
55
|
assert.match(development, /### Fallback browser\/runtime contract[\s\S]*fallbackUsed: true[\s\S]*webui_git_workflow_generation_fallback_started[\s\S]*never sends a retry/, "development guide should preserve the response/event and browser ownership contract");
|
|
56
56
|
|
|
57
|
-
assert.match(html, /data-app-src="\/app\.js\?v=
|
|
58
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
57
|
+
assert.match(html, /data-app-src="\/app\.js\?v=177"/, "the changed browser app should use the next query revision");
|
|
58
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v145";/, "the PWA cache identity should advance with browser behavior");
|
|
59
59
|
|
|
60
60
|
console.log("guided-git-fallback-ui-static.test.mjs passed");
|
|
@@ -11,7 +11,8 @@ const [app, server, artifacts] = await Promise.all([
|
|
|
11
11
|
readFile(path.join(packageDir, "lib", "git-message-artifacts.mjs"), "utf8"),
|
|
12
12
|
]);
|
|
13
13
|
|
|
14
|
-
assert.match(server, /async function
|
|
14
|
+
assert.match(server, /async function createGitWorkflowArtifactGeneration\(tab, generationId, kind\)[\s\S]*kind === "commit"[\s\S]*id: generationId[\s\S]*baseline: await readStableGitMessageArtifactPair\(commitMessagePaths\(cwd\)\)/, "commit generation must retain the shared server-owned ID and exact pre-primary baseline");
|
|
15
|
+
assert.match(server, /function gitWorkflowMessageCwd\(root, cwd\)[\s\S]*suppliedCwd !== repositoryRoot[\s\S]*return repositoryRoot;/, "commit and branch artifacts must resolve at repository root after validating a nested tab cwd");
|
|
15
16
|
assert.match(server, /generationId: record\.generationId/, "generation dispatch must return one server-owned correlation ID across every kind and both attempts");
|
|
16
17
|
assert.match(server, /tab\.gitWorkflowArtifactGeneration = record\.artifactGeneration/, "the artifact generation record must be owned by the originating tab");
|
|
17
18
|
assert.match(server, /case "\/api\/git-workflow\/message"[\s\S]*generationId[\s\S]*tab\?\.gitWorkflowArtifactGeneration/, "fresh message reads must resolve the correlated generation from the requested tab");
|
|
@@ -9,7 +9,7 @@ const root = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
|
9
9
|
const app = await readFile(join(root, "public", "app.js"), "utf8");
|
|
10
10
|
const extensionManifest = JSON.parse(await readFile(join(root, "..", "pi-extension-git-guided-workflow", "package.json"), "utf8"));
|
|
11
11
|
|
|
12
|
-
test("Optional Features installs the Guided Git extension that
|
|
12
|
+
test("Optional Features installs the Guided Git extension that owns native generation", () => {
|
|
13
13
|
assert.deepEqual(OPTIONAL_FEATURE_BY_ID.get("gitWorkflow"), {
|
|
14
14
|
featureId: "gitWorkflow",
|
|
15
15
|
packageName: "@firstpick/pi-extension-git-guided-workflow",
|
|
@@ -19,13 +19,16 @@ test("Optional Features installs the Guided Git extension that bundles its promp
|
|
|
19
19
|
assert.equal(new Set(OPTIONAL_FEATURE_CATALOG.map(({ featureId }) => featureId)).size, OPTIONAL_FEATURE_CATALOG.length);
|
|
20
20
|
assert.equal(new Set(OPTIONAL_FEATURE_CATALOG.map(({ packageName }) => packageName)).size, OPTIONAL_FEATURE_CATALOG.length);
|
|
21
21
|
|
|
22
|
-
assert.equal(extensionManifest.dependencies?.["@firstpick/pi-prompts-git-pr"],
|
|
23
|
-
assert.
|
|
24
|
-
assert.
|
|
22
|
+
assert.equal(extensionManifest.dependencies?.["@firstpick/pi-prompts-git-pr"], undefined);
|
|
23
|
+
assert.equal(extensionManifest.bundledDependencies, undefined);
|
|
24
|
+
assert.equal(extensionManifest.pi?.prompts, undefined);
|
|
25
25
|
|
|
26
26
|
assert.match(app, /id: "gitWorkflow"[\s\S]*packageName: "@firstpick\/pi-extension-git-guided-workflow"[\s\S]*capabilityLabel: "\/git-guided-workflow"/u);
|
|
27
|
+
assert.match(app, /description: "Cross-surface workflow with native commit, branch, and pull-request generation commands\."/u);
|
|
28
|
+
assert.doesNotMatch(app, /bundled commit, branch, and pull-request prompt templates/u);
|
|
27
29
|
assert.match(app, /\["git-guided-workflow", "gitWorkflow"\][\s\S]*\["git-staged-msg", "gitWorkflow"\]/u);
|
|
28
|
-
assert.match(app, /optionalFeatureAvailability\.gitWorkflow = hasAvailableCommand\("git-guided-workflow"\) \|\|
|
|
30
|
+
assert.match(app, /optionalFeatureAvailability\.gitWorkflow = hasAvailableCommand\("git-guided-workflow"\) \|\| hasLoadedGuidedGitNativeCommand\("git-staged-msg", activeTabId\);/u);
|
|
31
|
+
assert.match(app, /function hasLoadedGuidedGitNativeCommand[\s\S]*source === "extension"/u);
|
|
29
32
|
assert.match(app, /case "git-workflow": return true;/u, "the browser-owned setup must not depend on a removed prompt command");
|
|
30
33
|
assert.match(app, /case "git-workflow": return openNativeGitWorkflowSetupDialog\(\);/u, "Setup must open the Guided Git workflow dialog");
|
|
31
34
|
});
|
|
@@ -1909,17 +1909,35 @@ try {
|
|
|
1909
1909
|
assert.ok((forkWhileRunning.body?.data?.tabs || []).some((tab) => tab.id === forkSourceTabId), "fork response should keep the original running tab in the tab list");
|
|
1910
1910
|
assert.ok((forkWhileRunning.body?.data?.tabs || []).some((tab) => tab.id === forkedTabId), "fork response should include the new fork tab in the tab list");
|
|
1911
1911
|
assert.match(String(forkWhileRunning.body?.data?.sessionFile || ""), /\.jsonl$/, "fork response should include the new session file");
|
|
1912
|
-
const
|
|
1912
|
+
const forkSessionFile = forkWhileRunning.body.data.sessionFile;
|
|
1913
|
+
const forkSessionContent = await readFile(forkSessionFile, "utf8");
|
|
1913
1914
|
assert.match(forkSessionContent, /"type":"session"/, "forked session file should be written before opening its tab");
|
|
1915
|
+
const closeOriginalForkTab = await request("127.0.0.1", "/api/tabs/close", { method: "POST", body: { ids: [forkedTabId] }, timeoutMs: 10_000 });
|
|
1916
|
+
assert.equal(closeOriginalForkTab.status, 200, "the original fork tab should close before testing session resume");
|
|
1917
|
+
const resumedWhileSourceRuns = await request("127.0.0.1", "/api/switch-session", {
|
|
1918
|
+
method: "POST",
|
|
1919
|
+
body: { tab: forkSourceTabId, sessionPath: forkSessionFile },
|
|
1920
|
+
timeoutMs: 10_000,
|
|
1921
|
+
});
|
|
1922
|
+
assert.equal(resumedWhileSourceRuns.status, 200, `session resume should open a new tab while the source runs: ${resumedWhileSourceRuns.body?.error || ""}`);
|
|
1923
|
+
const resumedTabId = resumedWhileSourceRuns.body?.data?.tab?.id;
|
|
1924
|
+
assert.ok(resumedTabId, "session resume should return the new terminal tab");
|
|
1925
|
+
assert.notEqual(resumedTabId, forkSourceTabId, "session resume must not replace the source terminal");
|
|
1926
|
+
assert.equal(resumedWhileSourceRuns.body?.data?.sourceTab?.id, forkSourceTabId, "session resume should identify the unchanged source terminal");
|
|
1927
|
+
assert.ok((resumedWhileSourceRuns.body?.data?.tabs || []).some((tab) => tab.id === forkSourceTabId), "session resume should keep the source terminal open");
|
|
1928
|
+
assert.ok((resumedWhileSourceRuns.body?.data?.tabs || []).some((tab) => tab.id === resumedTabId), "session resume should include the new terminal in the tab list");
|
|
1929
|
+
const resumedState = await request("127.0.0.1", `/api/state?tab=${encodeURIComponent(resumedTabId)}`);
|
|
1930
|
+
assert.equal(resumedState.status, 200, "the resumed terminal should respond independently");
|
|
1931
|
+
assert.equal(resumedState.body?.data?.sessionFile, forkSessionFile, "the new terminal should load the selected persisted session");
|
|
1914
1932
|
const sourceAfterFork = await request("127.0.0.1", `/api/state?tab=${encodeURIComponent(forkSourceTabId)}`);
|
|
1915
|
-
assert.equal(sourceAfterFork.status, 200, "source tab should still respond after forking");
|
|
1933
|
+
assert.equal(sourceAfterFork.status, 200, "source tab should still respond after forking and resuming elsewhere");
|
|
1916
1934
|
for (let attempt = 0; attempt < 40 && sourceAfterFork.body?.data?.isStreaming; attempt++) {
|
|
1917
1935
|
const next = await request("127.0.0.1", `/api/state?tab=${encodeURIComponent(forkSourceTabId)}`);
|
|
1918
1936
|
if (!next.body?.data?.isStreaming) break;
|
|
1919
1937
|
await delay(100);
|
|
1920
1938
|
}
|
|
1921
|
-
const closeForkTestTabs = await request("127.0.0.1", "/api/tabs/close", { method: "POST", body: { ids: [forkSourceTabId,
|
|
1922
|
-
assert.equal(closeForkTestTabs.status, 200, "fork test tabs should close before continuing baseline endpoint checks");
|
|
1939
|
+
const closeForkTestTabs = await request("127.0.0.1", "/api/tabs/close", { method: "POST", body: { ids: [forkSourceTabId, resumedTabId] }, timeoutMs: 10_000 });
|
|
1940
|
+
assert.equal(closeForkTestTabs.status, 200, "fork and resume test tabs should close before continuing baseline endpoint checks");
|
|
1923
1941
|
|
|
1924
1942
|
const gitAvailable = spawnSync("git", ["--version"], { encoding: "utf8" }).status === 0;
|
|
1925
1943
|
if (gitAvailable) {
|
|
@@ -58,7 +58,7 @@ assert.match(tagsSource, /const seenConversationIds = new Set\(\)/, "tag renderi
|
|
|
58
58
|
assert.match(tagsSource, /seenConversationIds\.has\(conversation\.id\)[\s\S]*seenConversationIds\.add\(conversation\.id\)/, "each projected conversation should create at most one tag");
|
|
59
59
|
assert.match(tagsSource, /dataset\.intercomConversationId = conversation\.id/, "tags should retain only the opaque conversation ID");
|
|
60
60
|
assert.match(tagsSource, /aria-haspopup", "dialog"[\s\S]*aria-controls", "intercomConversationDialog"/, "each tag should advertise its dialog relationship");
|
|
61
|
-
assert.match(tagsSource, /container\.hidden =
|
|
61
|
+
assert.match(tagsSource, /if \(!conversations\.length\)[\s\S]*container\.replaceChildren\(\)[\s\S]*container\.hidden = true/, "the tag list should disappear and clear stale disclosure state when there are no conversations");
|
|
62
62
|
|
|
63
63
|
const summarySource = functionSource("refreshIntercomConversationSummaries");
|
|
64
64
|
assert.match(summarySource, /api\("\/api\/intercom\/conversations", \{ tabId: tabContext\.tabId \}\)/, "summary requests should stay scoped to the selected tab");
|
|
@@ -88,16 +88,17 @@ assert.match(functionSource("scheduleIntercomConversationDetailRefresh"), /INTER
|
|
|
88
88
|
assert.match(functionSource("resetIntercomConversationDialog"), /intercomDetailRequestSerial \+= 1[\s\S]*clearTimeout\(intercomDetailRefreshTimer\)[\s\S]*intercomConversationDialogState = null/, "dialog close should invalidate requests, cancel polling, and clear selection state");
|
|
89
89
|
assert.match(app, /elements\.intercomConversationDialog\?\.addEventListener\("close", resetIntercomConversationDialog\)/, "native Escape and close-button paths should share polling cleanup");
|
|
90
90
|
|
|
91
|
-
assert.match(css, /\.composer-intercom-tags \{[\s\S]*display:
|
|
92
|
-
assert.match(css,
|
|
91
|
+
assert.match(css, /\.composer-intercom-tags \{[\s\S]*display: inline-flex;[\s\S]*flex: 0 1 50%;[\s\S]*max-width: 50%;[\s\S]*overflow: hidden;/, "conversation tags should use up to half the desktop input width without a horizontal scroller");
|
|
92
|
+
assert.match(css, /\.composer-intercom-overflow-menu \{[\s\S]*position: absolute;[\s\S]*max-height:[\s\S]*overflow-y: auto;/, "hidden conversations should remain reachable in a bounded popup");
|
|
93
|
+
assert.match(css, /@media \(max-width: 720px\)[\s\S]*\.composer-intercom-tags \{ flex: 0 0 100%; width: 100%; min-width: 0; max-width: 100%; \}/, "conversation tags should regain the available row width on narrow and coarse-pointer layouts");
|
|
93
94
|
assert.doesNotMatch(css, /\.composer-intercom-tags \{[^}]*overflow-x:\s*(?:auto|scroll)/, "the conversation tag group should not restore horizontal scrolling");
|
|
94
95
|
assert.match(css, /\.composer-intercom-tag:hover,[\s\S]*\.composer-intercom-tag:focus-visible/, "tags should expose pointer and keyboard focus states");
|
|
95
96
|
assert.match(css, /\.extension-dialog\.intercom-conversation-dialog \{[\s\S]*width: min\(76rem,[\s\S]*height: min\(54rem,/, "the viewer should use a large in-app modal");
|
|
96
97
|
assert.match(css, /@media \(max-width: 720px\)[\s\S]*\.composer-intercom-tag \{ min-height: 44px;[\s\S]*\.extension-dialog\.intercom-conversation-dialog[\s\S]*width: calc\(100vw - 0\.7rem\)/, "tags and the dialog should remain reachable on narrow and coarse-pointer layouts");
|
|
97
98
|
|
|
98
|
-
assert.match(html, /\/styles\.css\?v=
|
|
99
|
-
assert.match(html, /data-app-src="\/app\.js\?v=
|
|
100
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
99
|
+
assert.match(html, /\/styles\.css\?v=145/, "the stylesheet URL should advance for the bounded conversation tags");
|
|
100
|
+
assert.match(html, /data-app-src="\/app\.js\?v=177"/, "the guarded app URL should advance for current browser wiring");
|
|
101
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v145"/, "the PWA cache identity should advance with browser assets");
|
|
101
102
|
|
|
102
103
|
assert.match(readme, /one compact tag per conversation appears beneath the composer/i, "the README should explain the user-visible entry point");
|
|
103
104
|
assert.match(technical, /## Agent conversation viewer[\s\S]*Attachments, tool calls and results, thinking, stdout\/stderr, filesystem paths, raw session records/i, "the advanced guide should document privacy exclusions");
|
|
@@ -17,30 +17,49 @@ function rule(selector, label) {
|
|
|
17
17
|
return css.slice(start, end + 1);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
function functionSource(name, nextName) {
|
|
21
|
+
const start = app.indexOf(`function ${name}(`);
|
|
22
|
+
const candidates = [
|
|
23
|
+
app.indexOf(`\nfunction ${nextName}(`, start),
|
|
24
|
+
app.indexOf(`\nasync function ${nextName}(`, start),
|
|
25
|
+
].filter((index) => index > start);
|
|
26
|
+
const end = Math.min(...candidates);
|
|
27
|
+
assert.ok(start >= 0 && Number.isFinite(end), `${name} should remain a standalone frontend helper`);
|
|
28
|
+
return app.slice(start, end);
|
|
29
|
+
}
|
|
30
|
+
|
|
20
31
|
const container = rule(".composer-intercom-tags", "conversation tag container styles");
|
|
21
|
-
const denseContainer = rule(".composer-intercom-tags.dense", "dense conversation tag container styles");
|
|
22
|
-
const containerRules = [...css.matchAll(/\.composer-intercom-tags(?:\.dense)?\s*\{([^}]*)\}/g)].map((match) => match[1]).join("\n");
|
|
23
32
|
const tag = rule(".composer-intercom-tag", "conversation tag styles");
|
|
24
33
|
const label = rule(".composer-intercom-tag-label", "conversation tag label styles");
|
|
25
34
|
const icon = rule(".composer-intercom-tag-icon", "conversation tag icon styles");
|
|
26
35
|
const count = rule(".composer-intercom-tag-count", "conversation tag count styles");
|
|
36
|
+
const disclosure = functionSource("setIntercomConversationOverflowOpen", "fitIntercomConversationTags");
|
|
37
|
+
const install = functionSource("installIntercomConversationTagResizeHandling", "updateIntercomConversationTag");
|
|
38
|
+
const render = functionSource("renderIntercomConversationTags", "refreshIntercomConversationSummaries");
|
|
27
39
|
|
|
28
|
-
assert.match(container, /
|
|
29
|
-
assert.match(container, /
|
|
30
|
-
assert.match(container, /
|
|
31
|
-
assert.match(
|
|
32
|
-
assert.match(
|
|
33
|
-
assert.match(container, /
|
|
34
|
-
assert.doesNotMatch(
|
|
35
|
-
assert.doesNotMatch(container, /
|
|
36
|
-
|
|
37
|
-
assert.match(tag, /
|
|
38
|
-
assert.match(tag, /overflow:\s*hidden;/, "
|
|
40
|
+
assert.match(container, /position:\s*relative;/, "the overflow popup should anchor to the conversation tag strip");
|
|
41
|
+
assert.match(container, /display:\s*inline-flex;/, "conversation tags should remain on one measured row");
|
|
42
|
+
assert.match(container, /flex-direction:\s*row-reverse;/, "the newest conversation should start at the right edge and older tags should extend toward the middle");
|
|
43
|
+
assert.match(container, /flex:\s*0 1 50%;/, "the desktop strip should be allowed to reach the middle of the input row");
|
|
44
|
+
assert.match(container, /max-width:\s*50%;/, "the desktop strip should stop at half of the input row");
|
|
45
|
+
assert.match(container, /overflow:\s*hidden;/, "unfitted direct tags should not leak outside the strip");
|
|
46
|
+
assert.doesNotMatch(css, /\.composer-intercom-tags\.dense\s*\{/, "dense grids should not make conversation labels unrecognizable");
|
|
47
|
+
assert.doesNotMatch(container, /overflow(?:-x|-inline)?\s*:[^;]*(?:auto|scroll)/, "conversation tags should not restore horizontal scrolling");
|
|
48
|
+
|
|
49
|
+
assert.match(tag, /flex:\s*0 0 auto;[\s\S]*width:\s*auto;[\s\S]*max-width:\s*min\(13rem, 100%\);/, "direct tags should keep readable intrinsic widths up to the bounded maximum before overflow fitting");
|
|
50
|
+
assert.match(tag, /overflow:\s*hidden;/, "a single very long tag should still truncate safely");
|
|
39
51
|
assert.match(label, /flex:\s*1 1 auto;[\s\S]*min-width:\s*0;[\s\S]*overflow:\s*hidden;[\s\S]*text-overflow:\s*ellipsis;[\s\S]*white-space:\s*nowrap;/, "long visual labels should produce a real single-line ellipsis");
|
|
40
52
|
assert.match(icon, /flex:\s*0 0 auto;/, "the conversation icon should stay stable while the label shrinks");
|
|
41
53
|
assert.match(count, /flex:\s*0 0 auto;/, "the conversation count should stay stable while the label shrinks");
|
|
42
|
-
|
|
43
|
-
assert.match(
|
|
44
|
-
assert.match(
|
|
54
|
+
|
|
55
|
+
assert.match(disclosure, /classList\.toggle\("overflow-open", expanded\)[\s\S]*aria-expanded[\s\S]*menu\.hidden = !expanded/, "the +X disclosure should synchronize visual, accessible, and hidden state");
|
|
56
|
+
assert.match(install, /ResizeObserver[\s\S]*event\.key !== "Escape"[\s\S]*restoreFocus: true[\s\S]*document\.addEventListener\("pointerdown"/, "resize, Escape, and outside-click handling should keep the disclosure usable");
|
|
57
|
+
assert.match(render, /make\("button", "composer-intercom-tag overflow"[\s\S]*aria-haspopup[\s\S]*intercomConversationOverflowMenu[\s\S]*role", "dialog"/, "the hidden conversation count should render as an accessible popup button");
|
|
58
|
+
assert.match(render, /composer-intercom-overflow-menu-item[\s\S]*setIntercomConversationOverflowOpen\(false\);[\s\S]*openIntercomConversation\(conversationId\)/, "hidden conversations should open through the existing conversation dialog");
|
|
59
|
+
assert.match(css, /\.composer-intercom-overflow-menu \{[\s\S]*position: absolute;[\s\S]*bottom: calc\(100% \+ 0\.42rem\);[\s\S]*max-height:[\s\S]*overflow-y: auto;/, "the bounded popup should expand upward above the compact strip");
|
|
60
|
+
assert.match(css, /@media \(max-width: 720px\)[\s\S]*?\.composer-intercom-tags \{ flex: 0 0 100%; width: 100%; min-width: 0; max-width: 100%; \}[\s\S]*?\.composer-intercom-overflow-menu \.composer-intercom-tag \{ min-height: 44px; \}/, "narrow disclosures should use the full row and keep hidden conversations touch-friendly");
|
|
61
|
+
assert.match(css, /body\.mobile-composer-disclosure \.composer-actions-panel > \.composer-context-tags \{[\s\S]*display: flex;[\s\S]*flex-wrap: wrap;/, "the narrow composer disclosure should give the full-width conversation strip its own row");
|
|
62
|
+
assert.match(app, /installSessionSkillTagResizeHandling\(\);\s*installIntercomConversationTagResizeHandling\(\);/, "startup should install responsive fitting for both compact tag groups");
|
|
63
|
+
assert.match(app, /const visualSignature = JSON\.stringify\(\[label, conversation\.messageCount\]\);[\s\S]*tag\.replaceChildren\(\.\.\.children\);[\s\S]*tag\.dataset\.intercomVisualSignature = visualSignature;/, "unchanged tag visuals should retain their existing children inside the polite live region");
|
|
45
64
|
|
|
46
65
|
console.log("intercom-tag-layout-static.test.mjs passed");
|
|
@@ -0,0 +1,87 @@
|
|
|
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 = await readFile(join(root, "public", "app.js"), "utf8");
|
|
9
|
+
|
|
10
|
+
function functionSource(name, nextName) {
|
|
11
|
+
const start = app.indexOf(`function ${name}(`);
|
|
12
|
+
const end = app.indexOf(`\nfunction ${nextName}(`, start);
|
|
13
|
+
assert.ok(start >= 0 && end > start, `${name} should remain a standalone frontend helper`);
|
|
14
|
+
return app.slice(start, end);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function chip(width) {
|
|
18
|
+
return {
|
|
19
|
+
hidden: false,
|
|
20
|
+
textContent: "",
|
|
21
|
+
title: "",
|
|
22
|
+
attributes: new Map(),
|
|
23
|
+
measurements: 0,
|
|
24
|
+
setAttribute(name, value) {
|
|
25
|
+
this.attributes.set(name, value);
|
|
26
|
+
},
|
|
27
|
+
getBoundingClientRect() {
|
|
28
|
+
this.measurements += 1;
|
|
29
|
+
return { width };
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const tags = [chip(90), chip(100), chip(110)];
|
|
35
|
+
const menuItems = [chip(90), chip(100), chip(110)];
|
|
36
|
+
const overflow = chip(22);
|
|
37
|
+
const overflowStateCalls = [];
|
|
38
|
+
const container = {
|
|
39
|
+
hidden: false,
|
|
40
|
+
clientWidth: 250,
|
|
41
|
+
querySelectorAll: (selector) => {
|
|
42
|
+
if (selector === ":scope > button.composer-intercom-tag:not(.overflow)") return tags;
|
|
43
|
+
if (selector === ".composer-intercom-overflow-menu-item") return menuItems;
|
|
44
|
+
return [];
|
|
45
|
+
},
|
|
46
|
+
querySelector: (selector) => selector === "button.composer-intercom-tag.overflow" ? overflow : null,
|
|
47
|
+
};
|
|
48
|
+
const context = {
|
|
49
|
+
elements: { intercomConversationTags: container },
|
|
50
|
+
intercomConversationOverflowOpen: false,
|
|
51
|
+
setIntercomConversationOverflowOpen: (open) => overflowStateCalls.push(open),
|
|
52
|
+
getComputedStyle: () => ({ columnGap: "5px", gap: "5px" }),
|
|
53
|
+
};
|
|
54
|
+
vm.runInNewContext(
|
|
55
|
+
`${functionSource("fitIntercomConversationTags", "scheduleIntercomConversationTagLayout")}\nthis.fitIntercomConversationTags = fitIntercomConversationTags;`,
|
|
56
|
+
context,
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
context.fitIntercomConversationTags();
|
|
60
|
+
assert.deepEqual(tags.map((tag) => tag.hidden), [false, false, true], "the strip should keep the maximum complete conversation tags that fit");
|
|
61
|
+
assert.deepEqual(menuItems.map((tag) => tag.hidden), [true, true, false], "the popup should contain only conversations hidden from the strip");
|
|
62
|
+
assert.equal(overflow.hidden, false, "the overflow chip should remain visible while conversations are hidden");
|
|
63
|
+
assert.equal(overflow.textContent, "+1", "the overflow chip should report the current hidden count");
|
|
64
|
+
assert.equal(overflow.attributes.get("aria-label"), "Show 1 more agent conversation", "the disclosure should announce its current hidden count");
|
|
65
|
+
assert.equal(overflow.measurements, 1, "fitting should measure one overflow width per digit count");
|
|
66
|
+
|
|
67
|
+
container.clientWidth = 320;
|
|
68
|
+
context.fitIntercomConversationTags();
|
|
69
|
+
assert.deepEqual(tags.map((tag) => tag.hidden), [false, false, false], "widening the input should reveal every conversation without a data refresh");
|
|
70
|
+
assert.deepEqual(menuItems.map((tag) => tag.hidden), [true, true, true], "the popup should not duplicate visible conversations");
|
|
71
|
+
assert.equal(overflow.hidden, true, "the +X chip should disappear when every conversation fits");
|
|
72
|
+
assert.deepEqual(overflowStateCalls, [false], "revealing every conversation should close an open overflow popup");
|
|
73
|
+
|
|
74
|
+
container.clientWidth = 130;
|
|
75
|
+
context.fitIntercomConversationTags();
|
|
76
|
+
assert.deepEqual(tags.map((tag) => tag.hidden), [false, true, true], "narrowing the input should hide whole tags instead of crushing every label");
|
|
77
|
+
assert.deepEqual(menuItems.map((tag) => tag.hidden), [true, false, false], "responsive fitting should update the selectable popup contents");
|
|
78
|
+
assert.equal(overflow.textContent, "+2", "responsive fitting should keep the overflow count current");
|
|
79
|
+
|
|
80
|
+
container.clientWidth = 0;
|
|
81
|
+
const zeroWidthState = tags.map((tag) => tag.hidden);
|
|
82
|
+
const zeroWidthOverflowText = overflow.textContent;
|
|
83
|
+
context.fitIntercomConversationTags();
|
|
84
|
+
assert.deepEqual(tags.map((tag) => tag.hidden), zeroWidthState, "a temporarily unmeasurable strip should preserve its last stable visibility state");
|
|
85
|
+
assert.equal(overflow.textContent, zeroWidthOverflowText, "a zero-width pass should not expose a stale overflow count");
|
|
86
|
+
|
|
87
|
+
console.log("intercom tag overflow layout tests passed");
|
|
@@ -52,9 +52,9 @@ assert.match(css, /@media \(prefers-reduced-motion: reduce\)[\s\S]*?animation-du
|
|
|
52
52
|
assert.match(css, /body\.terminal-tabs-left \.main-output-surface \{ grid-row: 4; \}/, "sidebar tab placement should keep the stable output surface in the transcript grid row");
|
|
53
53
|
assert.match(css, /body\.subagent-terminal-active \.main-output-surface,/, "the main output surface should stay hidden in the dedicated subagent view");
|
|
54
54
|
|
|
55
|
-
assert.match(html, /styles\.css\?v=
|
|
56
|
-
assert.match(html, /app\.js\?v=
|
|
57
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
55
|
+
assert.match(html, /styles\.css\?v=145/, "the stylesheet cache query should advance");
|
|
56
|
+
assert.match(html, /app\.js\?v=177/, "the app cache query should advance");
|
|
57
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v145"/, "the PWA cache identity should advance with browser assets");
|
|
58
58
|
assert.match(readme, /Loading agent output/, "user documentation should describe the visible loading feedback");
|
|
59
59
|
assert.match(development, /main output loading/i, "developer documentation should preserve the request-ownership contract");
|
|
60
60
|
|
|
@@ -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=145/, "changed drag-scroll styles should advance the stylesheet revision");
|
|
20
|
+
assert.match(html, /app\.js\?v=177/, "changed drag-scroll wiring should advance the app revision");
|
|
21
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v145";[\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");
|
|
@@ -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-v145"/, "continuity/tablet assets need a coherent cache identity");
|
|
51
|
+
assert.match(html, /styles\.css\?v=145/, "tablet CSS must have a coherent HTML revision");
|
|
52
|
+
assert.match(html, /app\.js\?v=177/, "continuity app logic must have a coherent HTML revision");
|
|
53
53
|
assert.match(technical, /tabletShell=v2[\s\S]*tabletShell=legacy/, "technical reference should document tablet preview and rollback");
|
|
54
54
|
|
|
55
55
|
console.log("mobile-continuity-tablet-static.test.mjs passed");
|
|
@@ -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-v145"/, "the cache identity must change with the startup graph");
|
|
41
|
+
assert.match(html, /styles\.css\?v=145/, "the stylesheet revision must change with mobile/tablet CSS fixes");
|
|
42
|
+
assert.match(html, /app\.js\?v=177/, "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");
|
|
@@ -60,6 +60,6 @@ assert.match(css, /data-mobile-presentation="essential"/, "Essential presentatio
|
|
|
60
60
|
assert.match(css, /html\[data-mobile-shell="v2"\] body\.mobile-keyboard-open \.widget-area,[\s\S]*?\.composer-actions-button \{ display: block !important; \}/, "v2 keyboard mode must keep run widgets and the actions entry available");
|
|
61
61
|
assert.match(css, /@media \(prefers-reduced-motion: reduce\)/, "reduced-motion behavior is required");
|
|
62
62
|
assert.match(css, /@media \(forced-colors: active\)/, "forced-color affordances are required");
|
|
63
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
63
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v145"/, "browser asset changes need a coherent cache tuple");
|
|
64
64
|
|
|
65
65
|
console.log("mobile-phone-experience-static.test.mjs passed");
|
|
@@ -679,7 +679,7 @@ assert.match(css, /body\.mobile-tabs-expanded \.terminal-tabs \{[\s\S]*?position
|
|
|
679
679
|
assert.match(css, /\.terminal-tab-activity-indicator/, "terminal tabs should expose per-tab agent activity indicators");
|
|
680
680
|
assert.match(css, /\.terminal-tab-app-runner-indicator \{[\s\S]*?terminal-tab-app-runner-pulse/, "terminal tabs should expose animated app-runner indicators");
|
|
681
681
|
assert.match(css, /\.terminal-tab\.app-runner-running,\n\.terminal-tab-group-item\.app-runner-running/, "terminal tabs and grouped items should mark running app runners");
|
|
682
|
-
assert.match(css, /\.terminal-tab-group-menu \{[^}]*max-height:\s*
|
|
682
|
+
assert.match(css, /\.terminal-tab-group-menu \{[^}]*max-height:\s*min\(32rem, calc\(var\(--visual-viewport-height, 100dvh\) - 6rem\)\);[^}]*overflow-x:\s*hidden;[^}]*overflow-y:\s*auto;[^}]*overscroll-behavior:\s*contain;[^}]*scrollbar-gutter:\s*stable;/, "large grouped terminal tab menus should stay inside the viewport and scroll without dropping entries");
|
|
683
683
|
assert.match(css, /\.terminal-tab-group-item \{[\s\S]*?flex:\s*0 0 auto[\s\S]*?background:\s*var\(--ctp-crust\)/, "grouped terminal tab items should keep readable height and use opaque backgrounds");
|
|
684
684
|
assert.match(css, /\.terminal-tab-group-add \{[\s\S]*?flex:\s*0 0 auto/, "grouped terminal tab menus should keep the add-tab action at its natural height");
|
|
685
685
|
assert.match(css, /\.terminal-tab-group\.active \{[\s\S]*?background:[\s\S]*?var\(--ctp-crust\)/, "active terminal tab groups should keep opaque backgrounds");
|
|
@@ -1824,7 +1824,7 @@ assert.ok(pkg.scripts.check.includes("node --check public/voice-conversation.mjs
|
|
|
1824
1824
|
assert.match(app, /id: "bangCommandAutocomplete"[\s\S]*packageName: "@firstpick\/pi-extension-bang-command-autocomplete"[\s\S]*capabilityLabel: "\/bang-status or \/bang-refresh"/, "optional features should list bang-command autocomplete by loaded command capability");
|
|
1825
1825
|
assert.match(app, /id: "fishUserBash"[\s\S]*packageName: "@firstpick\/pi-extension-fish-user-bash"[\s\S]*capabilityLabel: "\/user-bash-shell"/, "optional features should list fish user-bash by loaded command capability");
|
|
1826
1826
|
assert.match(app, /OPTIONAL_COMMAND_FEATURES = new Map\(\[[\s\S]*\["bang-refresh", "bangCommandAutocomplete"\][\s\S]*\["bang-status", "bangCommandAutocomplete"\][\s\S]*\["user-bash-shell", "fishUserBash"\]/, "optional command mapping should gate bang and fish companion commands");
|
|
1827
|
-
assert.match(app, /function updateOptionalFeatureAvailability\(\)[\s\S]*hasAvailableCommand\("bang-status"\) \|\| hasAvailableCommand\("bang-refresh"\)[\s\S]*hasAvailableCommand\("user-bash-shell"\)[\s\S]*
|
|
1827
|
+
assert.match(app, /function updateOptionalFeatureAvailability\(\)[\s\S]*hasAvailableCommand\("bang-status"\) \|\| hasAvailableCommand\("bang-refresh"\)[\s\S]*hasAvailableCommand\("user-bash-shell"\)[\s\S]*hasLoadedGuidedGitNativeCommand\("git-staged-msg", activeTabId\)[\s\S]*hasAvailableCommand\("release-npm"\)[\s\S]*hasAvailableCommand\("release-aur"\)[\s\S]*hasAvailableCommand\("safety-guard"\)[\s\S]*hasLoadedRpcCommand\("skills"\)[\s\S]*hasAvailableCommand\("todo-progress-status"\)[\s\S]*hasLoadedRpcCommand\("tools"\)[\s\S]*hasAvailableCommand\("remote"\)[\s\S]*NATURAL_CONVERSATION_COMMAND_NAMES\.some\(\(name\) => hasAvailableCommand\(name\)\)/, "optional feature detection should require Guided Git extension provenance while distinguishing native resource selectors from TUI companions");
|
|
1828
1828
|
assert.match(app, /hasRemoteWebuiCommand = isOptionalFeatureEnabled\("remoteWebui"\) && hasAvailableCommand\("remote"\)[\s\S]*optionsRemoteButton\.hidden = !hasRemoteWebuiCommand[\s\S]*syncRemoteWebuiControlVisibility\(hasRemoteWebuiCommand\)/, "Options menu should track /remote availability and delegate network card visibility");
|
|
1829
1829
|
assert.match(app, /function syncRemoteWebuiControlVisibility[\s\S]*networkControlField\.hidden = !hasRemoteWebuiCommand/, "Remote WebUI network card should render whenever the optional feature and /remote command are enabled");
|
|
1830
1830
|
assert.match(app, /querySelector\("#remoteAccessControlsTitle"\)[\s\S]*heading\.textContent = payload\?\.title \|\| "Remote access"/, "Remote WebUI payload titles should update the group heading without replacing the nested PIN-auth label");
|
|
@@ -1838,7 +1838,7 @@ assert.match(app, /if \(!isOptionalFeatureDetected\("todoProgressWidget"\)\) ret
|
|
|
1838
1838
|
assert.match(app, /const releasePrompt = detectedReleasePrompt && isOptionalFeatureEnabled\(detectedReleasePrompt\.featureId\) \? detectedReleasePrompt : null/, "release confirmation dialogs should use specialized rendering only when their release optional feature is enabled");
|
|
1839
1839
|
assert.match(app, /case "webui_tab_reloaded":[\s\S]*resetOptionalFeatureAvailability\(\)/, "optional feature state should reset when the RPC tab reloads resources");
|
|
1840
1840
|
assert.match(app, /function runPublishWorkflow\(command\)[\s\S]*resolveAvailableCommandName\(commandName, \{ rpcOnly: true \}\)/, "publish workflow launch should guard on loaded slash commands, including duplicate-suffixed RPC command names");
|
|
1841
|
-
assert.match(app, /function
|
|
1841
|
+
assert.match(app, /function guidedGitNativeCommandsAvailable\(tabId\)[\s\S]*\["git-staged-msg", "git-branch-name", "pr"\]\.every[\s\S]*hasLoadedGuidedGitNativeCommand/, "guided Git must require all native extension commands in the originating tab");
|
|
1842
1842
|
assert.match(app, /function launchGuidedGitWorkflow\(tabId = activeTabId\)[\s\S]*resolveAvailableCommandName\("git-guided-workflow", \{ tabId, rpcOnly: true \}\)/, "guided Git visible entry points should prefer the tab-local extension command");
|
|
1843
1843
|
assert.doesNotMatch(html, /gitWorkflowProcessSelect/, "guided git workflow should not expose process selection as a dropdown");
|
|
1844
1844
|
assert.match(app, /const GIT_WORKFLOW_PROCESSES = \[[\s\S]*value: "stage", label: "Stage"[\s\S]*value: "message", label: "Message"[\s\S]*value: "commit", label: "Commit"[\s\S]*value: "push", label: "Push"/, "guided git workflow should define Stage/Message/Commit/Push process buttons");
|
|
@@ -1869,7 +1869,7 @@ assert.match(app, /const donePatch = variant === "input"[\s\S]*message: true, co
|
|
|
1869
1869
|
assert.match(server, /\["short", "long", "input"\][\s\S]*cleanGitCommitMessageInput\(body\.message\)[\s\S]*git commit -m <input message>/, "server should accept typed git workflow commit messages");
|
|
1870
1870
|
assert.match(css, /\.git-workflow-message-input-row \{[\s\S]*flex:\s*1 1 100%/, "manual git workflow commit input should span the Message stage actions row");
|
|
1871
1871
|
assert.match(css, /\.git-workflow-actions button\[data-tooltip\]::after \{[\s\S]*content:\s*attr\(data-tooltip\)[\s\S]*white-space:\s*pre-line/, "guided git workflow action tooltips should render multiline step lists");
|
|
1872
|
-
assert.match(app, /function gitBranchNamePromptMessage\(\)[\s\S]*
|
|
1872
|
+
assert.match(app, /function gitBranchNamePromptMessage\(tabId = gitWorkflowActionTabId\(\)\)[\s\S]*hasLoadedGuidedGitNativeCommand\("git-branch-name", tabId\)[\s\S]*"\/git-branch-name"/, "guided git workflow should invoke native PR branch-name generation only when the extension command is available");
|
|
1873
1873
|
assert.match(app, /async function loadGitWorkflowBranchName\([\s\S]*generationId[\s\S]*gitWorkflowRequest\(`\/api\/git-workflow\/branch-name\$\{query\}`/, "guided git workflow should load exactly correlated generated branch names before branch creation");
|
|
1874
1874
|
assert.match(app, /async function createGitPrBranchWithSuggestion\([\s\S]*appPromptText\(\{ title: "New PR branch worktree"[\s\S]*chooseGitWorktreeBase\(branch\)[\s\S]*assertGuidedGitStagedContentBinding\(tabId, "PR worktree creation"\)[\s\S]*gitWorkflowRequest\("\/api\/git-workflow\/branch", \{ body: \{ branch, baseRef, sessionMode: "fork-current", openTab: true, [\s\S]*expectedStagedContentHash/, "guided git worktrees should ask for a base ref before verifying and carrying staged content");
|
|
1875
1875
|
assert.match(app, /function syncGitWorkflowWorktreeTabs\(result\)[\s\S]*Array\.isArray\(result\?\.tabs\)[\s\S]*applyTabMetadata\(result\.tab\)/, "guided git workflow should merge worktree tab metadata returned by the branch endpoint");
|
|
@@ -2213,6 +2213,7 @@ assert.match(app, /function openNativeSettingsDialog\(\)[\s\S]*?\/api\/steering-
|
|
|
2213
2213
|
assert.match(app, /function openNativeNameDialog\(\)[\s\S]*?sendPrompt\("prompt", `\/name \$\{name\}`\)/, "native /name selector should prompt before running the slash command");
|
|
2214
2214
|
assert.match(app, /function openNativeForkSelector\(\)[\s\S]*?\/api\/fork-messages[\s\S]*?\/api\/fork/, "native /fork selector should pair fork-point loading with the fork action");
|
|
2215
2215
|
assert.match(app, /function openNativeResumeSelector\(scope = "current", \{ query = "" \} = \{\}\)[\s\S]*?\/api\/sessions\?scope=\$\{encodeURIComponent\(selectedScope\)\}/, "native /resume selector should list current-cwd or all sessions");
|
|
2216
|
+
assert.match(app, /nativeCommandApi\("\/api\/switch-session"[\s\S]*?const resumedTab = syncResponseTabs\(result\)[\s\S]*?await switchTab\(resumedTab\.id\)/, "native /resume should select the new terminal returned by the server");
|
|
2216
2217
|
assert.match(app, /\/api\/session-rename/, "native /resume selector should rename session metadata");
|
|
2217
2218
|
assert.match(app, /\/api\/session-delete/, "native /resume selector should delete sessions with confirmation");
|
|
2218
2219
|
assert.match(app, /function openNativeTreeSelector\(\)[\s\S]*?\/api\/session-tree[\s\S]*?\/api\/tree-navigate/, "native /tree selector should list tree entries and navigate through the backend helper");
|
|
@@ -2402,7 +2403,10 @@ assert.match(server, /function trackPendingExtensionUiRequest\(tab, event\)/, "s
|
|
|
2402
2403
|
assert.match(server, /pendingExtensionUiRequests: new Map\(\)/, "new tabs should initialize pending extension UI request storage");
|
|
2403
2404
|
assert.match(server, /extensionStatuses: new Map\(\)/, "new tabs should initialize replayable extension status storage");
|
|
2404
2405
|
assert.match(server, /extensionWidgets: new Map\(\)/, "new tabs should initialize replayable extension widget storage");
|
|
2405
|
-
assert.match(server, /
|
|
2406
|
+
assert.match(server, /const REPLAYABLE_CLEARED_EXTENSION_STATUS_KEYS = new Set\(\["feature-decision-output", "feature-category"\]\)/, "server should retain cleared feature-routing status keys as late-client capability evidence");
|
|
2407
|
+
assert.match(server, /function rememberExtensionStatusEvent\(tab, event\)[\s\S]*event\.statusText\) statuses\.set\(statusKey, String\(event\.statusText\)\)[\s\S]*REPLAYABLE_CLEARED_EXTENSION_STATUS_KEYS\.has\(statusKey\)\) statuses\.set\(statusKey, undefined\)[\s\S]*else statuses\.delete\(statusKey\)[\s\S]*scheduleSupervisorMetadataUpdate\(tab\)/, "server should replay feature-routing clears, persist first detection, and delete unrelated cleared statuses");
|
|
2408
|
+
assert.match(server, /function supervisedTabMetadata\(tab,[\s\S]*featureSystemPromptDetected: featureSystemPromptDetected\(tab\)/, "supervisor metadata should persist feature-routing capability evidence across server restarts");
|
|
2409
|
+
assert.match(server, /function hydrateManagedTabs\(snapshot\)[\s\S]*restoreFeatureSystemPromptDetection\(tab, metadata\?\.featureSystemPromptDetected === true\)/, "supervised tab hydration should restore feature-routing capability evidence before SSE replay");
|
|
2406
2410
|
assert.match(server, /function rememberExtensionWidgetEvent\(tab, event\)[\s\S]*event\.method !== "setWidget"[\s\S]*widgets\.set\(String\(widgetKey\)/, "server should retain extension widget events for reconnects");
|
|
2407
2411
|
assert.match(server, /rememberExtensionStatusEvent\(tab, scopedEvent\)[\s\S]*rememberExtensionWidgetEvent\(tab, scopedEvent\)[\s\S]*trackPendingExtensionUiRequest\(tab, scopedEvent\)/, "RPC events should retain extension statuses and widgets before broadcasting");
|
|
2408
2412
|
assert.match(server, /trackPendingExtensionUiRequest\(tab, scopedEvent\)/, "RPC events should populate pending extension UI storage before broadcasting");
|
|
@@ -2498,7 +2502,8 @@ assert.match(server, /url\.pathname === "\/api\/scoped-models" && req\.method ==
|
|
|
2498
2502
|
assert.match(server, /url\.pathname === "\/api\/fork-messages" && req\.method === "GET"/, "server should expose fork-point data for the native /fork selector");
|
|
2499
2503
|
assert.match(server, /url\.pathname === "\/api\/sessions" && req\.method === "GET"/, "server should expose session lists for the native /resume selector");
|
|
2500
2504
|
assert.match(server, /url\.pathname === "\/api\/session-tree" && req\.method === "GET"/, "server should expose session-tree data for the native /tree selector");
|
|
2501
|
-
assert.match(server, /url\.pathname === "\/api\/switch-session" && req\.method === "POST"/, "server should expose session
|
|
2505
|
+
assert.match(server, /url\.pathname === "\/api\/switch-session" && req\.method === "POST"/, "server should expose session resume for the native /resume selector");
|
|
2506
|
+
assert.match(server, /async function resumeSessionInNewTab\([\s\S]*?createTab\(\{[\s\S]*?sessionFile: manager\.getSessionFile\(\)[\s\S]*?sourceTab: tabMeta\(sourceTab\)/, "session resume should create a separate terminal and preserve source-tab metadata");
|
|
2502
2507
|
assert.match(server, /url\.pathname === "\/api\/tree-navigate" && req\.method === "POST"/, "server should expose tree navigation through the Web UI helper command");
|
|
2503
2508
|
assert.match(server, /function configuredSessionDir\(\)/, "server should honor forwarded --session-dir for session selectors");
|
|
2504
2509
|
assert.match(server, /SessionManager\.listAll\(sessionDir\) : await SessionManager\.list\(tab\.cwd, sessionDir\)/, "server should support current-cwd and all-session resume scopes");
|
|
@@ -68,7 +68,7 @@ assert.match(server, /STATIC_PUBLIC_FILE_EXTENSIONS[\s\S]*"\.mjs"/, "the server
|
|
|
68
68
|
assert.match(serviceWorker, /"\/issue-wizard-state\.mjs"/, "the PWA shell must keep caching the pure wizard module");
|
|
69
69
|
assert.match(serviceWorker, /"\/issue-bot-client\.mjs"/, "the PWA shell must cache the browser client module");
|
|
70
70
|
// Intent preserved: changing the public startup graph advances the PWA cache identity.
|
|
71
|
-
assert.match(serviceWorker, /pi-webui-pwa-
|
|
71
|
+
assert.match(serviceWorker, /pi-webui-pwa-v145/, "the PWA cache name must change with browser wiring updates");
|
|
72
72
|
assert.match(packageJson, /node --check public\/issue-wizard-state\.mjs/, "the package check must keep syntax-checking the pure wizard module");
|
|
73
73
|
assert.match(packageJson, /node --check public\/issue-bot-client\.mjs/, "the package check must syntax-check the browser client module");
|
|
74
74
|
|
|
@@ -271,8 +271,8 @@ assert.match(
|
|
|
271
271
|
|
|
272
272
|
// --- Coherent browser asset revisions --------------------------------------
|
|
273
273
|
|
|
274
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
275
|
-
assert.match(html, /styles\.css\?v=
|
|
276
|
-
assert.match(html, /data-app-src="\/app\.js\?v=
|
|
274
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v145"/, "changed browser assets should advance the PWA cache identity");
|
|
275
|
+
assert.match(html, /styles\.css\?v=145/, "the page should request the updated layout stylesheet revision");
|
|
276
|
+
assert.match(html, /data-app-src="\/app\.js\?v=177"/, "the boot loader should request the updated app module revision");
|
|
277
277
|
|
|
278
278
|
console.log("persistent-ui-layout-static.test.mjs passed");
|
|
@@ -19,8 +19,8 @@ const resizePromptInput = app.slice(resizeStart, resizeEnd);
|
|
|
19
19
|
assert.match(css, /#promptInput \{[\s\S]*--prompt-input-block-chrome: calc\(1\.8rem \+ 2px\);[\s\S]*max-height: calc\(6lh \+ var\(--prompt-input-block-chrome\)\);[\s\S]*overflow-y: auto;[\s\S]*overscroll-behavior-y: contain;/, "the prompt should show six complete lines before native vertical scrolling begins");
|
|
20
20
|
assert.match(resizePromptInput, /input\.style\.height = "auto";[\s\S]*borderTopWidth[\s\S]*borderBottomWidth[\s\S]*naturalHeight = input\.scrollHeight \+ borderBlock[\s\S]*isCapped \? "auto" : "hidden"/, "auto-resizing should include the textarea borders and enable vertical scrolling only after the six-line cap");
|
|
21
21
|
assert.doesNotMatch(resizePromptInput, /input\.style\.overflowY = "auto";/, "auto-resizing must not force a scrollbar below the six-line cap");
|
|
22
|
-
assert.match(html, /styles\.css\?v=
|
|
23
|
-
assert.match(html, /app\.js\?v=
|
|
24
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
22
|
+
assert.match(html, /styles\.css\?v=145/, "the page should request the six-line prompt stylesheet revision");
|
|
23
|
+
assert.match(html, /app\.js\?v=177/, "the page should request the current app revision");
|
|
24
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v145"/, "the PWA cache identity should advance with the prompt scroll assets");
|
|
25
25
|
|
|
26
26
|
console.log("prompt-input-vertical-scroll-static.test.mjs passed");
|
|
@@ -504,8 +504,8 @@ assert.match(css, /@media \(max-width: 720px\), \(max-device-width: 720px\), \(p
|
|
|
504
504
|
assert.match(css, /\.questionnaire-options button\s*\{\s*min-height:\s*3\.35rem/, "mobile questionnaire targets must exceed the 44px floor");
|
|
505
505
|
assert.match(css, /@media \(prefers-reduced-motion: reduce\)\s*\{[\s\S]*?\*, \*::before, \*::after[\s\S]*?transition-duration:\s*1ms !important/, "global reduced-motion rules must cover questionnaire transitions");
|
|
506
506
|
|
|
507
|
-
assert.match(html, /styles\.css\?v=
|
|
508
|
-
assert.match(html, /app\.js\?v=
|
|
509
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
507
|
+
assert.match(html, /styles\.css\?v=145/, "questionnaire CSS needs the current stylesheet revision");
|
|
508
|
+
assert.match(html, /app\.js\?v=177/, "questionnaire behavior needs the current app revision");
|
|
509
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v145"/, "questionnaire public assets need a coherent PWA cache revision");
|
|
510
510
|
|
|
511
511
|
console.log("questionnaire-dialog.test.mjs passed");
|
|
@@ -14,6 +14,7 @@ const port = 30000 + Math.floor(Math.random() * 20000);
|
|
|
14
14
|
const cwd = await mkdtemp(path.join(tmpdir(), "pi-webui-remote-auth-settings-"));
|
|
15
15
|
const settingsFile = path.join(cwd, "webui-settings.json");
|
|
16
16
|
const safetyGuardSettingsFile = path.join(cwd, "safety-guard.json");
|
|
17
|
+
const rpcLogFile = path.join(cwd, "rpc-commands.jsonl");
|
|
17
18
|
|
|
18
19
|
async function request(pathname, { method = "GET", body, timeoutMs = 5_000 } = {}) {
|
|
19
20
|
const response = await fetch(`http://127.0.0.1:${port}${pathname}`, {
|
|
@@ -35,6 +36,7 @@ const child = spawn(process.execPath, [serverScript, "--cwd", cwd, "--host", "12
|
|
|
35
36
|
...process.env,
|
|
36
37
|
PI_WEBUI_SETTINGS_FILE: settingsFile,
|
|
37
38
|
PI_SAFETY_GUARD_CONFIG_FILE: safetyGuardSettingsFile,
|
|
39
|
+
FAKE_PI_LOG_FILE: rpcLogFile,
|
|
38
40
|
},
|
|
39
41
|
});
|
|
40
42
|
let serverOutput = "";
|
|
@@ -140,6 +142,20 @@ try {
|
|
|
140
142
|
}, "existing settings should expose fallback as disabled until explicitly selected");
|
|
141
143
|
assert.equal(initialGitSetup.body?.data?.models?.[0]?.id, "fake-model");
|
|
142
144
|
|
|
145
|
+
const modelRpcCount = async () => (await readFile(rpcLogFile, "utf8"))
|
|
146
|
+
.trim()
|
|
147
|
+
.split("\n")
|
|
148
|
+
.filter(Boolean)
|
|
149
|
+
.map((line) => JSON.parse(line))
|
|
150
|
+
.filter((entry) => entry.direction === "command" && entry.type === "get_available_models")
|
|
151
|
+
.length;
|
|
152
|
+
const modelRpcCountBeforeLightweightRead = await modelRpcCount();
|
|
153
|
+
const lightweightGitSetup = await request("/api/git-workflow/preferences?includeModels=false");
|
|
154
|
+
assert.equal(lightweightGitSetup.status, 200);
|
|
155
|
+
assert.equal(lightweightGitSetup.body?.data?.configured, false);
|
|
156
|
+
assert.equal(lightweightGitSetup.body?.data?.models, undefined, "startup-only reads should not return the setup model catalog");
|
|
157
|
+
assert.equal(await modelRpcCount(), modelRpcCountBeforeLightweightRead, "startup-only reads must not issue get_available_models on Pi's control channel");
|
|
158
|
+
|
|
143
159
|
const unsupportedEffort = await request("/api/git-workflow/preferences", {
|
|
144
160
|
method: "POST",
|
|
145
161
|
body: { preferences: { generation: { provider: "fake", modelId: "fake-model", thinkingLevel: "low" } } },
|
|
@@ -195,9 +211,8 @@ try {
|
|
|
195
211
|
assert.equal(savedGitSetup.body?.data?.preferences?.reviewProcessEnabled, false);
|
|
196
212
|
|
|
197
213
|
const generation = await request("/api/git-workflow/generate", { method: "POST", body: { kind: "commit" } });
|
|
198
|
-
assert.equal(generation.status,
|
|
199
|
-
assert.
|
|
200
|
-
assert.deepEqual(generation.body?.data?.generation, { provider: "fake", modelId: "fake-model", thinkingLevel: "off" });
|
|
214
|
+
assert.equal(generation.status, 409);
|
|
215
|
+
assert.match(generation.body?.error || "", /git-staged-msg extension command.*Same-named prompt templates are not used/iu);
|
|
201
216
|
|
|
202
217
|
const disableAuth = await request("/api/remote-auth/settings", { method: "POST", body: { enabled: false } });
|
|
203
218
|
assert.equal(disableAuth.status, 200);
|
|
@@ -15,7 +15,8 @@ assert.match(source, /pi\.on\("model_select"/);
|
|
|
15
15
|
assert.match(source, /await recompute\(ctx, event\.model\)/, "model selection should immediately recompute exact-model resources");
|
|
16
16
|
assert.match(source, /"Session only", "Global default", "Model default"/);
|
|
17
17
|
assert.match(source, /"Use inherited defaults"/);
|
|
18
|
-
assert.match(source, /ctx
|
|
18
|
+
assert.match(source, /selectTuiModelProfile\(ctx, \{/, "exact-model profiles should use the shared searchable model picker");
|
|
19
|
+
assert.match(source, /selectTuiResources\(ctx, \{/, "resource lists should use the shared keyboard-driven selector");
|
|
19
20
|
assert.match(source, /preserveUnavailableResourceNames\(/);
|
|
20
21
|
assert.match(source, /setExactModelProfile\(/);
|
|
21
22
|
assert.match(source, /skill\.disableModelInvocation !== true/);
|
|
@@ -57,10 +57,10 @@ assert.match(css, /\.sampling-parameter-control\.unsupported:hover:not\(\.sampli
|
|
|
57
57
|
assert.match(css, /\.sampling-parameter-control\.unsupported:focus-visible:not\(\.sampling-tooltip-dismissed\) > \.sampling-parameter-unsupported-tooltip/, "keyboard focus should reveal dismissible unsupported reasons");
|
|
58
58
|
assert.match(css, /\.sampling-parameter-unsupported-tooltip\.sampling-tooltip-below/, "bounded placement should support flipping below top-edge rows");
|
|
59
59
|
assert.match(css, /pointer-events: auto;/, "a visible unsupported tooltip should remain pointer-hoverable");
|
|
60
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
60
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v145"/, "native-control assets should advance the cache identity");
|
|
61
61
|
assert.match(serviceWorker, /"\/sampling-parameter-controls\.mjs"/, "the pure sampling module should be part of the offline app shell");
|
|
62
|
-
assert.match(html, /styles\.css\?v=
|
|
63
|
-
assert.match(html, /app\.js\?v=
|
|
62
|
+
assert.match(html, /styles\.css\?v=145/, "the changed stylesheet should have a new revision");
|
|
63
|
+
assert.match(html, /app\.js\?v=177/, "the changed app module should have a new revision");
|
|
64
64
|
|
|
65
65
|
// --- Browser state behavior -------------------------------------------------
|
|
66
66
|
|