@firstpick/pi-package-webui 0.8.8 → 0.9.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.
Files changed (44) hide show
  1. package/README.md +12 -0
  2. package/bin/pi-webui-rpc-supervisor.mjs +4 -1
  3. package/bin/pi-webui.mjs +15 -3
  4. package/lib/rpc-supervisor-protocol.mjs +6 -1
  5. package/package.json +1 -1
  6. package/public/app.js +659 -150
  7. package/public/index.html +28 -13
  8. package/public/service-worker.js +1 -1
  9. package/public/styles.css +789 -23
  10. package/tests/boot-failure-diagnostics.test.mjs +3 -3
  11. package/tests/browser/interaction-continuity.spec.mjs +120 -0
  12. package/tests/browser/mobile-foundation.spec.mjs +363 -5
  13. package/tests/browser/optimistic-prompt.spec.mjs +24 -10
  14. package/tests/browser/persistent-ui-layout.spec.mjs +2 -0
  15. package/tests/browser/search-match-highlighting.spec.mjs +104 -0
  16. package/tests/browser/side-panel-section-reorder.spec.mjs +16 -1
  17. package/tests/codex-fast-mode-static.test.mjs +2 -2
  18. package/tests/composer-action-grid-reorder-static.test.mjs +3 -3
  19. package/tests/fast-mode-client-static.test.mjs +1 -1
  20. package/tests/feature-decision-output-popup-static.test.mjs +2 -2
  21. package/tests/file-tree-search-layout-static.test.mjs +261 -0
  22. package/tests/file-viewer-search-static.test.mjs +7 -2
  23. package/tests/fixtures/fake-pi.mjs +4 -1
  24. package/tests/foreground-transcript-catch-up-static.test.mjs +91 -0
  25. package/tests/http-endpoints-harness.test.mjs +35 -2
  26. package/tests/middle-button-drag-scroll-static.test.mjs +3 -3
  27. package/tests/mobile-compact-layout.test.mjs +60 -0
  28. package/tests/mobile-continuity-tablet-static.test.mjs +3 -3
  29. package/tests/mobile-foundation-static.test.mjs +12 -12
  30. package/tests/mobile-phone-experience-static.test.mjs +2 -2
  31. package/tests/mobile-static.test.mjs +39 -20
  32. package/tests/open-issue-wizard-static.test.mjs +1 -1
  33. package/tests/persistent-ui-layout-static.test.mjs +3 -3
  34. package/tests/questionnaire-dialog.test.mjs +3 -3
  35. package/tests/rpc-supervisor-host.test.mjs +18 -1
  36. package/tests/rpc-supervisor-protocol.test.mjs +5 -0
  37. package/tests/search-match-highlighting-static.test.mjs +27 -0
  38. package/tests/session-sampling-ui-static.test.mjs +3 -3
  39. package/tests/side-panel-section-height-removal-static.test.mjs +3 -3
  40. package/tests/side-panel-section-reorder-static.test.mjs +23 -10
  41. package/tests/stream-output-isolation-static.test.mjs +1 -1
  42. package/tests/streaming-ui-coupling.test.mjs +8 -0
  43. package/tests/terminal-tab-workspace-static.test.mjs +15 -1
  44. package/tests/theme-customizer-static.test.mjs +1 -1
