@firstpick/pi-package-webui 0.10.4 → 0.10.5
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
CHANGED
|
@@ -239,7 +239,7 @@ npx playwright test --project=chromium tests/browser/subagent-observability.spec
|
|
|
239
239
|
|
|
240
240
|
The footer picker keeps presentation state browser-local under `pi-webui-footer-scoped-model-layout-v1`; only normalized `flat` and `advanced` values are accepted. Storage events adopt the value across same-origin tabs without a settings write. The context-menu checkbox names the destination layout: **Toggle advanced** in flat mode and **Toggle Simple** in advanced mode. Advanced rendering groups `orderedFooterScopedModels()` by provider, sorts only the provider groups, and retains the existing order inside every group. Provider containers are labelled ARIA groups, and option buttons carry stable provider/model indices for clamped directional focus movement.
|
|
241
241
|
|
|
242
|
-
Advanced options use a roving tab stop. Arrow, `Home`, and `End` keys move focus only; `Enter` and `Space` call the existing model-selection path, while `Escape` closes and restores the footer trigger. Pointer drag and `Alt+ArrowUp` / `Alt+ArrowDown` listeners remain in the flat branch only. The desktop picker uses intrinsic provider-column width, temporarily escapes the chat-panel clip, and raises the workspace stacking context above side panels. Its width is capped to a viewport gutter and the provider row becomes internally scrollable at that cap. Narrow-screen groups stack vertically, so neither layout creates page-level horizontal overflow.
|
|
242
|
+
Advanced options use a roving tab stop. Arrow, `Home`, and `End` keys move focus only; `Enter` and `Space` call the existing model-selection path, while `Escape` closes and restores the footer trigger. Pointer drag and `Alt+ArrowUp` / `Alt+ArrowDown` listeners remain in the flat branch only. The desktop picker uses intrinsic provider-column width, temporarily escapes the chat-panel clip, and raises the workspace stacking context above side panels. Keyboard help uses inline-size containment so it wraps to the picker width without its full sentence widening the popup. Its width is capped to a viewport gutter and the provider row becomes internally scrollable at that cap. Narrow-screen groups stack vertically, so neither layout creates page-level horizontal overflow.
|
|
243
243
|
|
|
244
244
|
Focused validation:
|
|
245
245
|
|
|
@@ -249,7 +249,7 @@ node --check public/app.js
|
|
|
249
249
|
npx playwright test tests/browser/footer-model-advanced-layout.spec.mjs --project=chromium
|
|
250
250
|
```
|
|
251
251
|
|
|
252
|
-
The static contract covers Model-only menu visibility, normalized persistence and storage adoption, grouping, semantics, keyboard behavior, flat reorder isolation, bounded side-panel overlay stacking, and responsive CSS hooks. The Chromium fixtures cover toggle synchronization/reload, group and model order, directional focus, model application, `Escape` focus restoration, flat `Alt+Arrow` and pointer selection, narrow-viewport overflow, and a ten-provider case that verifies viewport capping, side-panel overlap, paint order, and horizontal scrolling.
|
|
252
|
+
The static contract covers Model-only menu visibility, normalized persistence and storage adoption, grouping, semantics, keyboard behavior, flat reorder isolation, bounded side-panel overlay stacking, and responsive CSS hooks. The Chromium fixtures cover toggle synchronization/reload, group and model order, directional focus, model application, `Escape` focus restoration, flat `Alt+Arrow` and pointer selection, narrow-viewport overflow, intrinsic sizing with one, three, and six providers, and a ten-provider case that verifies viewport capping, side-panel overlap, paint order, and horizontal scrolling.
|
|
253
253
|
|
|
254
254
|
## Control Deck side-panel architecture
|
|
255
255
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firstpick/pi-package-webui",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.5",
|
|
4
4
|
"description": "Pi Web UI companion package with a local browser UI CLI plus /webui-start and /webui-status commands.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/Firstp1ck/pi-coding-agent-forge/tree/main/pi-package-webui#readme",
|
package/public/index.html
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<link rel="manifest" href="/manifest.webmanifest" />
|
|
13
13
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
14
14
|
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
|
15
|
-
<link rel="stylesheet" href="/styles.css?v=
|
|
15
|
+
<link rel="stylesheet" href="/styles.css?v=153" />
|
|
16
16
|
<script>
|
|
17
17
|
// Public-only issue-bot runtime configuration. Keep disabled unless the gateway,
|
|
18
18
|
// Turnstile site key, exact CORS origin, and private-report destination are approved.
|
package/public/styles.css
CHANGED
|
@@ -6175,6 +6175,8 @@ body.footer-model-picker-open .statusbar {
|
|
|
6175
6175
|
overflow: hidden;
|
|
6176
6176
|
}
|
|
6177
6177
|
.footer-model-picker-advanced .footer-model-picker-source {
|
|
6178
|
+
/* Let provider columns set the picker width, not the keyboard-help sentence. */
|
|
6179
|
+
contain: inline-size;
|
|
6178
6180
|
width: 100%;
|
|
6179
6181
|
max-width: none;
|
|
6180
6182
|
}
|
|
@@ -193,6 +193,43 @@ test.afterAll(async () => {
|
|
|
193
193
|
await rm(tempRoot, { recursive: true, force: true });
|
|
194
194
|
});
|
|
195
195
|
|
|
196
|
+
for (const providerCount of [1, 3, 6]) {
|
|
197
|
+
test(`${providerCount} provider columns determine desktop picker width instead of keyboard help`, async ({ page }) => {
|
|
198
|
+
await page.setViewportSize({ width: 1440, height: 900 });
|
|
199
|
+
await installFixture(page, manyProviderModels.slice(0, providerCount));
|
|
200
|
+
await preparePage(page);
|
|
201
|
+
const menu = await openModelMenu(page);
|
|
202
|
+
await menu.toggle.click();
|
|
203
|
+
const picker = await openPicker(page, /footer-model-picker-advanced/, providerCount);
|
|
204
|
+
const geometry = await picker.evaluate((node) => {
|
|
205
|
+
const rect = node.getBoundingClientRect();
|
|
206
|
+
const style = getComputedStyle(node);
|
|
207
|
+
const columns = node.querySelector(".footer-model-provider-columns");
|
|
208
|
+
const help = node.querySelector("#footerModelPickerHelp");
|
|
209
|
+
return {
|
|
210
|
+
width: rect.width,
|
|
211
|
+
contentWidth: node.clientWidth - parseFloat(style.paddingLeft) - parseFloat(style.paddingRight),
|
|
212
|
+
columnsWidth: columns.getBoundingClientRect().width,
|
|
213
|
+
helpWidth: help.getBoundingClientRect().width,
|
|
214
|
+
helpHeight: help.getBoundingClientRect().height,
|
|
215
|
+
helpLineHeight: parseFloat(getComputedStyle(help).lineHeight),
|
|
216
|
+
helpClientWidth: help.clientWidth,
|
|
217
|
+
helpScrollWidth: help.scrollWidth,
|
|
218
|
+
left: rect.left,
|
|
219
|
+
right: rect.right,
|
|
220
|
+
viewportWidth: window.innerWidth,
|
|
221
|
+
};
|
|
222
|
+
});
|
|
223
|
+
assert.ok(geometry.contentWidth - geometry.columnsWidth < 60, `picker should hug its provider columns: ${JSON.stringify(geometry)}`);
|
|
224
|
+
assert.ok(Math.abs(geometry.helpWidth - geometry.contentWidth) <= 1, `help should use the resulting content width: ${JSON.stringify(geometry)}`);
|
|
225
|
+
if (providerCount <= 3) {
|
|
226
|
+
assert.ok(geometry.helpHeight > geometry.helpLineHeight, `help should wrap instead of widening the picker: ${JSON.stringify(geometry)}`);
|
|
227
|
+
}
|
|
228
|
+
assert.equal(geometry.helpScrollWidth, geometry.helpClientWidth, "wrapped help should not overflow horizontally");
|
|
229
|
+
assert.ok(geometry.left >= 7 && geometry.right <= geometry.viewportWidth - 7, `picker should remain within viewport gutters: ${JSON.stringify(geometry)}`);
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
|
|
196
233
|
test("many provider columns grow over side panels, stop at the viewport, and scroll internally", async ({ page }) => {
|
|
197
234
|
await page.setViewportSize({ width: 1440, height: 900 });
|
|
198
235
|
await installFixture(page, manyProviderModels);
|
|
@@ -138,7 +138,7 @@ assert.match(
|
|
|
138
138
|
);
|
|
139
139
|
assert.match(
|
|
140
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;/,
|
|
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]*contain:\s*inline-size;[\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
142
|
"desktop advanced layout should give help text the full picker width, grow by provider count, stop at the viewport, and scroll internally",
|
|
143
143
|
);
|
|
144
144
|
assert.match(
|