@firstpick/pi-package-webui 0.8.9 → 0.9.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/README.md +222 -19
- package/bin/pi-webui.mjs +24 -7
- package/lib/app-runner-terminal.mjs +40 -0
- package/package.json +2 -2
- package/public/app.js +348 -72
- package/public/index.html +1 -0
- package/public/styles.css +48 -7
- package/tests/app-runner-terminal-static.test.mjs +28 -0
- package/tests/app-runner-terminal.test.mjs +65 -0
- package/tests/browser/interaction-continuity.spec.mjs +94 -0
- package/tests/browser/search-match-highlighting.spec.mjs +104 -0
- package/tests/chat-scroll-intent-static.test.mjs +1 -1
- package/tests/file-viewer-search-static.test.mjs +7 -2
- package/tests/footer-provider-usage-visual-static.test.mjs +10 -8
- package/tests/foreground-transcript-catch-up-static.test.mjs +91 -0
- package/tests/http-endpoints-harness.test.mjs +29 -0
- package/tests/mobile-static.test.mjs +12 -4
- package/tests/search-match-highlighting-static.test.mjs +27 -0
- package/tests/stream-output-isolation-static.test.mjs +1 -1
|
@@ -1144,7 +1144,10 @@ assert.match(app, /function renderOptionalFeaturePanel\(\)/, "side panel should
|
|
|
1144
1144
|
assert.match(app, /const OPTIONAL_FEATURE_SECTIONS = \[[\s\S]*label: "Composer & commands"[\s\S]*label: "Workflows & releases"[\s\S]*label: "Safety & access"[\s\S]*label: "UI widgets & native parity"[\s\S]*featureIds: \[[^\]]*"questionnaire"[\s\S]*label: "Conversation"/, "optional features should be grouped into five type subsections with questionnaires under native parity");
|
|
1145
1145
|
assert.match(app, /function renderOptionalFeatureSection\(section, features\)[\s\S]*optional-feature-section[\s\S]*optional-feature-section-title[\s\S]*optional-feature-section-list/, "optional feature panel should render subsection headers and lists");
|
|
1146
1146
|
assert.match(app, /async function refreshQuestionnaireFeatureAvailability[\s\S]*\/api\/tools\?scope=session[\s\S]*tool\?\.name === "questionnaire"/, "questionnaire availability should be detected from the active Pi tab's loaded tool capability");
|
|
1147
|
-
assert.match(app, /
|
|
1147
|
+
assert.match(app, /async function setToolManagedOptionalFeatureEnabled\(feature, enabled\)[\s\S]*\/api\/tools\?scope=session[\s\S]*enabledTools[\s\S]*scope: "session"[\s\S]*\/api\/tools/, "the questionnaire row toggle should update the active session tool allowlist while preserving other tool states");
|
|
1148
|
+
assert.match(app, /detected && feature\.manageWith === "tools"[\s\S]*action\.textContent = enabled \? "Disable" : "Enable"[\s\S]*setToolManagedOptionalFeatureEnabled/, "loaded questionnaire access should expose a dedicated enable or disable action");
|
|
1149
|
+
assert.match(app, /if \(detected && feature\.setup\)[\s\S]*"optional-feature-action setup", "Setup"[\s\S]*openOptionalFeatureSetup/, "detected configurable optional features should expose a separate Setup action");
|
|
1150
|
+
assert.match(app, /case "tools": return openNativeToolsSelector\(\)/, "Native questionnaires Setup should open the browser-native Tools Setup dialog");
|
|
1148
1151
|
assert.match(app, /function setSidePanelSectionCollapsed\(record, collapsed/, "side panel sections should have explicit collapse/expand behavior");
|
|
1149
1152
|
assert.match(
|
|
1150
1153
|
app,
|
|
@@ -1600,7 +1603,7 @@ assert.match(app, /id: "safetyGuard"[\s\S]*?@firstpick\/pi-extension-safety-guar
|
|
|
1600
1603
|
assert.match(app, /id: "tuiSkillsCommand"[\s\S]*?@firstpick\/pi-extension-setup-skills/, "optional features should include the TUI skills command companion");
|
|
1601
1604
|
assert.match(app, /id: "tuiToolsCommand"[\s\S]*?@firstpick\/pi-extension-tools/, "optional features should include the TUI tools command companion");
|
|
1602
1605
|
assert.match(app, /id: "remoteWebui"[\s\S]*?@firstpick\/pi-package-remote-webui/, "optional features should include the Remote WebUI companion");
|
|
1603
|
-
assert.match(app, /id: "questionnaire"[\s\S]*?@firstpick\/pi-package-questionnaire[\s\S]*?capabilityLabel: "questionnaire tool in \/tools"[\s\S]*?manageWith: "tools"/, "optional features should include the native questionnaire package
|
|
1606
|
+
assert.match(app, /id: "questionnaire"[\s\S]*?@firstpick\/pi-package-questionnaire[\s\S]*?capabilityLabel: "questionnaire tool in \/tools"[\s\S]*?manageWith: "tools"[\s\S]*?setup: "tools"/, "optional features should include the native questionnaire package with session access control and a Tools Setup entry point");
|
|
1604
1607
|
assert.match(app, /id: "naturalConversation"[\s\S]*?@firstpick\/pi-package-natural-conversation[\s\S]*?capabilityLabel: "\/talk, \/voice, or \/conversation"/, "optional features should include the capability-detected Natural Conversation shell");
|
|
1605
1608
|
assert.match(app, /NATURAL_CONVERSATION_COMMAND_NAMES = \["talk", "voice", "conversation"\]/, "frontend should detect Natural Conversation only from RPC-visible command aliases");
|
|
1606
1609
|
assert.match(app, /const conversationModeByTab = new Map\(\)/, "frontend should track Natural Conversation state per terminal tab");
|
|
@@ -2516,9 +2519,14 @@ assert.match(app, /case "message_end": \{(?:(?!case ")[\s\S])*?scheduleSemanticR
|
|
|
2516
2519
|
assert.match(html, /id="chatSearchBar"[\s\S]*?id="chatSearchInput"[\s\S]*?id="chatSearchPrevButton"[\s\S]*?id="chatSearchNextButton"[\s\S]*?id="chatSearchCloseButton"/, "transcript search bar markup should exist with navigation controls");
|
|
2517
2520
|
assert.match(app, /function openChatSearch\(\)[\s\S]*?elements\.chatSearchInput\?\.focus\(\)/, "opening transcript search should focus the input");
|
|
2518
2521
|
assert.match(app, /\(event\.ctrlKey \|\| event\.metaKey\) && !event\.altKey && !event\.shiftKey && event\.key\.toLowerCase\(\) === "f"/, "Ctrl\/Cmd+F should open the transcript search");
|
|
2522
|
+
assert.match(app, /function chatSearchRoot\(\)[\s\S]*subagentTerminalTranscript[\s\S]*elements\.chat/, "transcript search should target the active main or subagent output stream");
|
|
2523
|
+
assert.match(app, /function collectChatSearchMatches\(query\)[\s\S]*while \(matches\.length < CHAT_SEARCH_MATCH_LIMIT\)[\s\S]*matches\.push\(\{ bubble, start, end:/, "transcript search should collect every matching occurrence instead of only matching bubbles");
|
|
2524
|
+
assert.match(app, /function renderChatSearchHighlights\(\)[\s\S]*chat-search-match[\s\S]*new HighlightConstructor\(\.\.\.ranges\)[\s\S]*chat-search-current/, "transcript search should highlight all exact ranges and distinguish the current one");
|
|
2519
2525
|
assert.match(app, /function focusChatSearchMatch\(\)[\s\S]*?details\.open = true;[\s\S]*?scrollIntoView/, "navigating to a search match should expand collapsed tool output and scroll to the bubble");
|
|
2520
|
-
assert.match(app, /autoFollowChat = false;\n
|
|
2521
|
-
assert.match(
|
|
2526
|
+
assert.match(app, /autoFollowChat = false;\n lastChatProgrammaticScrollAt = performance\.now\(\);/, "main-transcript search navigation must not fight chat auto-follow");
|
|
2527
|
+
assert.match(app, /new MutationObserver\([\s\S]*runChatSearch\(\{ navigate: false \}\)[\s\S]*characterData: true/, "open searches should re-highlight refreshed live output without stealing navigation focus");
|
|
2528
|
+
assert.match(css, /::highlight\(chat-search-match\)[\s\S]*::highlight\(chat-search-current\)/, "all transcript matches and the current match should have distinct highlight styles");
|
|
2529
|
+
assert.doesNotMatch(css, /body\.subagent-terminal-active \.chat-search-bar/, "the search bar must remain visible while viewing a subagent output stream");
|
|
2522
2530
|
assert.match(css, /\.chat \{[^}]*overflow:\s*auto;[^}]*overflow-anchor:\s*none;/, "the transcript should disable browser scroll anchoring because paused-reader position is controlled explicitly during live growth");
|
|
2523
2531
|
assert.match(css, /\.chat-search-bar,\n\.file-viewer-search-bar \{/, "transcript search bar should be styled");
|
|
2524
2532
|
|
|
@@ -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");
|
|
@@ -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");
|