@firstpick/pi-package-webui 0.9.9 → 0.10.1
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 +49 -15
- package/README.md +11 -9
- package/TECHNICAL.md +12 -8
- package/bin/pi-webui.mjs +202 -67
- 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 +365 -106
- package/public/index.html +10 -7
- package/public/service-worker.js +1 -1
- package/public/styles.css +114 -22
- package/tests/boot-failure-diagnostics.test.mjs +3 -3
- package/tests/browser/interaction-continuity.spec.mjs +9 -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/guided-git-publication-backend-static.test.mjs +10 -5
- package/tests/http-endpoints-harness.test.mjs +27 -13
- 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 +18 -12
- 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 +19 -11
- package/tests/open-issue-wizard-static.test.mjs +1 -1
- package/tests/optional-feature-prompt-impact-static.test.mjs +67 -0
- 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/streaming-ui-coupling.test.mjs +2 -0
- 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=182"/, "the changed browser app should use the next query revision");
|
|
58
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v153";/, "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
|
});
|
|
@@ -20,13 +20,18 @@ assert.match(
|
|
|
20
20
|
);
|
|
21
21
|
assert.match(
|
|
22
22
|
server,
|
|
23
|
-
/case "\/api\/git-workflow\/publish": \{[\s\S]*cleanGitHubRepoName\(
|
|
24
|
-
"the server must validate name
|
|
23
|
+
/case "\/api\/git-workflow\/publish": \{[\s\S]*const root = await getGitRoot\(cwd\);[\s\S]*cleanGitHubRepoName\(path\.basename\(root\)\)[\s\S]*visibility !== "public" && visibility !== "private"[\s\S]*requireConfirmed\(body,[\s\S]*gitRemoteNames\(root\)[\s\S]*remotes\.length[\s\S]*currentGitBranch\(root\)/,
|
|
24
|
+
"the server must derive and validate the Git root directory name, validate visibility/confirmation, and refuse existing-remote repair before publication",
|
|
25
|
+
);
|
|
26
|
+
assert.doesNotMatch(
|
|
27
|
+
server,
|
|
28
|
+
/case "\/api\/git-workflow\/publish": \{[\s\S]*?cleanGitHubRepoName\(body\.repoName\)[\s\S]*?case "\/api\/git-workflow\/create-pr"/,
|
|
29
|
+
"publication must not trust a client-selected repository name",
|
|
25
30
|
);
|
|
26
31
|
assert.match(
|
|
27
32
|
server,
|
|
28
|
-
/runGitHubWorkflowCommand\(\s*\["repo", "create", repoName, `--\$\{visibility\}`, "--source",
|
|
29
|
-
"publication must run the
|
|
33
|
+
/runGitHubWorkflowCommand\(\s*\["repo", "create", repoName, `--\$\{visibility\}`, "--source", "\.", "--remote", "origin", "--push"\],[\s\S]*\{ cwd: root, timeoutMs: 15 \* 60 \* 1000/,
|
|
34
|
+
"publication must run gh repo create from the Git root so system GitHub CLI configuration adds origin and pushes",
|
|
30
35
|
);
|
|
31
36
|
assert.match(
|
|
32
37
|
server,
|
|
@@ -34,7 +39,7 @@ assert.match(
|
|
|
34
39
|
"successful publication must extend the process envelope with the approved metadata",
|
|
35
40
|
);
|
|
36
41
|
assert.match(server, /payload\.code = "AUTH";[\s\S]*gh auth login/, "gh authentication failures should receive an actionable AUTH hint");
|
|
37
|
-
assert.match(server, /name already exists on this account\|repository \.\+ already exists[\s\S]*
|
|
42
|
+
assert.match(server, /name already exists on this account\|repository \.\+ already exists[\s\S]*rename the local directory before retrying/, "name conflicts should explain how the directory-derived name can be changed");
|
|
38
43
|
assert.match(server, /GH_PROMPT_DISABLED: process\.env\.GH_PROMPT_DISABLED \|\| "1"/, "gh publication must inherit disabled interactive prompts");
|
|
39
44
|
|
|
40
45
|
console.log("guided git publication backend static tests passed");
|
|
@@ -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) {
|
|
@@ -1977,28 +1995,24 @@ try {
|
|
|
1977
1995
|
assert.equal(pushWithoutRemote.body?.code, "NO_REMOTE", "remote-less push should have a stable recovery code");
|
|
1978
1996
|
assert.match(String(pushWithoutRemote.body?.hint || ""), /publish this repository|add a Git remote/i);
|
|
1979
1997
|
assert.match(String(pushWithoutRemote.body?.data?.stderr || ""), /No configured push destination/i, "classified failures should preserve process output");
|
|
1998
|
+
assert.equal(pushWithoutRemote.body?.data?.repoName, path.basename(cwd), "remote-less push should report the local Git root directory name for publication");
|
|
1980
1999
|
|
|
1981
2000
|
const unconfirmedPublish = await request("127.0.0.1", "/api/git-workflow/publish", {
|
|
1982
2001
|
method: "POST",
|
|
1983
|
-
body: { tab: tabId, repoName: "
|
|
2002
|
+
body: { tab: tabId, repoName: "client-selected-name", visibility: "private" },
|
|
1984
2003
|
});
|
|
1985
2004
|
assert.equal(unconfirmedPublish.status, 200);
|
|
1986
2005
|
assert.equal(unconfirmedPublish.body?.ok, false, "publication should require exact server-side confirmation");
|
|
1987
2006
|
assert.match(String(unconfirmedPublish.body?.error || ""), /confirmed: true/);
|
|
2007
|
+
assert.match(String(unconfirmedPublish.body?.error || ""), new RegExp(`GitHub repository ${path.basename(cwd)} as private`), "publication confirmation should use the server-derived Git root directory name");
|
|
2008
|
+
assert.doesNotMatch(String(unconfirmedPublish.body?.error || ""), /client-selected-name/, "publication should ignore client-supplied repository names");
|
|
1988
2009
|
|
|
1989
2010
|
const invalidVisibilityPublish = await request("127.0.0.1", "/api/git-workflow/publish", {
|
|
1990
2011
|
method: "POST",
|
|
1991
|
-
body: { tab: tabId,
|
|
2012
|
+
body: { tab: tabId, visibility: "internal", confirmed: true },
|
|
1992
2013
|
});
|
|
1993
2014
|
assert.equal(invalidVisibilityPublish.body?.ok, false, "publication should reject visibility outside public/private");
|
|
1994
2015
|
assert.match(String(invalidVisibilityPublish.body?.error || ""), /visibility must be 'public' or 'private'/);
|
|
1995
|
-
|
|
1996
|
-
const invalidNamePublish = await request("127.0.0.1", "/api/git-workflow/publish", {
|
|
1997
|
-
method: "POST",
|
|
1998
|
-
body: { tab: tabId, repoName: "invalid repository name", visibility: "public", confirmed: true },
|
|
1999
|
-
});
|
|
2000
|
-
assert.equal(invalidNamePublish.body?.ok, false, "publication should reuse GitHub repository-name validation");
|
|
2001
|
-
assert.match(String(invalidNamePublish.body?.error || ""), /Invalid GitHub repository name/);
|
|
2002
2016
|
assert.equal(runGitFixture(["remote"], cwd, "guarded publication requests must not configure a remote"), "");
|
|
2003
2017
|
|
|
2004
2018
|
const initialWorktrees = await request("127.0.0.1", `/api/git-worktrees?tab=${encodeURIComponent(tabId)}`);
|
|
@@ -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=152/, "the stylesheet URL should advance for the bounded conversation tags");
|
|
100
|
+
assert.match(html, /data-app-src="\/app\.js\?v=182"/, "the guarded app URL should advance for current browser wiring");
|
|
101
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v153"/, "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");
|
|
@@ -22,40 +22,46 @@ function sourceBetween(startMarker, endMarker, label) {
|
|
|
22
22
|
|
|
23
23
|
assert.match(
|
|
24
24
|
html,
|
|
25
|
-
/class="
|
|
26
|
-
"the
|
|
25
|
+
/id="feedbackTray"[\s\S]*?<div class="footer-status-host">[\s\S]*?<div id="mainOutputLoading" class="main-output-loading" role="status" aria-live="polite" aria-atomic="true" aria-controls="chat" hidden>[\s\S]*?main-output-loading-spinner[\s\S]*?id="mainOutputLoadingLabel">Loading conversation history…<\/span>[\s\S]*?<div id="statusBar" class="statusbar"/,
|
|
26
|
+
"the accessible loading status and Git footer should share an overlay host",
|
|
27
27
|
);
|
|
28
28
|
assert.doesNotMatch(html, /<dialog[^>]+id="mainOutputLoading"/, "loading feedback must not use a popup dialog");
|
|
29
|
-
assert.match(app, /mainOutputLoading: \$\("#mainOutputLoading"\)/, "the browser should bind the inline status
|
|
29
|
+
assert.match(app, /mainOutputLoading: \$\("#mainOutputLoading"\)[\s\S]*mainOutputLoadingLabel: \$\("#mainOutputLoadingLabel"\)/, "the browser should bind the inline status and its detail label");
|
|
30
30
|
assert.match(app, /const mainOutputLoadingRequests = new Set\(\);[\s\S]*MAIN_OUTPUT_LOADING_REVEAL_DELAY_MS = 120/, "loading requests should have bounded concurrent ownership and a short anti-flicker delay");
|
|
31
31
|
|
|
32
32
|
const loadingHelpers = sourceBetween("function mainOutputLoadingRequestIsCurrent(", "\nasync function refreshMessages(", "main output loading helpers");
|
|
33
33
|
assert.match(loadingHelpers, /isCurrentTabContext\(request\.tabContext\)/, "only the active tab generation should control visible loading feedback");
|
|
34
|
+
assert.match(loadingHelpers, /filter\(mainOutputLoadingRequestIsCurrent\)\.at\(-1\)/, "the newest active request should supply the displayed operation");
|
|
34
35
|
assert.match(loadingHelpers, /setAttribute\("aria-busy", active \? "true" : "false"\)/, "the transcript should expose request state immediately to assistive technology");
|
|
36
|
+
assert.match(loadingHelpers, /mainOutputLoadingLabel\.textContent = request\?\.label/, "the live status should name the current operation");
|
|
35
37
|
assert.match(loadingHelpers, /setTimeout\([\s\S]*MAIN_OUTPUT_LOADING_REVEAL_DELAY_MS/, "visible animation should be delayed to avoid flashing on fast requests");
|
|
36
38
|
assert.match(loadingHelpers, /mainOutputLoadingRequests\.add\(request\)/, "overlapping requests should receive independent tokens");
|
|
39
|
+
assert.match(loadingHelpers, /function updateMainOutputLoading\([\s\S]*request\.label = label/, "an active request should be able to report its next stage");
|
|
37
40
|
assert.match(loadingHelpers, /mainOutputLoadingRequests\.delete\(request\)/, "settled requests should release only their own token");
|
|
38
41
|
assert.doesNotMatch(loadingHelpers, /showModal|alert\(|confirm\(/, "main output loading must remain non-modal");
|
|
39
42
|
|
|
40
43
|
const refreshMessages = sourceBetween("async function refreshMessages(", "\nasync function refreshModels(", "refreshMessages");
|
|
41
|
-
assert.match(refreshMessages, /
|
|
44
|
+
assert.match(refreshMessages, /beginMainOutputLoading\(tabContext, loadDelta \? "Checking for new messages…" : "Loading conversation history…"\)/, "message fetches should distinguish delta checks from complete transcript loads");
|
|
45
|
+
assert.match(refreshMessages, /updateMainOutputLoading\(loadingRequest, "Loading conversation history…"\)[\s\S]*api\("\/api\/messages"/, "delta fallback should report that it is loading the complete transcript");
|
|
46
|
+
assert.match(refreshMessages, /updateMainOutputLoading\(loadingRequest, "Preparing your conversation…"\)[\s\S]*renderMessages\(latestMessages\)/, "the status should report transcript rendering after data arrives");
|
|
42
47
|
assert.match(refreshMessages, /finally \{\s*finishMainOutputLoading\(loadingRequest\);\s*\}/, "success, failure, and stale responses should all clear their request token");
|
|
43
48
|
assert.match(app, /activeTabId = nextTabId;\s*renderMainOutputLoading\(\);/, "tab changes should immediately reconcile stale and current request visibility");
|
|
44
49
|
|
|
45
50
|
assert.match(css, /\.main-output-loading\[hidden\] \{ display: none !important; \}/, "hidden loading feedback should not render");
|
|
46
|
-
assert.match(css, /\.main-output-surface \{[\s\S]*?position: relative;[\s\S]*?flex: 1 1 auto;[\s\S]*?min-height: 0;/, "the transcript
|
|
47
|
-
assert.match(css, /\.
|
|
51
|
+
assert.match(css, /\.main-output-surface \{[\s\S]*?position: relative;[\s\S]*?flex: 1 1 auto;[\s\S]*?min-height: 0;/, "the transcript should retain its flexible layout surface");
|
|
52
|
+
assert.match(css, /\.footer-status-host \{[\s\S]*?position: relative;[\s\S]*?flex: 0 0 auto;[\s\S]*?min-width: 0;/, "the Git footer should provide a stable positioning host");
|
|
53
|
+
assert.match(css, /\.main-output-loading \{[\s\S]*?position: absolute;[\s\S]*?left: 50%;[\s\S]*?bottom: calc\(100% \+ 0\.3rem\);[\s\S]*?transform: translateX\(-50%\);[\s\S]*?pointer-events: none;/, "the loading status should overlay above the footer without entering layout flow");
|
|
48
54
|
assert.match(css, /\.main-output-loading \{[\s\S]*?font-size: var\(--text-xs\)/, "the loading status should remain compact");
|
|
49
55
|
assert.match(css, /\.main-output-loading-spinner \{[\s\S]*?animation: main-output-loading-spin 780ms linear infinite/, "the status should include a visible spinner animation");
|
|
50
56
|
assert.match(css, /@keyframes main-output-loading-spin/, "the spinner should have a local animation contract");
|
|
51
57
|
assert.match(css, /@media \(prefers-reduced-motion: reduce\)[\s\S]*?animation-duration: 1ms !important;[\s\S]*?animation-iteration-count: 1 !important;/, "the existing reduced-motion policy should stop repeated spinner motion");
|
|
52
|
-
assert.match(css, /body\.terminal-tabs-left \.main-output-surface \{ grid-row: 4; \}/, "sidebar tab placement should keep the
|
|
53
|
-
assert.match(css, /body\.subagent-terminal-active \.main-output-surface,/, "
|
|
58
|
+
assert.match(css, /body\.terminal-tabs-left \.main-output-surface \{ grid-row: 4; \}[\s\S]*body\.terminal-tabs-left \.footer-status-host \{ grid-row: 7; \}[\s\S]*body\.terminal-tabs-left \.context-meter-bar \{ grid-row: 8; \}/, "sidebar tab placement should keep the loading overlay anchored to the footer host");
|
|
59
|
+
assert.match(css, /body\.subagent-terminal-active \.main-output-surface,[\s\S]*body\.subagent-terminal-active \.main-output-loading,/, "dedicated subagent output should hide the main transcript and its loading status");
|
|
54
60
|
|
|
55
|
-
assert.match(html, /styles\.css\?v=
|
|
56
|
-
assert.match(html, /app\.js\?v=
|
|
57
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
58
|
-
assert.match(readme, /Loading
|
|
61
|
+
assert.match(html, /styles\.css\?v=152/, "the stylesheet cache query should advance");
|
|
62
|
+
assert.match(html, /app\.js\?v=182/, "the app cache query should advance");
|
|
63
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v153"/, "the PWA cache identity should advance with browser assets");
|
|
64
|
+
assert.match(readme, /Loading conversation history/, "user documentation should describe the plain-language loading feedback");
|
|
59
65
|
assert.match(development, /main output loading/i, "developer documentation should preserve the request-ownership contract");
|
|
60
66
|
|
|
61
67
|
console.log("main output loading static tests passed");
|
|
@@ -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=152/, "changed drag-scroll styles should advance the stylesheet revision");
|
|
20
|
+
assert.match(html, /app\.js\?v=182/, "changed drag-scroll wiring should advance the app revision");
|
|
21
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v153";[\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-v153"/, "continuity/tablet assets need a coherent cache identity");
|
|
51
|
+
assert.match(html, /styles\.css\?v=152/, "tablet CSS must have a coherent HTML revision");
|
|
52
|
+
assert.match(html, /app\.js\?v=182/, "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-v153"/, "the cache identity must change with the startup graph");
|
|
41
|
+
assert.match(html, /styles\.css\?v=152/, "the stylesheet revision must change with mobile/tablet CSS fixes");
|
|
42
|
+
assert.match(html, /app\.js\?v=182/, "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-v153"/, "browser asset changes need a coherent cache tuple");
|
|
64
64
|
|
|
65
65
|
console.log("mobile-phone-experience-static.test.mjs passed");
|