@@ -0,0 +1,27 @@
1
+ import assert from "node:assert/strict";
2
+ import { readFile } from "node:fs/promises";
3
+ import { dirname, join } from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
+
6
+ const root = join(dirname(fileURLToPath(import.meta.url)), "..");
7
+ const [app, css, html] = await Promise.all([
8
+ readFile(join(root, "public", "app.js"), "utf8"),
9
+ readFile(join(root, "public", "styles.css"), "utf8"),
10
+ readFile(join(root, "public", "index.html"), "utf8"),
11
+ ]);
12
+
13
+ assert.match(html, /id="fileViewerSearchOverlay"[^>]*aria-hidden="true"[^>]*hidden/, "source search should expose a non-interactive highlight overlay");
14
+ assert.match(app, /function renderFileViewerSourceSearchHighlights\(\)[\s\S]*fileViewerSearchMatches\.forEach[\s\S]*make\("mark", `file-viewer-search-match/, "source search should render every match into its synchronized overlay");
15
+ assert.match(app, /function renderFileViewerSearchHighlights\(\)[\s\S]*new HighlightConstructor\(\.\.\.ranges\)[\s\S]*file-viewer-search-match[\s\S]*file-viewer-search-current/, "Preview and Changes should use exact all-match and current-match highlights");
16
+ assert.match(app, /fileViewerEditor\?\.addEventListener\("scroll", syncFileViewerSearchOverlayScroll\)/, "source highlights should track editor scrolling");
17
+
18
+ assert.match(app, /function chatSearchRoot\(\)[\s\S]*subagentTerminalTranscript[\s\S]*elements\.chat/, "output search should select the active main or subagent transcript");
19
+ assert.match(app, /function collectChatSearchMatches\(query\)[\s\S]*while \(matches\.length < CHAT_SEARCH_MATCH_LIMIT\)[\s\S]*matches\.push\(\{ bubble, start, end:/, "output search should collect every occurrence instead of one result per message");
20
+ assert.match(app, /function renderChatSearchHighlights\(\)[\s\S]*chat-search-match[\s\S]*new HighlightConstructor\(\.\.\.ranges\)[\s\S]*chat-search-current/, "output search should render exact all-match and current-match highlights");
21
+ assert.match(app, /new MutationObserver\([\s\S]*runChatSearch\(\{ navigate: false \}\)[\s\S]*characterData: true/, "live stream refreshes should reapply open search highlights");
22
+ assert.doesNotMatch(css, /body\.subagent-terminal-active \.chat-search-bar/, "the search bar should remain visible in a subagent output view");
23
+
24
+ assert.match(css, /::highlight\(file-viewer-search-match\),\s*::highlight\(chat-search-match\)/, "file and output searches should share an all-match highlight style");
25
+ assert.match(css, /::highlight\(file-viewer-search-current\),\s*::highlight\(chat-search-current\)/, "file and output searches should share a distinct current-match style");
26
+
27
+ console.log("search match highlighting static tests passed");
@@ -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-v81"/, "native-control assets should advance the cache identity");
60
+ assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v84"/, "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=104/, "the changed stylesheet should have a new revision");
63
- assert.match(html, /app\.js\?v=120/, "the changed app module should have a new revision");
62
+ assert.match(html, /styles\.css\?v=107/, "the changed stylesheet should have a new revision");
63
+ assert.match(html, /app\.js\?v=121/, "the changed app module should have a new revision");
64
64
 
65
65
  // --- Browser state behavior -------------------------------------------------
66
66
 
@@ -27,8 +27,8 @@ assert.doesNotMatch(layout, /sectionHeightMin|sectionHeightMax|validateSectionHe
27
27
  assert.match(app, /const UI_LAYOUT_SIDE_PANEL_FIELDS = \["sectionOrder", "collapsedSectionIds", "hiddenSectionIds", "collapsed"\];/, "the browser durable layout field list should omit section heights");
28
28
  assert.match(app, /function clearRemovedSidePanelSectionHeightState\(\)[\s\S]*localStorage\.removeItem\(REMOVED_SIDE_PANEL_SECTION_HEIGHT_STORAGE_KEY\)[\s\S]*record\.field === "sidePanel" && record\.subfield === "sectionHeights"/, "startup should remove the retired cache and pending mutations");
29
29
  assert.match(app, /clearRemovedSidePanelSectionHeightState\(\);\s*restoreDurableUiLayoutPendingJournal\(\);/, "retired height state should be cleared before pending layout restoration");
30
- assert.match(html, /styles\.css\?v=104/, "removing section resize styles should advance the stylesheet revision");
31
- assert.match(html, /app\.js\?v=120/, "removing section resize behavior should advance the app revision");
32
- assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v81"/, "removing browser assets should advance the PWA cache identity");
30
+ assert.match(html, /styles\.css\?v=107/, "removing section resize styles should advance the stylesheet revision");
31
+ assert.match(html, /app\.js\?v=121/, "removing section resize behavior should advance the app revision");
32
+ assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v84"/, "removing browser assets should advance the PWA cache identity");
33
33
 
34
34
  console.log("side-panel-section-height-removal-static.test.mjs passed");
@@ -28,13 +28,23 @@ assert.match(
28
28
  );
29
29
  assert.match(
30
30
  app,
31
- /function moveSidePanelSectionRelative\(fromId, targetRecord, insertBefore\)[\s\S]*parent\.insertBefore\(sourceRecord\.section, targetRecord\.section\)[\s\S]*targetRecord\.section\.nextSibling[\s\S]*persistSidePanelSectionOrder\(\)/,
32
- "reordering should move the complete section before or after its target and persist immediately",
31
+ /function isSidePanelSectionReorderingEnabled\(\) \{\n\s+return !isMobileView\(\) \|\| sidePanelSectionEditMode;[\s\S]*function moveSidePanelSectionRelative\(fromId, targetRecord, insertBefore\) \{\n\s+if \(!isSidePanelSectionReorderingEnabled\(\)\) return false;[\s\S]*parent\.insertBefore\(sourceRecord\.section, targetRecord\.section\)[\s\S]*targetRecord\.section\.nextSibling[\s\S]*persistSidePanelSectionOrder\(\)/,
32
+ "desktop reordering should stay enabled while mobile reordering fails closed outside Edit mode",
33
+ );
34
+ assert.match(
35
+ app,
36
+ /function moveSidePanelSectionByOffset\(sectionId, offset\) \{\n\s+if \(!isSidePanelSectionReorderingEnabled\(\)\) return false;/,
37
+ "keyboard reordering should follow the desktop-always/mobile-Edit gate",
38
+ );
39
+ assert.match(
40
+ app,
41
+ /function beginSidePanelSectionPointerDrag\(event, sectionId\) \{\n\s+if \(!isSidePanelSectionReorderingEnabled\(\) \|\| event\.button !== 0/,
42
+ "pointer and touch dragging should follow the responsive reorder gate",
33
43
  );
34
44
  assert.match(
35
45
  app,
36
46
  /function updateSidePanelSectionPointerDrag\(event\)[\s\S]*Math\.hypot[\s\S]*SIDE_PANEL_SECTION_POINTER_DRAG_THRESHOLD_PX[\s\S]*sidePanelSectionToggleFromPoint[\s\S]*getBoundingClientRect\(\)[\s\S]*moveSidePanelSectionRelative/,
37
- "pointer dragging should activate only after the threshold and use header midpoint placement",
47
+ "edit-mode pointer dragging should activate only after the threshold and use header midpoint placement",
38
48
  );
39
49
  assert.match(
40
50
  app,
@@ -43,8 +53,8 @@ assert.match(
43
53
  );
44
54
  assert.match(
45
55
  app,
46
- /function bindSidePanelSectionToggles\(\)[\s\S]*Date\.now\(\) < sidePanelSectionSuppressClickUntil[\s\S]*event\.altKey[\s\S]*event\.key !== "ArrowUp"[\s\S]*moveSidePanelSectionByOffset[\s\S]*beginSidePanelSectionPointerDrag/,
47
- "section headers should retain click toggling while supporting Alt+Arrow keyboard and pointer reordering",
56
+ /function bindSidePanelSectionToggles\(\)[\s\S]*Date\.now\(\) < sidePanelSectionSuppressClickUntil[\s\S]*!isSidePanelSectionReorderingEnabled\(\) \|\| !event\.altKey[\s\S]*event\.key !== "ArrowUp"[\s\S]*moveSidePanelSectionByOffset[\s\S]*beginSidePanelSectionPointerDrag/,
57
+ "section headers should retain click toggling while the responsive gate controls Alt+Arrow and pointer reordering",
48
58
  );
49
59
  assert.match(
50
60
  app,
@@ -58,11 +68,14 @@ assert.match(
58
68
  );
59
69
  assert.match(
60
70
  css,
61
- /\.side-panel-section-toggle\[data-side-panel-section-toggle\][\s\S]*cursor: grab[\s\S]*touch-action: none[\s\S]*\.side-panel-section\.dragging[\s\S]*cursor: grabbing[\s\S]*\.drag-over-before[\s\S]*\.drag-over-after/,
62
- "section headers should expose model-picker-style grab, dragging, and insertion-marker affordances",
71
+ /\.side-panel-edit-button \{\n\s+display: none;[\s\S]*?\.side-panel\.section-edit-mode \.side-panel-section-toggle\[data-side-panel-section-toggle\] \{\n\s+cursor: grab;\n\s+touch-action: none;\n\s+user-select: none;\n\}[\s\S]*?@media \(max-width: 720px\), \(max-device-width: 720px\), \(pointer: coarse\) and \(hover: none\) \{[\s\S]*?\.side-panel-edit-button \{ display: inline-flex;[\s\S]*?\.side-panel\.section-edit-mode \.side-panel-section-toggle\[data-side-panel-section-toggle\] \{\n\s+border-color:[\s\S]*?box-shadow:[\s\S]*?\.side-panel\.section-edit-mode \.side-panel-section-label::before \{/,
72
+ "desktop should keep drag capture without edit highlighting while mobile restores Edit and its visual affordance",
63
73
  );
64
- assert.match(html, /styles\.css\?v=104/, "changed side-panel styles should advance the stylesheet revision");
65
- assert.match(html, /app\.js\?v=120/, "changed side-panel behavior should advance the app revision");
66
- assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v81"/, "changed browser assets should advance the PWA cache identity");
74
+ assert.match(html, /id="sidePanelEditButton"[^>]*aria-controls="sidePanel"[^>]*aria-pressed="false"[^>]*aria-label="Edit Control Deck section order"[\s\S]*side-panel-edit-button-label">Edit</, "mobile Control Deck should retain an accessible Edit toggle");
75
+ assert.match(app, /function setSidePanelSectionEditMode\(enabled\)[\s\S]*const next = isMobileView\(\) && !!enabled;[\s\S]*classList\.toggle\("section-edit-mode", reorderingEnabled\)[\s\S]*aria-pressed[\s\S]*"Done" : "Edit"[\s\S]*aria-keyshortcuts/, "mobile Edit state and always-enabled desktop reorder affordances should stay synchronized");
76
+ assert.match(app, /function setSidePanelCollapsed\(collapsed,[\s\S]*if \(collapsed\) setSidePanelSectionEditMode\(false\);/, "closing the Control Deck should leave transient edit mode");
77
+ assert.match(html, /styles\.css\?v=107/, "changed side-panel styles should advance the stylesheet revision");
78
+ assert.match(html, /app\.js\?v=121/, "changed side-panel behavior should advance the app revision");
79
+ assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v84"/, "changed browser assets should advance the PWA cache identity");
67
80
 
68
81
  console.log("side-panel-section-reorder-static.test.mjs passed");
@@ -37,7 +37,7 @@ const forbiddenSinks = [
37
37
  ".focus(", "scrollIntoView", "fetch(", "api(",
38
38
  ];
39
39
 
40
- assert.match(app, /import \{ createStreamOutputController \} from "\.\/stream-output-controller\.mjs";/);
40
+ assert.match(app, /import \{ classifyTranscriptStreamEvent, createStreamOutputController \} from "\.\/stream-output-controller\.mjs";/);
41
41
  assert.match(controller, /export function classifyTranscriptStreamEvent/);
42
42
  assert.match(controller, /export function createStreamOutputController/);
43
43
  assert.match(controller, /let frameHandle = null;[\s\S]*?let pending = \[\];[\s\S]*?let pendingBytes = 0;/, "controller should retain one cancellable bounded queue");
@@ -5,6 +5,7 @@ import { fileURLToPath } from "node:url";
5
5
 
6
6
  const root = join(dirname(fileURLToPath(import.meta.url)), "..");
7
7
  const app = await readFile(join(root, "public", "app.js"), "utf8");
8
+ const styles = await readFile(join(root, "public", "styles.css"), "utf8");
8
9
  const transcriptRenderer = await readFile(join(root, "public", "transcript-renderer.mjs"), "utf8");
9
10
 
10
11
  const SELF_CONTAINED_THEORY_TITLES = new Map([
@@ -85,6 +86,7 @@ assertDocTheory(8, "steer prompt");
85
86
 
86
87
  const syncLiveTodoProgressWidgetFromText = findFunctionBody(app, "syncLiveTodoProgressWidgetFromText");
87
88
  const scheduleLiveWidgetRender = findFunctionBody(app, "scheduleLiveWidgetRender");
89
+ const appendOptimisticUserPrompt = findFunctionBody(app, "appendOptimisticUserPrompt");
88
90
  const handleMessageUpdate = findFunctionBody(app, "handleMessageUpdate");
89
91
  const scrollChatToBottom = findFunctionBody(app, "scrollChatToBottom");
90
92
  const stripTodoProgressLines = findFunctionBody(app, "stripTodoProgressLines");
@@ -126,6 +128,12 @@ assert.match(
126
128
  "disabling todo-progress should still suppress the optional widget renderer itself",
127
129
  );
128
130
 
131
+ assert.match(styles, /\.chat \{[\s\S]*?display:\s*flex;[\s\S]*?flex-direction:\s*column;/, "the transcript should retain a stable vertical flow as composer geometry changes");
132
+ assert.match(styles, /\.chat > \.message:first-of-type \{ margin-top:\s*0; \}/, "settled transcript cards should stay top-anchored while the prompt textarea auto-resizes");
133
+ assert.doesNotMatch(styles, /\.chat > \.message:first-of-type \{ margin-top:\s*auto; \}/, "short transcripts must not follow the moving composer edge while the user types");
134
+ assert.match(appendOptimisticUserPrompt, /renderAllMessages\(\);[\s\S]*?scrollChatToBottom\(\{ force:\s*true \}\);/, "submitting a prompt should explicitly resume bottom-follow for the new turn");
135
+ assert.doesNotMatch(appendOptimisticUserPrompt, /if \(autoFollowChat \|\| isChatNearBottom\(\)\)/, "a paused reader position should not leave a newly submitted turn off-screen");
136
+
129
137
  futureInvariant("theory #1: message_update streaming hot path must not call immediate scroll/layout work", () => {
130
138
  assert.doesNotMatch(handleMessageUpdate, /scrollChatToBottom\s*\(/, "handleMessageUpdate should schedule/coalesce follow-scroll instead of calling scrollChatToBottom() directly");
131
139
  });
@@ -38,6 +38,7 @@ const sources = [
38
38
  ].join("\n");
39
39
  const terminalTabMetaSource = appFunctionSource("terminalTabMeta", "terminalTabGitTooltip");
40
40
  const renderTerminalTabGroupSource = appFunctionSource("renderTerminalTabGroup", "updateTerminalTabGroupOpenState");
41
+ const renderSubagentTerminalTabGroupSource = appFunctionSource("renderSubagentTerminalTabGroup", "openSubagentOutput");
41
42
 
42
43
  const context = {
43
44
  normalizeDisplayPath: (value) => String(value || "").replace(/\\/g, "/"),
@@ -51,6 +52,7 @@ const context = {
51
52
  tabWorkflowModeActive: (tab) => tab.workflowMode === true,
52
53
  workflowRunningCountForTab: (id) => id === "tab-1" ? 2 : 0,
53
54
  terminalDisplayGroupTitle: () => "Workspace group",
55
+ isMobileView: () => false,
54
56
  };
55
57
 
56
58
  const results = vm.runInNewContext(`
@@ -90,9 +92,21 @@ assert.doesNotMatch(terminalTabMetaSource, /\bpid\b/i, "compact tab metadata sho
90
92
  assert.equal(app.match(/applyStyledTooltip\(button, terminalTabTooltip\(tab\)/g)?.length, 2, "single and grouped-item tabs should share one tooltip formatter");
91
93
  assert.match(renderTerminalTabGroupSource, /applyStyledTooltip\(button, terminalTabGroupTooltip\(group, groupTitle\), \{ ariaLabel: false, description: true, placement: "right", variant: "workspace", targetKey: `terminal-group:\$\{group\.key\}:switch` \}\)/, "group hover disclosure should use the shared floating tooltip layer with stable semantic identity to the right of its trigger");
92
94
  assert.doesNotMatch(renderTerminalTabGroupSource, /terminal-tab-group-summary|menu\.append\(summary\)/, "group hover disclosure should not render an in-flow summary that shifts group menu items");
95
+ assert.match(renderTerminalTabGroupSource, /dropdown: true[\s\S]*button\.addEventListener\("click", \(\) => \{[\s\S]*if \(isMobileView\(\)\)[\s\S]*toggleOpenTerminalTabGroup\(group\.key\)[\s\S]*switchTab\(activeGroupTab\.id\)/, "mobile terminal group titles should toggle their dropdown while desktop titles keep switching terminals");
96
+ assert.match(renderSubagentTerminalTabGroupSource, /dropdown: true[\s\S]*button\.addEventListener\("click", \(\) => \{[\s\S]*if \(isMobileView\(\)\)[\s\S]*toggleOpenTerminalTabGroup\(group\.key\)[\s\S]*activateSubagentTerminalView\(activeView\.id\)/, "mobile subagent group titles should toggle their dropdown while desktop titles keep switching views");
97
+ assert.equal((`${renderTerminalTabGroupSource}\n${renderSubagentTerminalTabGroupSource}`.match(/event\.pointerType === "touch"/g) || []).length, 4, "touch pointer enter and leave should not compete with explicit dropdown taps");
98
+ assert.match(renderTerminalTabGroupSource, /menu\.id = `terminalTabGroupMenu\$\{\+\+terminalTabGroupMenuSerial\}`[\s\S]*button\.setAttribute\("aria-controls", menu\.id\)/, "regular terminal dropdown buttons should own their generated group list");
99
+ assert.match(renderSubagentTerminalTabGroupSource, /menu\.id = `terminalTabGroupMenu\$\{\+\+terminalTabGroupMenuSerial\}`[\s\S]*button\.setAttribute\("aria-controls", menu\.id\)/, "subagent dropdown buttons should own their generated group list");
100
+ assert.match(styles, /\.terminal-tab-group-dropdown-indicator \{[\s\S]*display:\s*none;[\s\S]*\.terminal-tab-group-button\[aria-expanded="true"\] \.terminal-tab-group-dropdown-indicator[\s\S]*rotate\(180deg\)/, "group buttons should expose a stateful dropdown indicator");
101
+ assert.match(styles, /\.terminal-tab-group-button \{\n\s+width:\s*100%;\n\s+min-width:\s*0;[\s\S]*\.terminal-tab-group-dropdown-indicator \{ display:\s*inline-grid; \}/, "mobile terminal groups should show the dropdown indicator and retain a full-width trigger");
102
+ assert.match(styles, /\.terminal-tab-group:hover:not\(\.menu-open\) \.terminal-tab-group-menu,[\s\S]*\.terminal-tab-group:focus-within:not\(\.menu-open\) \.terminal-tab-group-menu \{\n\s+display:\s*none;/, "mobile focus and latched hover should not keep a toggled-closed group visible");
103
+ assert.match(app, /if \(activeDrawerModal\.surface === elements\.terminalTabsShell && openTerminalTabGroupKey\)[\s\S]*event\.stopPropagation\(\)[\s\S]*clearOpenTerminalTabGroup\(openTerminalTabGroupKey, \{ force: true \}\)[\s\S]*terminal-tab-group-button/, "Escape should close a mobile group dropdown before closing the terminal drawer");
104
+ assert.match(app, /if \(tabId === activeTabId\) \{\n\s+clearOpenTerminalTabGroup\(null, \{ force: true \}\);\n\s+setMobileTabsExpanded\(false\);/, "selecting the already-active regular group member should close the mobile group and drawer");
105
+ assert.match(app, /async function activateSubagentTerminalView\(viewId\)[\s\S]*clearOpenTerminalTabGroup\(null, \{ force: true \}\);\n\s+setMobileTabsExpanded\(false\);/, "selecting a subagent group member should close the mobile group and drawer");
106
+ assert.match(app, /lines\.push\(isMobileView\(\) \? "Tap to open group terminals" : "Click to switch · Drop tabs here to add"\)/, "group accessible descriptions should match mobile dropdown and desktop switch behavior");
93
107
  assert.match(app, /footerTooltipNode\.setAttribute\("role", "tooltip"\)/, "the shared visual tooltip should expose tooltip semantics");
94
108
  assert.match(app, /document\.addEventListener\("keydown", \(event\) => \{[\s\S]*event\.key === "Escape" && footerTooltipTarget[\s\S]*hideFooterTooltip\(footerTooltipTarget\)[\s\S]*\}, true\)/, "Escape should dismiss both hover- and focus-triggered tooltips from the document capture phase");
95
- assert.match(app, /data-tooltip-variant"\) === "workspace" && !node\.matches\(":focus-visible"\)/, "touch focus should not flash the large workspace tooltip while keyboard focus remains supported");
109
+ assert.match(app, /node\.addEventListener\("focus", \(\) => \{[\s\S]*?!node\.matches\(":focus-visible"\)[\s\S]*?showFooterTooltip\(node\)/, "touch focus should not flash styled tooltips while keyboard focus remains supported");
96
110
  assert.match(app, /styled-tooltip-description[\s\S]*aria-describedby/, "detailed tab tooltip text should be available as an accessible description");
97
111
  assert.match(styles, /footer-floating-tooltip\[data-variant="workspace"\][\s\S]*line-height: 1\.52/, "workspace tooltips should use the readable visual variant");
98
112
  assert.doesNotMatch(styles, /terminal-tab-group-summary/, "group tooltip styling should not reserve in-flow menu space");
@@ -34,7 +34,7 @@ assert.match(html, /role="alert" hidden>[\s\S]*Replace this exact target\?/, "ov
34
34
 
35
35
  assert.match(app, /from "\.\/theme-contract\.mjs"/, "frontend should consume the shared browser-safe theme contract");
36
36
  assert.match(serviceWorker, /"\/theme-contract\.mjs"/, "the PWA app shell should cache the startup-critical theme contract");
37
- assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v81"/, "adding the theme contract to the startup graph should advance the PWA cache identity");
37
+ assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v84"/, "adding the theme contract to the startup graph should advance the PWA cache identity");
38
38
  assert.match(pkg, /node --check public\/theme-contract\.mjs/, "the package check should syntax-check the startup-critical theme contract");
39
39
  assert.match(app, /function themeDraftFromCatalog\(theme, name = theme\?\.name\)[\s\S]*colors: cloneThemeDraft\(theme\?\.colors \|\| \{\}\)/, "catalog metadata should be projected into a schema-only editable draft");
40
40
  assert.match(app, /for \(const \{ name, label \} of group\.tokens\)/, "visual controls should render from the exact shared token inventory");