@firstpick/pi-package-webui 0.9.6 → 0.9.8
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 +13 -5
- package/bin/pi-webui.mjs +480 -96
- package/index.ts +2 -1
- package/lib/git-workflow-preferences.mjs +21 -1
- package/lib/optional-feature-catalog.mjs +1 -1
- package/lib/session-tree-event-targets.mjs +70 -0
- package/lib/subagent-launch-policy.mjs +375 -0
- package/lib/subagent-launch-slots.mjs +2 -1
- package/package.json +1 -1
- package/public/app.js +1348 -131
- package/public/guided-git-command-state.mjs +175 -1
- package/public/index.html +48 -9
- package/public/service-worker.js +1 -1
- package/public/styles.css +387 -34
- package/public/transcript-renderer.mjs +62 -0
- package/tests/boot-failure-diagnostics.test.mjs +3 -3
- package/tests/browser/control-visibility.spec.mjs +141 -2
- package/tests/browser/events-tree-context-menu.spec.mjs +240 -0
- package/tests/browser/footer-model-advanced-layout.spec.mjs +512 -0
- package/tests/browser/guided-git-extension-command.spec.mjs +180 -0
- package/tests/browser/guided-git-fallback.spec.mjs +218 -0
- package/tests/browser/interaction-continuity.spec.mjs +33 -0
- package/tests/codex-fast-mode-static.test.mjs +2 -2
- package/tests/compact-sections-static.test.mjs +4 -0
- package/tests/compaction-static.test.mjs +1 -1
- package/tests/composer-action-grid-reorder-static.test.mjs +3 -3
- package/tests/control-visibility-static.test.mjs +66 -3
- package/tests/controls-layout-static.test.mjs +3 -3
- package/tests/events-tree-context-menu-static.test.mjs +131 -0
- package/tests/fast-mode-client-static.test.mjs +5 -2
- 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 +34 -3
- package/tests/git-footer-context-menu-static.test.mjs +103 -1
- package/tests/git-workflow-preferences.test.mjs +30 -1
- package/tests/guided-git-activation-http.test.mjs +194 -0
- package/tests/guided-git-activation-static.test.mjs +80 -0
- package/tests/guided-git-activation.test.mjs +244 -0
- package/tests/guided-git-fallback-runtime.test.mjs +419 -0
- package/tests/guided-git-fallback-ui-static.test.mjs +60 -0
- package/tests/guided-git-message-reliability-static.test.mjs +9 -7
- package/tests/guided-git-optional-feature.test.mjs +31 -0
- package/tests/http-endpoints-harness.test.mjs +3 -0
- package/tests/interaction-state-stability-static.test.mjs +1 -1
- package/tests/intercom-conversation-viewer-static.test.mjs +3 -3
- package/tests/main-output-loading-static.test.mjs +11 -9
- 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 +92 -9
- 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 +6 -6
- package/tests/prompt-routing-input-clear-static.test.mjs +1 -1
- package/tests/questionnaire-dialog.test.mjs +3 -3
- package/tests/remote-auth-settings-harness.test.mjs +23 -0
- package/tests/resource-defaults-helper.test.mjs +12 -0
- package/tests/session-sampling-helper.test.mjs +1 -0
- package/tests/session-sampling-ui-static.test.mjs +3 -3
- package/tests/session-tree-event-targets.test.mjs +106 -0
- package/tests/side-panel-section-height-removal-static.test.mjs +3 -3
- package/tests/subagent-launch-policy.test.mjs +532 -0
- package/tests/subagent-observability-static.test.mjs +2 -2
- package/tests/subagents-helper.test.mjs +211 -1
- package/tests/syntax-highlighting-static.test.mjs +3 -3
- package/tests/tab-close-continuity-static.test.mjs +25 -0
- package/tests/theme-customizer-static.test.mjs +1 -1
- package/tests/thinking-block-grouping.test.mjs +79 -0
- package/webui-rpc-helper.mjs +220 -3
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
|
|
6
|
+
const root = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
7
|
+
const [html, app, styles, serviceWorker] = await Promise.all([
|
|
8
|
+
readFile(join(root, "public", "index.html"), "utf8"),
|
|
9
|
+
readFile(join(root, "public", "app.js"), "utf8"),
|
|
10
|
+
readFile(join(root, "public", "styles.css"), "utf8"),
|
|
11
|
+
readFile(join(root, "public", "service-worker.js"), "utf8"),
|
|
12
|
+
]);
|
|
13
|
+
|
|
14
|
+
function functionSource(source, name) {
|
|
15
|
+
const start = source.indexOf(`function ${name}(`);
|
|
16
|
+
assert.ok(start >= 0, `${name} should exist`);
|
|
17
|
+
const next = source.slice(start + 1).match(/\n(?:async )?function [A-Za-z0-9_$]+\(/);
|
|
18
|
+
const end = next ? start + 1 + next.index : source.length;
|
|
19
|
+
return source.slice(start, end);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Dedicated, labelled menu markup.
|
|
23
|
+
assert.match(html, /<div id="eventTreeContextMenu"[^>]*role="menu"[^>]*aria-labelledby="eventTreeContextMenuLabel"[^>]*hidden>/, "Events should own a labelled context menu");
|
|
24
|
+
assert.match(html, /id="eventDisplayDetailedAction"[^>]*role="menuitemradio"[^>]*aria-checked="true"[^>]*>Detailed<\/button>/, "the menu should expose Detailed as the default mode");
|
|
25
|
+
assert.match(html, /id="eventDisplayCompactAction"[^>]*role="menuitemradio"[^>]*aria-checked="false"[^>]*>Compact<\/button>/, "the menu should expose Compact mode");
|
|
26
|
+
assert.match(html, /role="separator"[\s\S]*id="eventTreeContextMenuAction"[^>]*role="menuitem"[^>]*>Tree…<\/button>[\s\S]*id="eventTreeContextMenuStatus"[^>]*role="status"/, "display choices should stay separate from Tree navigation and live feedback");
|
|
27
|
+
assert.match(html, /<label for="eventFilterSelect">Show<\/label>[\s\S]*id="eventFilterSelect"[\s\S]*value="all">All events<[\s\S]*value="errors">Errors \/ failures<[\s\S]*value="warnings">Warnings<[\s\S]*value="tools">Tool activity<[\s\S]*value="tree">Tree available</, "Events should expose the recommended native filter choices");
|
|
28
|
+
assert.match(html, /id="eventFilterStatus"[^>]*role="status"[^>]*aria-live="polite"[\s\S]*id="eventFilterEmpty"[^>]*hidden/, "the filter should expose live counts and an empty state");
|
|
29
|
+
|
|
30
|
+
const normalizeDisplaySource = functionSource(app, "normalizeEventDisplayMode");
|
|
31
|
+
assert.match(normalizeDisplaySource, /value === "compact" \? "compact" : "detailed"/, "unknown values should fall back to detailed mode");
|
|
32
|
+
assert.match(functionSource(app, "readStoredEventDisplayMode"), /localStorage\.getItem\(EVENT_DISPLAY_MODE_STORAGE_KEY\)/, "the display preference should restore from browser-local storage");
|
|
33
|
+
const setDisplaySource = functionSource(app, "setEventDisplayMode");
|
|
34
|
+
assert.match(setDisplaySource, /localStorage\.setItem\(EVENT_DISPLAY_MODE_STORAGE_KEY, eventDisplayMode\)/, "display choices should persist");
|
|
35
|
+
assert.match(functionSource(app, "syncEventDisplayModeUi"), /eventLog\.dataset\.displayMode = eventDisplayMode[\s\S]*eventDisplayDetailedAction[\s\S]*eventDisplayCompactAction/, "the current choice should update the log and radio menu state");
|
|
36
|
+
|
|
37
|
+
const normalizeFilterSource = functionSource(app, "normalizeEventFilter");
|
|
38
|
+
assert.match(normalizeFilterSource, /EVENT_FILTER_VALUES\.has\(value\) \? value : "all"/, "unknown filters should fall back to all events");
|
|
39
|
+
assert.match(functionSource(app, "readStoredEventFilter"), /localStorage\.getItem\(EVENT_FILTER_STORAGE_KEY\)/, "the event filter should restore from browser-local storage");
|
|
40
|
+
const filterMatchSource = functionSource(app, "eventRowMatchesFilter");
|
|
41
|
+
for (const contract of [
|
|
42
|
+
/filter === "errors"[\s\S]*eventLevel === "error"/,
|
|
43
|
+
/filter === "warnings"[\s\S]*eventLevel === "warn"/,
|
|
44
|
+
/filter === "tools"[\s\S]*eventToolPhase/,
|
|
45
|
+
/filter === "tree"[\s\S]*eventTreeAvailable === "true"/,
|
|
46
|
+
]) assert.match(filterMatchSource, contract, "each visible filter should have an explicit row predicate");
|
|
47
|
+
const applyFilterSource = functionSource(app, "applyEventFilter");
|
|
48
|
+
assert.match(applyFilterSource, /line\.hidden = !matches[\s\S]*eventFilterStatus[\s\S]*eventFilterEmpty\.hidden/, "filtering should hide rows in place and update count and empty-state feedback");
|
|
49
|
+
const setFilterSource = functionSource(app, "setEventFilter");
|
|
50
|
+
assert.match(setFilterSource, /localStorage\.setItem\(EVENT_FILTER_STORAGE_KEY, eventFilter\)/, "filter choices should persist");
|
|
51
|
+
assert.match(app, /eventFilterSelect\?\.addEventListener\("change"[\s\S]*setEventFilter\(elements\.eventFilterSelect\.value\)/, "the native select should apply its selected filter");
|
|
52
|
+
assert.match(app, /event\.key === EVENT_FILTER_STORAGE_KEY[\s\S]*setEventFilter\(event\.newValue, \{ persist: false \}\)/, "filter changes should synchronize across same-origin tabs");
|
|
53
|
+
|
|
54
|
+
// Bounded event details: explicit target allowlist, status, duration, and shortened ID.
|
|
55
|
+
const targetSource = functionSource(app, "boundedToolEventTarget");
|
|
56
|
+
for (const toolName of ["read", "write", "edit", "grep", "find", "ls"]) {
|
|
57
|
+
assert.ok(app.includes(`["${toolName}", "path"]`), `${toolName} should be in the explicit path-target allowlist`);
|
|
58
|
+
}
|
|
59
|
+
assert.match(targetSource, /typeof value !== "string"/, "allowlisted details should accept only string fields");
|
|
60
|
+
assert.match(targetSource, /singleLine\.length > 96/, "allowlisted target text should be bounded");
|
|
61
|
+
assert.doesNotMatch(targetSource, /JSON\.stringify|\.result|\.output|Object\.values|Object\.entries/, "event details must not serialize arbitrary args or inspect output");
|
|
62
|
+
const detailsSource = functionSource(app, "toolLifecycleEventDetails");
|
|
63
|
+
for (const label of ["target", "status", "duration", "call"]) {
|
|
64
|
+
assert.ok(detailsSource.includes(`label: "${label}"`), `tool details should expose bounded ${label} metadata`);
|
|
65
|
+
}
|
|
66
|
+
assert.match(functionSource(app, "shortenedToolCallId"), /slice\(0, 7\)[\s\S]*slice\(-5\)/, "long call IDs should be visibly shortened");
|
|
67
|
+
const lifecycleArgumentsSource = functionSource(app, "toolLifecycleEventArguments");
|
|
68
|
+
assert.match(lifecycleArgumentsSource, /toolEventStartedAt\.set\(timerKey, \{ startedAt: occurredAt, target: boundedToolEventTarget\(event\) \}\)/, "start records should retain only timing and already bounded target text");
|
|
69
|
+
assert.doesNotMatch(lifecycleArgumentsSource, /args:|arguments:|invocation:|\.\.\.event|JSON\.stringify/, "start records must not retain raw tool arguments");
|
|
70
|
+
assert.match(lifecycleArgumentsSource, /toolLifecycleEventDetails[\s\S]*toolEventStartedAt\.delete/, "completion rows should consume and remove the matching bounded start record");
|
|
71
|
+
assert.match(detailsSource, /phase === "finish"[\s\S]*toolEventStartedAt\.get\(toolEventTimerKey\(event\)\)[\s\S]*boundedToolEventTarget\(event\) \|\| startRecord\?\.target/, "finish rows should reuse the matching bounded start target when completion args omit it");
|
|
72
|
+
|
|
73
|
+
// Every row exposes display choices; stable lifecycle rows alone expose Tree navigation.
|
|
74
|
+
const addEventSource = functionSource(app, "addEvent");
|
|
75
|
+
assert.match(addEventSource, /const toolLifecycle = \["start", "finish"\]\.includes\(toolEventPhase\)[\s\S]*stableToolCallId && toolLifecycle/, "only stable lifecycle rows should be Tree eligible");
|
|
76
|
+
assert.match(addEventSource, /line\.dataset\.eventLevel = String\(level[\s\S]*line\.dataset\.eventTreeAvailable = String\(!!treeEligible\)/, "rows should retain bounded filter metadata without copying payloads");
|
|
77
|
+
assert.match(addEventSource, /if \(toolLifecycle\) line\.dataset\.eventToolPhase = toolEventPhase/, "all tool lifecycle rows should remain visually identifiable in compact mode");
|
|
78
|
+
assert.match(addEventSource, /while \(elements\.eventLog\.children\.length > 120\)[\s\S]*applyEventFilter\(\)/, "new rows should apply the active filter after preserving the existing history bound");
|
|
79
|
+
assert.match(addEventSource, /setAttribute\("aria-keyshortcuts", "ContextMenu Shift\+F10"\)/, "every event row should expose keyboard display choices");
|
|
80
|
+
assert.match(addEventSource, /addEventListener\("click", \(\) => jumpToChatEvent\(line\)\)/, "event rows should preserve click-to-jump");
|
|
81
|
+
assert.match(
|
|
82
|
+
functionSource(app, "handleEvent"),
|
|
83
|
+
/case "tool_execution_start":[\s\S]*isIntercomTransportToolName\(event\.toolName\)[\s\S]*break;[\s\S]*toolLifecycleEventArguments\(event, "start"\)[\s\S]*case "tool_execution_end":[\s\S]*isIntercomTransportToolName\(event\.toolName\)[\s\S]*break;[\s\S]*toolLifecycleEventArguments\(event, "finish"\)/,
|
|
84
|
+
"hidden Intercom transport calls should still bypass event rows",
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
// Pointer and keyboard invocation, viewport clamping, focus, dismissal, and menu navigation.
|
|
88
|
+
assert.match(app, /eventLog\?\.addEventListener\("contextmenu"[\s\S]*closest\?\.\("\.event"\)[\s\S]*showEventTreeContextMenu\(event, line\)/, "every event row should support pointer display choices");
|
|
89
|
+
assert.match(app, /eventLog\?\.addEventListener\("keydown"[\s\S]*event\.key !== "ContextMenu"[\s\S]*event\.shiftKey && event\.key === "F10"[\s\S]*closest\?\.\("\.event"\)/, "every focused event row should support both keyboard invocations");
|
|
90
|
+
const showMenuSource = functionSource(app, "showEventTreeContextMenu");
|
|
91
|
+
assert.match(showMenuSource, /treeEligible = !!toolCallId[\s\S]*eventTreeContextMenuAction\.hidden = !treeEligible/, "Tree should appear only for eligible tool boundaries");
|
|
92
|
+
assert.match(showMenuSource, /window\.innerWidth - rect\.width[\s\S]*window\.innerHeight - rect\.height/, "the menu should clamp inside the viewport");
|
|
93
|
+
assert.match(showMenuSource, /eventDisplayCompactAction : elements\.eventDisplayDetailedAction[\s\S]*displayAction\?\.focus/, "the selected display choice should receive focus");
|
|
94
|
+
assert.match(functionSource(app, "closeOtherContextMenusForEventTree"), /closeFileContextMenu[\s\S]*closeGitPanelContextMenu[\s\S]*closeSidePanelContextMenu[\s\S]*closeVisibilityContextMenu[\s\S]*closeGitFooterContextMenu/, "opening Tree actions should close specialized context menus");
|
|
95
|
+
assert.match(app, /eventTreeContextMenu[^\n]*addEventListener\("keydown"[\s\S]*menuitemradio[\s\S]*"Escape"[\s\S]*"ArrowDown"[\s\S]*"ArrowUp"[\s\S]*"Home"[\s\S]*"End"/, "radio choices and Tree should share standard keyboard navigation");
|
|
96
|
+
assert.match(app, /eventTreeContextMenu && !elements\.eventTreeContextMenu\.hidden[\s\S]*event\.target\?\.closest\?\.\("\.event-tree-context-menu"\)[\s\S]*closeEventTreeContextMenu\(\)/, "outside pointer interaction should dismiss the menu");
|
|
97
|
+
assert.match(app, /window\.addEventListener\("resize", \(\) => closeEventTreeContextMenu\(\)/, "resize should dismiss the menu");
|
|
98
|
+
assert.match(app, /document\.addEventListener\("scroll"[\s\S]*closeEventTreeContextMenu\(\)/, "scroll should dismiss the menu");
|
|
99
|
+
assert.match(functionSource(app, "closeEventTreeContextMenu"), /trigger\?\.isConnected[\s\S]*trigger\.focus/, "closing should restore focus to a surviving event row");
|
|
100
|
+
|
|
101
|
+
// Action-time target resolution and exact no-summary navigation.
|
|
102
|
+
const targetEntrySource = functionSource(app, "eventTreeTargetEntryId");
|
|
103
|
+
assert.match(targetEntrySource, /data\?\.eventTargets/, "the action should use the minimal eventTargets contract");
|
|
104
|
+
assert.match(targetEntrySource, /state\.phase === "start" \? target\?\.startEntryId : target\?\.finishEntryId \|\| target\?\.startEntryId/, "start and finish boundaries should select the approved IDs");
|
|
105
|
+
assert.match(targetEntrySource, /nodes\.some\(\(node\) => node\?\.id === entryId\)/, "stale IDs should be rejected against current tree nodes");
|
|
106
|
+
const navigateSource = functionSource(app, "navigateEventTreeBoundary");
|
|
107
|
+
assert.match(navigateSource, /api\("\/api\/session-tree", \{ tabId: state\.tabContext\.tabId \}\)/, "targets should resolve from current session-tree data at action time");
|
|
108
|
+
assert.match(navigateSource, /appConfirm\(\{[\s\S]*Later entries stay in the tree[\s\S]*no automatic branch summary[\s\S]*Use \/tree to navigate back[\s\S]*danger: false/, "confirmation should explain branch effects and remain non-danger styled");
|
|
109
|
+
assert.match(navigateSource, /api\("\/api\/tree-navigate", \{[\s\S]*body: \{ entryId, summarize: false \}/, "acceptance should post the exact entry ID without summarization");
|
|
110
|
+
assert.ok(navigateSource.indexOf("if (!confirmed)") < navigateSource.indexOf('api("/api/tree-navigate"'), "cancel handling should return before any navigation POST");
|
|
111
|
+
const navigationPostIndex = navigateSource.indexOf('api("/api/tree-navigate"');
|
|
112
|
+
const postResponseSource = navigateSource.slice(navigationPostIndex);
|
|
113
|
+
assert.doesNotMatch(postResponseSource, /eventTreeContextMenuState !== state/, "post-confirmation response handling should not depend on menu visibility");
|
|
114
|
+
assert.match(postResponseSource, /if \(!isCurrentTabContext\(state\.tabContext\)\) return;[\s\S]*applyResponseTab\(result\)/, "successful responses should remain guarded by the originating tab generation");
|
|
115
|
+
assert.match(postResponseSource, /applyResponseTab\(result\)[\s\S]*title: "\/tree"[\s\S]*if \(eventTreeContextMenuState === state\) closeEventTreeContextMenu\(\)[\s\S]*await refreshAll\(state\.tabContext\)/, "success should apply response metadata, show /tree feedback, conditionally close the original menu, and refresh");
|
|
116
|
+
assert.match(navigateSource, /not available in the current persisted session tree[\s\S]*session was not changed/, "missing or stale targets should fail visibly without navigation");
|
|
117
|
+
assert.match(navigateSource, /state\.busy = true[\s\S]*action\.disabled = true[\s\S]*finally[\s\S]*action\.disabled = false/, "the action should preserve busy/error controls");
|
|
118
|
+
|
|
119
|
+
assert.match(styles, /\.event-filter-bar \{[\s\S]*grid-template-columns: auto minmax\(0, 1fr\) auto/, "the filter bar should keep its label, native select, and count aligned");
|
|
120
|
+
assert.match(styles, /\.event\[hidden\] \{ display: none; \}/, "filtered event rows should remain hidden despite the row display rule");
|
|
121
|
+
assert.match(styles, /\.event-details \{[\s\S]*flex-wrap: wrap/, "bounded details should wrap in detailed mode");
|
|
122
|
+
assert.match(styles, /\.event-log\[data-display-mode="compact"\] \.event-details \{ display: none; \}/, "compact mode should hide secondary metadata");
|
|
123
|
+
assert.match(styles, /\.event-log\[data-display-mode="compact"\] \.event\[data-event-tool-phase\][\s\S]*border-left:[\s\S]*\.event\[data-event-tool-phase="finish"\][\s\S]*border-left-color/, "compact tool events should retain visible lifecycle accents");
|
|
124
|
+
assert.match(styles, /\.event-tree-context-menu \{[\s\S]*max-width: calc\(100vw - 1rem\)/, "the dedicated menu should remain viewport bounded");
|
|
125
|
+
|
|
126
|
+
// Cache tuple for this browser-asset change.
|
|
127
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v139";/, "the PWA cache identity should advance");
|
|
128
|
+
assert.match(html, /styles\.css\?v=142/, "compact-mode styles should advance the stylesheet revision");
|
|
129
|
+
assert.match(html, /data-app-src="\/app\.js\?v=172"/, "the app query revision should advance");
|
|
130
|
+
|
|
131
|
+
console.log("events-tree-context-menu-static.test.mjs passed");
|
|
@@ -47,6 +47,7 @@ const compactThinkingBubble = functionBody(app, "ensureCompactThinkingBubble");
|
|
|
47
47
|
const compactToolShell = functionBody(app, "renderCompactToolShell");
|
|
48
48
|
const clearCompactToolShells = functionBody(app, "clearCompactToolShells");
|
|
49
49
|
const compactTranscript = functionBody(app, "renderCompactTranscriptBody");
|
|
50
|
+
const thinkingDisclosurePreviewText = functionBody(app, "thinkingDisclosurePreviewText");
|
|
50
51
|
const compactThinkingDisclosureExpanded = functionBody(app, "compactThinkingDisclosureExpanded");
|
|
51
52
|
const setCompactThinkingDisclosureExpanded = functionBody(app, "setCompactThinkingDisclosureExpanded");
|
|
52
53
|
const clearCompactThinkingDisclosureState = functionBody(app, "clearCompactThinkingDisclosureState");
|
|
@@ -104,7 +105,9 @@ assert.match(appendTranscriptMessage, /compactTranscript && transcriptMessage\.r
|
|
|
104
105
|
assert.match(compactThinkingSegments, /!thinkingOutputVisible\) return \[\][\s\S]*?message\?\.role === "thinking"[\s\S]*?assistantDisplayMessages\(message\)[\s\S]*?displayMessage\.role === "thinking"/, "fast mode should collect direct and embedded assistant thinking segments only when thinking output is enabled");
|
|
105
106
|
assert.match(compactStoredTranscriptItems, /pendingThinking\.segments\.join\("\\n\\n"\)[\s\S]*?compactThinkingAggregate: true[\s\S]*?pendingThinking\.segments\.push\(\.\.\.thinkingSegments\)/, "thinking separated by tool calls should reconcile into one aggregate Markdown payload");
|
|
106
107
|
assert.match(compactStoredTranscriptItems, /message\?\.role === "user"\) flushThinking\(\)[\s\S]*?message\?\.role === "assistant"\) flushThinking\(\)/, "aggregate thinking should stay bounded to one user turn and end before its final assistant output");
|
|
107
|
-
assert.match(createMessageBubble, /compactThinkingAggregate = compactOutputActive\(\)[\s\S]*?message\.compactThinkingAggregate === true[\s\S]*?isCollapsibleOutput = compactThinkingAggregate[\s\S]*?defaultExpanded = message\.compactThinkingDefaultExpanded === true[\s\S]*?details\.open = compactThinkingDisclosureExpanded\(message\.compactThinkingKey, defaultExpanded\)[\s\S]*?setCompactThinkingDisclosureExpanded\(message\.compactThinkingKey, details\.open, defaultExpanded\)[\s\S]*?else if \(shouldOpenMessageCollapseByDefault/, "
|
|
108
|
+
assert.match(createMessageBubble, /compactThinkingAggregate = compactOutputActive\(\)[\s\S]*?message\.compactThinkingAggregate === true[\s\S]*?isCollapsibleOutput = compactThinkingAggregate[\s\S]*?defaultExpanded = message\.compactThinkingDefaultExpanded === true[\s\S]*?details\.open = compactThinkingDisclosureExpanded\(message\.compactThinkingKey, defaultExpanded\)[\s\S]*?setCompactThinkingDisclosureExpanded\(message\.compactThinkingKey, details\.open, defaultExpanded\)[\s\S]*?thinkingDisclosurePreviewText\(message\)[\s\S]*?else if \(shouldOpenMessageCollapseByDefault/, "thinking disclosures should preserve their defaults and use the cleaned preview helper");
|
|
109
|
+
assert.match(thinkingDisclosurePreviewText, /visibleThinkingText\(message\?\.thinking \|\| textFromContent\(message\?\.content\)\)[\s\S]*?speakableTextFromMarkdown\(raw\)\.slice\(0, Math\.max\(0, charLimit\)\)/, "collapsed thinking previews should strip Markdown before applying the length limit");
|
|
110
|
+
assert.match(styles, /\.thinking-disclosure > \.message-header \{[\s\S]*?display: grid;[\s\S]*?"role timestamp disclosure"[\s\S]*?"preview preview preview"[\s\S]*?\.thinking-disclosure > \.message-header::after \{ grid-area: disclosure; margin-left: 0; \}/, "collapsed thinking should keep the disclosure arrow in the top header row");
|
|
108
111
|
assert.match(compactThinkingDisclosureExpanded, /compactThinkingDisclosureStateByTab\.get\(activeTabId \|\| "default"\)[\s\S]*?disclosureState\?\.has\(key\)[\s\S]*?!!defaultExpanded/, "aggregate disclosure state should be isolated per terminal tab and fall back to the role-specific default");
|
|
109
112
|
assert.match(setCompactThinkingDisclosureExpanded, /expanded === defaultExpanded[\s\S]*?disclosureState\?\.delete\(key\)[\s\S]*?disclosureState = new Map\(\)[\s\S]*?disclosureState\.set\(key, !!expanded\)/, "aggregate disclosure state should store only explicit overrides from the role-specific default");
|
|
110
113
|
assert.match(clearCompactThinkingDisclosureState, /disclosureState\?\.delete\(key\)[\s\S]*?compactThinkingDisclosureStateByTab\.delete\(tabId\)/, "stream resets should remove a live disclosure override without changing its expanded default");
|
|
@@ -156,7 +159,7 @@ assert.match(worker, /pi-webui-pwa-v\d+[\s\S]*?"\/fast-output-live\.mjs"/, "PWA
|
|
|
156
159
|
assert.match(html, /<label for="fastOutputModeSelect">Compact mode \(Experimental\)<\/label>/, "the sidebar should mark compact mode as experimental");
|
|
157
160
|
assert.match(html, /Lightweight browser rendering; Markdown final output; live thinking expanded; stored thinking grouped and collapsed/, "the sidebar should distinguish compact rendering from model inference");
|
|
158
161
|
// Intent preserved: the guarded PWA entry point must advance whenever app wiring changes.
|
|
159
|
-
assert.match(html, /id="webuiBootLoader"[^>]*data-app-src="\/app\.js\?v=
|
|
162
|
+
assert.match(html, /id="webuiBootLoader"[^>]*data-app-src="\/app\.js\?v=172"/, "the guarded PWA entry point should cache-bust browser wiring");
|
|
160
163
|
assert.match(JSON.parse(packageRaw).scripts.check, /node --check public\/fast-output-live\.mjs/, "package checks should parse the compact helper");
|
|
161
164
|
|
|
162
165
|
const events = createFastModeOutputEvents();
|
|
@@ -166,7 +166,7 @@ assert.match(functionSource("closeTerminalTabs"), /clearFeatureDecisionStateForT
|
|
|
166
166
|
assert.match(app, /case "webui_connected":[\s\S]*clearFeatureDecisionStateForTab\(connectedTabId, \{ render: true \}\)[\s\S]*scheduleForegroundReconcile\("event stream reconnect", 0\)/, "reconnect should clear local state before authoritative replay");
|
|
167
167
|
assert.match(app, /statusKey === FEATURE_DECISION_OUTPUT_STATUS_KEY[\s\S]*handleFeatureDecisionOutputStatus[\s\S]*return;[\s\S]*statusKey === FEATURE_CATEGORY_STATUS_KEY[\s\S]*return;[\s\S]*statusEntries\.set/, "both feature statuses should be intercepted before generic footer storage while preserving category handling");
|
|
168
168
|
|
|
169
|
-
assert.match(html, /\/styles\.css\?v=
|
|
170
|
-
assert.match(html, /\/app\.js\?v=
|
|
169
|
+
assert.match(html, /\/styles\.css\?v=142/, "integrated stylesheet changes should advance the cache query");
|
|
170
|
+
assert.match(html, /\/app\.js\?v=172/, "integrated app changes should advance the cache query");
|
|
171
171
|
|
|
172
172
|
console.log("feature decision-output popup static checks passed");
|
|
@@ -62,8 +62,8 @@ assert.match(css, /\.file-viewer-image img \{[\s\S]*max-width: 100%;[\s\S]*max-h
|
|
|
62
62
|
assert.match(readme, /PNG, JPEG, GIF, WebP, and AVIF/i, "the Files panel guide should list supported image formats");
|
|
63
63
|
assert.match(technical, /supported raster images[\s\S]*2 MiB/i, "the advanced reference should document image support and its size limit");
|
|
64
64
|
assert.match(development, /kind: "image"[\s\S]*base64/i, "the contributor guide should document the image response contract");
|
|
65
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
66
|
-
assert.match(html, /styles\.css\?v=
|
|
67
|
-
assert.match(html, /app\.js\?v=
|
|
65
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v139"/, "changed viewer assets should advance the PWA cache identity");
|
|
66
|
+
assert.match(html, /styles\.css\?v=142/, "changed image styles should advance the stylesheet revision");
|
|
67
|
+
assert.match(html, /app\.js\?v=172/, "changed image rendering should advance the app revision");
|
|
68
68
|
|
|
69
69
|
console.log("file viewer image static tests passed");
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
// records with an isolated transcript fixture; dynamic/scripted messages still append.
|
|
22
22
|
// - FAKE_PI_INTERCOM_LIVE=1: accept the isolated "fixture modal transport live"
|
|
23
23
|
// prompt and emit a generic Intercom tool stream with visible unrelated output.
|
|
24
|
+
// - FAKE_PI_GUIDED_GIT_ACTIVATION=1: advertise the Guided Git extension and
|
|
25
|
+
// prompt companion, then emit its exact transient set/clear activation status.
|
|
24
26
|
import { createHash, randomUUID } from "node:crypto";
|
|
25
27
|
import { createInterface } from "node:readline";
|
|
26
28
|
import { appendFileSync } from "node:fs";
|
|
@@ -94,6 +96,9 @@ const largePayloadsEnabled = process.env.FAKE_PI_LARGE_PAYLOADS === "1";
|
|
|
94
96
|
const sseFloodEnabled = process.env.FAKE_PI_SSE_FLOOD === "1";
|
|
95
97
|
const statsPromptContextEnabled = process.env.FAKE_PI_STATS_PROMPT_CONTEXT === "1";
|
|
96
98
|
const intercomLiveEnabled = process.env.FAKE_PI_INTERCOM_LIVE === "1";
|
|
99
|
+
const guidedGitActivationEnabled = process.env.FAKE_PI_GUIDED_GIT_ACTIVATION === "1";
|
|
100
|
+
const guidedGitStateMode = String(process.env.FAKE_PI_GUIDED_GIT_STATE || "").trim();
|
|
101
|
+
const guidedGitActivationDelayMs = Math.max(0, Number.parseInt(process.env.FAKE_PI_GUIDED_GIT_ACTIVATION_DELAY_MS || "0", 10) || 0);
|
|
97
102
|
const fakeTranscriptMessages = (() => {
|
|
98
103
|
const source = process.env.FAKE_PI_TRANSCRIPT_JSON;
|
|
99
104
|
if (!source) return null;
|
|
@@ -372,6 +377,25 @@ function runIntercomLiveScript() {
|
|
|
372
377
|
]);
|
|
373
378
|
}
|
|
374
379
|
|
|
380
|
+
function handleGuidedGitActivationPrompt(command, base) {
|
|
381
|
+
if (!guidedGitActivationEnabled || !/^\/git-guided-workflow(?::\d+)?$/u.test(String(command.message || "").trim())) return false;
|
|
382
|
+
respond({ ...base, data: { output: "Guided Git WebUI activation requested" } });
|
|
383
|
+
const statusKey = "git-guided-workflow:webui-start";
|
|
384
|
+
const statusText = JSON.stringify({
|
|
385
|
+
type: "firstpick.pi-extension-git-guided-workflow.start",
|
|
386
|
+
version: 1,
|
|
387
|
+
action: "start",
|
|
388
|
+
requestId: randomUUID(),
|
|
389
|
+
});
|
|
390
|
+
const emitActivation = () => {
|
|
391
|
+
emitEvent({ type: "extension_ui_request", id: randomUUID(), method: "setStatus", statusKey, statusText });
|
|
392
|
+
emitEvent({ type: "extension_ui_request", id: randomUUID(), method: "setStatus", statusKey });
|
|
393
|
+
};
|
|
394
|
+
if (guidedGitActivationDelayMs > 0) setTimeout(emitActivation, guidedGitActivationDelayMs);
|
|
395
|
+
else emitActivation();
|
|
396
|
+
return true;
|
|
397
|
+
}
|
|
398
|
+
|
|
375
399
|
function handleIntercomLivePrompt(command, base) {
|
|
376
400
|
if (!intercomLiveEnabled || String(command.message || "").trim() !== "fixture modal transport live") return false;
|
|
377
401
|
appendDynamicMessage({ role: "user", content: String(command.message), timestamp: Date.now() });
|
|
@@ -1535,8 +1559,8 @@ rl.on("line", (line) => {
|
|
|
1535
1559
|
data: {
|
|
1536
1560
|
model: { provider: "fake", id: "fake-model" },
|
|
1537
1561
|
thinkingLevel,
|
|
1538
|
-
isStreaming: scriptedStreaming,
|
|
1539
|
-
isCompacting:
|
|
1562
|
+
isStreaming: scriptedStreaming || guidedGitStateMode === "streaming",
|
|
1563
|
+
isCompacting: guidedGitStateMode === "compacting",
|
|
1540
1564
|
steeringMode: "one-at-a-time",
|
|
1541
1565
|
followUpMode: "one-at-a-time",
|
|
1542
1566
|
sessionFile,
|
|
@@ -1544,7 +1568,7 @@ rl.on("line", (line) => {
|
|
|
1544
1568
|
sessionName: "fake",
|
|
1545
1569
|
autoCompactionEnabled: false,
|
|
1546
1570
|
messageCount: 0,
|
|
1547
|
-
pendingMessageCount: 0,
|
|
1571
|
+
pendingMessageCount: guidedGitStateMode === "pending" ? 1 : 0,
|
|
1548
1572
|
},
|
|
1549
1573
|
});
|
|
1550
1574
|
return;
|
|
@@ -1574,6 +1598,12 @@ rl.on("line", (line) => {
|
|
|
1574
1598
|
{ name: "conversation", source: "extension", description: "Natural Conversation Mode alias" },
|
|
1575
1599
|
{ name: "fast-mode", source: "extension", description: "Toggle Codex subscription Fast mode" },
|
|
1576
1600
|
{ name: "workflow", source: "extension", description: "Run and inspect JavaScript workflows" },
|
|
1601
|
+
...(guidedGitActivationEnabled ? [
|
|
1602
|
+
{ name: "git-guided-workflow", source: "extension", description: "Start Guided Git" },
|
|
1603
|
+
{ name: "git-staged-msg", source: "prompt", description: "Generate commit messages" },
|
|
1604
|
+
{ name: "git-branch-name", source: "prompt", description: "Generate branch names" },
|
|
1605
|
+
{ name: "pr", source: "prompt", description: "Generate PR text" },
|
|
1606
|
+
] : []),
|
|
1577
1607
|
...(statsPromptContextEnabled ? [{ name: "stats-webui", source: "extension", description: "Publish fixture stats dashboard" }] : []),
|
|
1578
1608
|
],
|
|
1579
1609
|
},
|
|
@@ -1597,6 +1627,7 @@ rl.on("line", (line) => {
|
|
|
1597
1627
|
return;
|
|
1598
1628
|
}
|
|
1599
1629
|
case "prompt":
|
|
1630
|
+
if (handleGuidedGitActivationPrompt(command, base)) return;
|
|
1600
1631
|
if (handleIntercomLivePrompt(command, base)) return;
|
|
1601
1632
|
if (handleFeatureDecisionFixturePrompt(command, base)) return;
|
|
1602
1633
|
if (handleStatsPromptContextFixturePrompt(command, base)) return;
|
|
@@ -4,9 +4,10 @@ import { dirname, join } from "node:path";
|
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
|
|
6
6
|
const root = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
7
|
-
const [html, app] = await Promise.all([
|
|
7
|
+
const [html, app, css] = await Promise.all([
|
|
8
8
|
readFile(join(root, "public", "index.html"), "utf8"),
|
|
9
9
|
readFile(join(root, "public", "app.js"), "utf8"),
|
|
10
|
+
readFile(join(root, "public", "styles.css"), "utf8"),
|
|
10
11
|
]);
|
|
11
12
|
|
|
12
13
|
assert.match(
|
|
@@ -55,4 +56,105 @@ assert.match(
|
|
|
55
56
|
"clicking outside should close the Git footer context menu",
|
|
56
57
|
);
|
|
57
58
|
|
|
59
|
+
assert.match(
|
|
60
|
+
html,
|
|
61
|
+
/role="menuitemcheckbox"[^>]*aria-checked="false"[^>]*data-git-footer-menu-action="toggle-advanced"[^>]*hidden>Toggle advanced<\/button>/,
|
|
62
|
+
"the advanced-layout action should be a hidden-by-default checkbox menu item",
|
|
63
|
+
);
|
|
64
|
+
assert.match(
|
|
65
|
+
app,
|
|
66
|
+
/function syncGitFooterAdvancedMenuItem\(key = gitFooterContextMenuState\?\.key\)[\s\S]*advancedButton\.hidden = key !== "model"[\s\S]*advancedButton\.textContent = footerScopedModelLayout === "advanced" \? "Toggle Simple" : "Toggle advanced"[\s\S]*advancedButton\.setAttribute\("aria-checked", footerScopedModelLayout === "advanced" \? "true" : "false"\)[\s\S]*function showGitFooterContextMenu\(event, chip, trigger\)[\s\S]*syncGitFooterAdvancedMenuItem\(key\)/,
|
|
67
|
+
"the Model-only layout action should show the destination label and expose its current checked state",
|
|
68
|
+
);
|
|
69
|
+
assert.match(
|
|
70
|
+
app,
|
|
71
|
+
/const FOOTER_SCOPED_MODEL_LAYOUT_STORAGE_KEY = "pi-webui-footer-scoped-model-layout-v1"[\s\S]*function normalizeFooterScopedModelLayout\(value\)[\s\S]*value === "advanced" \? "advanced" : "flat"[\s\S]*localStorage\.setItem\(FOOTER_SCOPED_MODEL_LAYOUT_STORAGE_KEY, next\)/,
|
|
72
|
+
"the browser-local layout preference should normalize unknown values and persist explicit flat or advanced state",
|
|
73
|
+
);
|
|
74
|
+
assert.match(
|
|
75
|
+
app,
|
|
76
|
+
/window\.addEventListener\("storage"[\s\S]*event\.key === FOOTER_SCOPED_MODEL_LAYOUT_STORAGE_KEY[\s\S]*setFooterScopedModelLayout\(event\.newValue, \{ persist: false \}\)/,
|
|
77
|
+
"same-origin Web UI tabs should adopt advanced-layout storage changes without rewriting them",
|
|
78
|
+
);
|
|
79
|
+
assert.match(
|
|
80
|
+
app,
|
|
81
|
+
/function setFooterScopedModelLayout\([\s\S]*syncGitFooterAdvancedMenuItem\(\)[\s\S]*renderFooter\(\)/,
|
|
82
|
+
"live layout adoption should refresh an open checkbox",
|
|
83
|
+
);
|
|
84
|
+
assert.match(
|
|
85
|
+
app,
|
|
86
|
+
/function footerModelPickerRenderKey\(\)[\s\S]*footerScopedModelLayout[\s\S]*orderedFooterScopedModels\(\)/,
|
|
87
|
+
"layout and scoped order should invalidate open-picker fast rendering",
|
|
88
|
+
);
|
|
89
|
+
assert.match(
|
|
90
|
+
app,
|
|
91
|
+
/function footerScopedModelProviderGroups\(models = orderedFooterScopedModels\(\)\)[\s\S]*modelsByProvider\.get\(provider\)\.push\(model\)[\s\S]*sort\(\(\[a\], \[b\]\) => compareFooterScopedModelProviders\(a, b\)\)[\s\S]*models: providerModels/,
|
|
92
|
+
"provider grouping should sort provider columns while preserving each provider's existing model order",
|
|
93
|
+
);
|
|
94
|
+
assert.match(
|
|
95
|
+
app,
|
|
96
|
+
/footer-model-provider-column[\s\S]*dataset\.footerProviderIndex = String\(providerIndex\)[\s\S]*setAttribute\("role", "group"\)[\s\S]*setAttribute\("aria-labelledby", heading\.id\)[\s\S]*renderFooterModelOption\(model, \{ advanced: true, providerIndex, modelIndex, initialKey \}\)/,
|
|
97
|
+
"advanced rendering should expose labelled provider groups and stable provider/model indices",
|
|
98
|
+
);
|
|
99
|
+
assert.match(
|
|
100
|
+
app,
|
|
101
|
+
/function footerScopedModelOrderWithProviderOrder\(provider, providerOrder\)[\s\S]*allowedKeys[\s\S]*nextProviderKeys[\s\S]*String\(model\?\.provider \|\| ""\) === provider[\s\S]*function commitFooterScopedModelProviderOrder[\s\S]*commitFooterScopedModelOrder\(nextOrder/,
|
|
102
|
+
"advanced provider reordering should replace only that provider's existing global order slots",
|
|
103
|
+
);
|
|
104
|
+
assert.match(
|
|
105
|
+
app,
|
|
106
|
+
/function handleAdvancedFooterModelKeydown\(event, model\)[\s\S]*event\.key === "Enter" \|\| event\.key === " "[\s\S]*!event\.repeat[\s\S]*applyFooterModel\(model\)[\s\S]*event\.key === "Escape"[\s\S]*setFooterModelPickerOpen\(false, \{ restoreFocus: true \}\)[\s\S]*event\.altKey[\s\S]*moveFooterScopedModelWithinProviderByOffset[\s\S]*event\.key === "ArrowUp" \|\| event\.key === "ArrowDown" \|\| event\.key === "Home" \|\| event\.key === "End"[\s\S]*event\.key === "ArrowLeft" \|\| event\.key === "ArrowRight"/,
|
|
107
|
+
"advanced options should implement provider-local reorder, apply, close/focus restoration, row, and provider keyboard contracts",
|
|
108
|
+
);
|
|
109
|
+
assert.match(
|
|
110
|
+
app,
|
|
111
|
+
/function focusAdvancedFooterModelOption\([\s\S]*scrollIntoView\(\{ block: "nearest", inline: "nearest" \}\)/,
|
|
112
|
+
"advanced navigation should reveal focused options",
|
|
113
|
+
);
|
|
114
|
+
assert.match(
|
|
115
|
+
app,
|
|
116
|
+
/function syncAdvancedFooterModelRovingTabStop\([\s\S]*option\.tabIndex = option === target \? 0 : -1[\s\S]*restoreScopedControlContinuity[\s\S]*syncAdvancedFooterModelRovingTabStop\(\)/,
|
|
117
|
+
"footer rerenders should preserve one advanced roving tab stop",
|
|
118
|
+
);
|
|
119
|
+
assert.match(
|
|
120
|
+
app,
|
|
121
|
+
/let footerModelApplyInFlight = false[\s\S]*async function applyFooterModel\(model\)[\s\S]*footerModelApplyInFlight[\s\S]*footerModelPickerOpen = false[\s\S]*renderFooter\(\)[\s\S]*await api\("\/api\/model"[\s\S]*footerModelApplyInFlight = false/,
|
|
122
|
+
"model application should close synchronously and reject duplicate in-flight activation",
|
|
123
|
+
);
|
|
124
|
+
assert.match(
|
|
125
|
+
app,
|
|
126
|
+
/Drag within provider[\s\S]*Alt\+Up\/Down reorders[\s\S]*Home\/End[\s\S]*Enter\/Space[\s\S]*help\.id = "footerModelPickerHelp"[\s\S]*setAttribute\("aria-describedby", help\.id\)/,
|
|
127
|
+
"the picker should programmatically associate complete advanced reorder and keyboard help",
|
|
128
|
+
);
|
|
129
|
+
assert.match(
|
|
130
|
+
app,
|
|
131
|
+
/if \(advanced\) \{[\s\S]*handleAdvancedFooterModelKeydown\(event, model\)[\s\S]*\} else \{[\s\S]*event\.altKey[\s\S]*moveFooterScopedModelByOffset[\s\S]*\}\s*button\.addEventListener\("pointerdown", \(event\) => beginFooterScopedModelPointerDrag/,
|
|
132
|
+
"flat and advanced options should share pointer reordering while retaining their mode-specific keyboard handlers",
|
|
133
|
+
);
|
|
134
|
+
assert.match(
|
|
135
|
+
css,
|
|
136
|
+
/body\.footer-model-picker-open \.workspace-column \{[\s\S]*z-index:\s*112;[\s\S]*body\.footer-model-picker-open \.workspace-column > \.chat-panel,[\s\S]*overflow:\s*visible;/,
|
|
137
|
+
"an open picker should escape the chat-panel clip and stack its workspace above side panels",
|
|
138
|
+
);
|
|
139
|
+
assert.match(
|
|
140
|
+
css,
|
|
141
|
+
/\.footer-model-picker-advanced \{[\s\S]*width:\s*max-content;[\s\S]*max-width:\s*calc\(100vw - 1rem\);[\s\S]*\.footer-model-picker-advanced \.footer-model-picker-source \{[\s\S]*width:\s*100%;[\s\S]*max-width:\s*none;[\s\S]*\.footer-model-provider-columns \{[\s\S]*grid-auto-flow:\s*column;[\s\S]*grid-auto-columns:\s*13rem;[\s\S]*width:\s*fit-content;[\s\S]*max-width:\s*calc\(100vw - 2\.5rem\);[\s\S]*overflow:\s*auto;/,
|
|
142
|
+
"desktop advanced layout should give help text the full picker width, grow by provider count, stop at the viewport, and scroll internally",
|
|
143
|
+
);
|
|
144
|
+
assert.match(
|
|
145
|
+
css,
|
|
146
|
+
/\.footer-model-picker-advanced \.footer-model-option\[data-footer-model-key\] \{[\s\S]*cursor:\s*grab;[\s\S]*touch-action:\s*none;[\s\S]*user-select:\s*none;/,
|
|
147
|
+
"advanced models should expose draggable styling",
|
|
148
|
+
);
|
|
149
|
+
assert.match(
|
|
150
|
+
css,
|
|
151
|
+
/\.footer-model-provider-column:focus-within[\s\S]*\.footer-model-provider-title[\s\S]*\.footer-model-picker-advanced \.footer-model-option:focus-visible/,
|
|
152
|
+
"provider headings, focused columns, and focused models should remain visible",
|
|
153
|
+
);
|
|
154
|
+
assert.match(
|
|
155
|
+
css,
|
|
156
|
+
/@media \(max-width: 720px\), \(max-device-width: 720px\), \(pointer: coarse\) and \(hover: none\)[\s\S]*\.footer-model-picker-advanced \{[\s\S]*overflow:\s*hidden;[\s\S]*\.footer-model-provider-columns \{[\s\S]*grid-auto-flow:\s*row;[\s\S]*grid-template-columns:\s*minmax\(0, 1fr\);[\s\S]*overflow-x:\s*hidden;/,
|
|
157
|
+
"narrow advanced layout should stack providers and keep horizontal overflow inside the viewport",
|
|
158
|
+
);
|
|
159
|
+
|
|
58
160
|
console.log("git-footer-context-menu-static.test.mjs passed");
|
|
@@ -69,6 +69,12 @@ try {
|
|
|
69
69
|
assert.equal(migrated.gitWorkflow.stagingPolicy, "review");
|
|
70
70
|
assert.equal(migrated.gitWorkflow.reviewProcessEnabled, true, "legacy settings should preserve the existing review-process behavior");
|
|
71
71
|
assert.equal(migrated.gitWorkflow.generation.thinkingLevel, "low");
|
|
72
|
+
assert.deepEqual(migrated.gitWorkflow.generation.fallback, {
|
|
73
|
+
provider: "",
|
|
74
|
+
modelId: "",
|
|
75
|
+
thinkingLevel: "low",
|
|
76
|
+
}, "legacy settings should keep fallback explicitly disabled");
|
|
77
|
+
assert.equal(isGitWorkflowSetupComplete({ ...migrated.gitWorkflow, generation: { provider: "fake", modelId: "fake-model", thinkingLevel: "off" } }), true, "fallback must remain optional for setup completeness");
|
|
72
78
|
assert.equal(migrated.uiLayout.version, 3);
|
|
73
79
|
assert.equal(migrated.uiLayout.sidePanel.placement, "right");
|
|
74
80
|
assert.deepEqual(migrated.uiLayout.sidePanel.sectionLayout, { order: ["files", "controls", "git"], leftSectionIds: [] });
|
|
@@ -97,7 +103,13 @@ try {
|
|
|
97
103
|
assert.equal((await readWebuiSettings(settingsFile)).outputModeDefault, "normal", "invalid persisted output modes must fail closed to normal");
|
|
98
104
|
|
|
99
105
|
const saved = await writeGitWorkflowPreferences({
|
|
100
|
-
generation: {
|
|
106
|
+
generation: {
|
|
107
|
+
provider: "fake",
|
|
108
|
+
modelId: "fake-model",
|
|
109
|
+
thinkingLevel: "off",
|
|
110
|
+
unavailablePolicy: "ask",
|
|
111
|
+
fallback: { provider: "other", modelId: "other-model", thinkingLevel: "medium" },
|
|
112
|
+
},
|
|
101
113
|
commit: { language: "de", defaultVariant: "long", scope: "required" },
|
|
102
114
|
stagingPolicy: "preserve",
|
|
103
115
|
reviewProcessEnabled: false,
|
|
@@ -122,6 +134,17 @@ try {
|
|
|
122
134
|
|
|
123
135
|
const partiallyUpdated = await writeGitWorkflowPreferences({ deliveryMode: "current" }, settingsFile);
|
|
124
136
|
assert.equal(partiallyUpdated.generation.modelId, "fake-model", "partial updates should preserve the selected model");
|
|
137
|
+
assert.deepEqual(partiallyUpdated.generation.fallback, {
|
|
138
|
+
provider: "other",
|
|
139
|
+
modelId: "other-model",
|
|
140
|
+
thinkingLevel: "medium",
|
|
141
|
+
}, "unrelated partial updates should preserve the configured fallback");
|
|
142
|
+
const fallbackEffortOnly = await writeGitWorkflowPreferences({ generation: { fallback: { thinkingLevel: "high" } } }, settingsFile);
|
|
143
|
+
assert.deepEqual(fallbackEffortOnly.generation.fallback, {
|
|
144
|
+
provider: "other",
|
|
145
|
+
modelId: "other-model",
|
|
146
|
+
thinkingLevel: "high",
|
|
147
|
+
}, "nested fallback patches should preserve the selected fallback model");
|
|
125
148
|
assert.equal(partiallyUpdated.commit.language, "de", "partial updates should preserve nested commit preferences");
|
|
126
149
|
assert.equal(partiallyUpdated.deliveryMode, "current");
|
|
127
150
|
assert.equal(partiallyUpdated.reviewProcessEnabled, false, "partial updates should preserve the review-process choice");
|
|
@@ -135,12 +158,18 @@ try {
|
|
|
135
158
|
assert.equal(persisted.remoteAuthEnabled, true);
|
|
136
159
|
assert.equal(persisted.outputModeDefault, "compact-v1", "output-mode default should persist beside existing Web UI settings");
|
|
137
160
|
assert.equal(persisted.gitWorkflow.generation.provider, "fake");
|
|
161
|
+
assert.deepEqual(persisted.gitWorkflow.generation.fallback, {
|
|
162
|
+
provider: "other",
|
|
163
|
+
modelId: "other-model",
|
|
164
|
+
thinkingLevel: "high",
|
|
165
|
+
});
|
|
138
166
|
assert.deepEqual(persisted.resourceDefaults.tools.enabledTools, ["read", "write"], "global tool defaults should be normalized and deduplicated");
|
|
139
167
|
assert.deepEqual(persisted.resourceDefaults.skills.enabledSkills, ["repo-explorer", "code-security"], "global skill defaults should persist beside other Web UI settings");
|
|
140
168
|
assert.equal(persisted.interfacePreferences.sidePanelWidth, 612, "the user-scoped Control Deck width should persist beside other Web UI settings");
|
|
141
169
|
assert.equal((await readWebuiSettings(settingsFile)).interfacePreferences.sidePanelWidth, 612);
|
|
142
170
|
const summary = gitWorkflowPreferencesSummary(await readGitWorkflowPreferences(settingsFile));
|
|
143
171
|
assert.match(summary, /fake\/fake-model/);
|
|
172
|
+
assert.match(summary, /Fallback: other\/other-model · high/);
|
|
144
173
|
assert.match(summary, /Review process: disabled/);
|
|
145
174
|
if (process.platform !== "win32") assert.equal((await stat(settingsFile)).mode & 0o777, 0o600);
|
|
146
175
|
|