@firstpick/pi-package-webui 0.9.9 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/DEVELOPMENT.md +49 -15
  2. package/README.md +11 -9
  3. package/TECHNICAL.md +12 -8
  4. package/bin/pi-webui.mjs +202 -67
  5. package/index.ts +23 -33
  6. package/lib/git-workflow-preferences.mjs +51 -12
  7. package/lib/tui-model-profile-selector.mjs +183 -0
  8. package/lib/tui-resource-selector.mjs +173 -0
  9. package/package.json +1 -1
  10. package/public/app.js +365 -106
  11. package/public/index.html +10 -7
  12. package/public/service-worker.js +1 -1
  13. package/public/styles.css +114 -22
  14. package/tests/boot-failure-diagnostics.test.mjs +3 -3
  15. package/tests/browser/interaction-continuity.spec.mjs +9 -3
  16. package/tests/browser/intercom-conversation-viewer.spec.mjs +76 -53
  17. package/tests/browser/user-noticeable-fixes.spec.mjs +51 -0
  18. package/tests/codex-fast-mode-static.test.mjs +2 -2
  19. package/tests/composer-action-grid-reorder-static.test.mjs +3 -3
  20. package/tests/control-visibility-static.test.mjs +3 -3
  21. package/tests/controls-layout-static.test.mjs +3 -3
  22. package/tests/durable-rpc-supervisor-harness.test.mjs +9 -0
  23. package/tests/events-tree-context-menu-static.test.mjs +3 -3
  24. package/tests/fast-mode-client-static.test.mjs +1 -1
  25. package/tests/feature-decision-output-popup-static.test.mjs +2 -2
  26. package/tests/file-viewer-image-static.test.mjs +3 -3
  27. package/tests/fixtures/fake-pi.mjs +3 -3
  28. package/tests/guided-git-activation-static.test.mjs +24 -12
  29. package/tests/guided-git-fallback-runtime.test.mjs +209 -270
  30. package/tests/guided-git-fallback-ui-static.test.mjs +2 -2
  31. package/tests/guided-git-message-reliability-static.test.mjs +2 -1
  32. package/tests/guided-git-optional-feature.test.mjs +8 -5
  33. package/tests/guided-git-publication-backend-static.test.mjs +10 -5
  34. package/tests/http-endpoints-harness.test.mjs +27 -13
  35. package/tests/intercom-conversation-viewer-static.test.mjs +7 -6
  36. package/tests/intercom-tag-layout-static.test.mjs +35 -16
  37. package/tests/intercom-tag-overflow-layout.test.mjs +87 -0
  38. package/tests/main-output-loading-static.test.mjs +18 -12
  39. package/tests/middle-button-drag-scroll-static.test.mjs +3 -3
  40. package/tests/mobile-continuity-tablet-static.test.mjs +3 -3
  41. package/tests/mobile-foundation-static.test.mjs +3 -3
  42. package/tests/mobile-phone-experience-static.test.mjs +1 -1
  43. package/tests/mobile-static.test.mjs +19 -11
  44. package/tests/open-issue-wizard-static.test.mjs +1 -1
  45. package/tests/optional-feature-prompt-impact-static.test.mjs +67 -0
  46. package/tests/persistent-ui-layout-static.test.mjs +3 -3
  47. package/tests/prompt-input-vertical-scroll-static.test.mjs +3 -3
  48. package/tests/questionnaire-dialog.test.mjs +3 -3
  49. package/tests/remote-auth-settings-harness.test.mjs +18 -3
  50. package/tests/resource-tui-extension.test.mjs +2 -1
  51. package/tests/session-sampling-ui-static.test.mjs +3 -3
  52. package/tests/side-panel-section-height-removal-static.test.mjs +3 -3
  53. package/tests/streaming-ui-coupling.test.mjs +2 -0
  54. package/tests/subagent-observability-static.test.mjs +2 -2
  55. package/tests/syntax-highlighting-static.test.mjs +3 -3
  56. package/tests/theme-customizer-static.test.mjs +1 -1
  57. package/tests/tui-model-profile-selector.test.mjs +102 -0
  58. package/tests/tui-resource-selector.test.mjs +74 -0
  59. package/tests/webui-settings-locking.test.mjs +32 -1
  60. package/tests/windows-drive-cwd-picker-static.test.mjs +3 -3
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=143" />
15
+ <link rel="stylesheet" href="/styles.css?v=152" />
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.
@@ -297,10 +297,6 @@
297
297
  <button id="chatSearchCloseButton" class="chat-search-button" type="button" aria-label="Close search" title="Close (Escape)">✕</button>
298
298
  </div>
299
299
  <div class="main-output-surface">
300
- <div id="mainOutputLoading" class="main-output-loading" role="status" aria-live="polite" aria-atomic="true" aria-controls="chat" hidden>
301
- <span class="main-output-loading-spinner" aria-hidden="true"></span>
302
- <span>Loading agent output…</span>
303
- </div>
304
300
  <div id="chat" class="chat" aria-live="polite" aria-busy="false">
305
301
  <button id="stickyUserPromptButton" class="sticky-user-prompt-button" type="button" aria-controls="chat" hidden></button>
306
302
  </div>
@@ -311,7 +307,13 @@
311
307
  <span id="feedbackTraySummary">No action feedback queued.</span>
312
308
  <button id="sendFeedbackButton" type="button">Send &amp; create LEARNING</button>
313
309
  </div>
314
- <div id="statusBar" class="statusbar" aria-live="polite"></div>
310
+ <div class="footer-status-host">
311
+ <div id="mainOutputLoading" class="main-output-loading" role="status" aria-live="polite" aria-atomic="true" aria-controls="chat" hidden>
312
+ <span class="main-output-loading-spinner" aria-hidden="true"></span>
313
+ <span id="mainOutputLoadingLabel">Loading conversation history…</span>
314
+ </div>
315
+ <div id="statusBar" class="statusbar" aria-live="polite"></div>
316
+ </div>
315
317
  <section id="contextMeterBar" class="context-meter-bar" aria-live="polite"></section>
316
318
  <section id="gitWorkflowPanel" class="git-workflow-panel" aria-live="polite" hidden>
317
319
  <div class="git-workflow-header">
@@ -1455,6 +1457,7 @@
1455
1457
  <h2 id="textPromptTitle">Enter a value</h2>
1456
1458
  <p id="textPromptSummary" class="muted"></p>
1457
1459
  <input id="textPromptInput" class="dialog-input" type="text" autocomplete="off" spellcheck="false" aria-labelledby="textPromptTitle" />
1460
+ <select id="textPromptSelect" class="dialog-input" aria-labelledby="textPromptTitle" hidden></select>
1458
1461
  <p id="textPromptError" class="path-picker-error" hidden></p>
1459
1462
  <menu>
1460
1463
  <button id="textPromptCancelButton" type="button">Cancel</button>
@@ -1889,7 +1892,7 @@
1889
1892
  </form>
1890
1893
  </dialog>
1891
1894
 
1892
- <script id="webuiBootLoader" data-app-src="/app.js?v=175">
1895
+ <script id="webuiBootLoader" data-app-src="/app.js?v=182">
1893
1896
  (() => {
1894
1897
  "use strict";
1895
1898
 
@@ -1,4 +1,4 @@
1
- const CACHE_NAME = "pi-webui-pwa-v142";
1
+ const CACHE_NAME = "pi-webui-pwa-v153";
2
2
  const APP_SHELL = [
3
3
  "/",
4
4
  "/index.html",
package/public/styles.css CHANGED
@@ -4478,6 +4478,36 @@ button.subagent-gate-attempt:focus-visible {
4478
4478
  background: linear-gradient(90deg, var(--ctp-green), var(--ctp-yellow), var(--ctp-peach));
4479
4479
  box-shadow: 0 0 0.85rem rgba(148, 226, 213, 0.20);
4480
4480
  }
4481
+ .optional-feature-prompt-impact {
4482
+ display: inline-grid;
4483
+ place-items: center;
4484
+ box-sizing: border-box;
4485
+ flex: 0 0 auto;
4486
+ width: 2.8rem;
4487
+ min-width: 2.8rem;
4488
+ min-height: 1.15rem;
4489
+ padding: 0.08rem 0.2rem;
4490
+ border: 1px solid rgba(180, 190, 254, 0.2);
4491
+ border-radius: 0.42rem;
4492
+ color: var(--ctp-subtext);
4493
+ background: rgba(var(--ctp-surface-rgb), 0.48);
4494
+ font-family: var(--font-mono);
4495
+ font-size: var(--text-xs);
4496
+ font-weight: 900;
4497
+ line-height: 1;
4498
+ }
4499
+ .optional-feature-prompt-impact.initial {
4500
+ color: var(--ctp-peach);
4501
+ border-color: rgba(250, 179, 135, 0.34);
4502
+ }
4503
+ .optional-feature-prompt-impact.conditional {
4504
+ color: var(--ctp-yellow);
4505
+ border-color: rgba(249, 226, 175, 0.34);
4506
+ }
4507
+ .optional-feature-prompt-impact.none {
4508
+ color: var(--ctp-green);
4509
+ border-color: rgba(166, 227, 161, 0.28);
4510
+ }
4481
4511
  .optional-feature-row {
4482
4512
  position: relative;
4483
4513
  display: grid;
@@ -4578,17 +4608,25 @@ button.subagent-gate-attempt:focus-visible {
4578
4608
  .optional-feature-title {
4579
4609
  display: flex;
4580
4610
  flex-direction: column;
4581
- gap: 0.28rem;
4582
4611
  align-items: flex-start;
4612
+ gap: 0.28rem;
4583
4613
  min-width: 0;
4584
4614
  }
4585
4615
  .optional-feature-title strong {
4586
4616
  color: rgba(var(--ctp-text-rgb), 0.94);
4587
4617
  font-size: 0.82rem;
4588
4618
  }
4619
+ .optional-feature-status-tags {
4620
+ display: inline-flex;
4621
+ flex-wrap: wrap;
4622
+ align-items: center;
4623
+ gap: 0.34rem;
4624
+ }
4589
4625
  .optional-feature-pill {
4590
4626
  display: inline-flex;
4627
+ flex: 0 0 auto;
4591
4628
  align-items: center;
4629
+ justify-content: center;
4592
4630
  min-height: 1.15rem;
4593
4631
  padding: 0.12rem 0.42rem;
4594
4632
  border-radius: 999px;
@@ -4954,8 +4992,11 @@ button.subagent-gate-attempt:focus-visible {
4954
4992
  padding-top: 0.38rem;
4955
4993
  min-width: 0;
4956
4994
  max-width: 100%;
4957
- max-height: none;
4958
- overflow: visible;
4995
+ max-height: min(32rem, calc(var(--visual-viewport-height, 100dvh) - 6rem));
4996
+ overflow-x: hidden;
4997
+ overflow-y: auto;
4998
+ overscroll-behavior: contain;
4999
+ scrollbar-gutter: stable;
4959
5000
  }
4960
5001
  .terminal-tab-group:hover .terminal-tab-group-menu,
4961
5002
  .terminal-tab-group:focus-within .terminal-tab-group-menu,
@@ -5568,7 +5609,7 @@ button.subagent-gate-attempt:focus-visible {
5568
5609
  body.terminal-tabs-left .main-output-surface,
5569
5610
  body.terminal-tabs-left .run-indicator-host,
5570
5611
  body.terminal-tabs-left .feedback-tray,
5571
- body.terminal-tabs-left .statusbar,
5612
+ body.terminal-tabs-left .footer-status-host,
5572
5613
  body.terminal-tabs-left .context-meter-bar,
5573
5614
  body.terminal-tabs-left .git-workflow-panel,
5574
5615
  body.terminal-tabs-left .composer,
@@ -5582,10 +5623,9 @@ button.subagent-gate-attempt:focus-visible {
5582
5623
  body.terminal-tabs-left .subagent-terminal-view { grid-row: 1 / -1; }
5583
5624
  body.terminal-tabs-left .chat-search-bar { grid-row: 3; }
5584
5625
  body.terminal-tabs-left .main-output-surface { grid-row: 4; }
5585
- body.terminal-tabs-left .main-output-loading { top: 0.75rem; }
5586
5626
  body.terminal-tabs-left .run-indicator-host { grid-row: 5; }
5587
5627
  body.terminal-tabs-left .feedback-tray { grid-row: 6; }
5588
- body.terminal-tabs-left .statusbar { grid-row: 7; }
5628
+ body.terminal-tabs-left .footer-status-host { grid-row: 7; }
5589
5629
  body.terminal-tabs-left .context-meter-bar { grid-row: 8; }
5590
5630
  body.terminal-tabs-left .git-workflow-panel { grid-row: 9; }
5591
5631
  body.terminal-tabs-left .composer,
@@ -5619,7 +5659,7 @@ button.subagent-gate-attempt:focus-visible {
5619
5659
  body.terminal-tabs-left.terminal-tabs-sidebar-start .main-output-surface,
5620
5660
  body.terminal-tabs-left.terminal-tabs-sidebar-start .run-indicator-host,
5621
5661
  body.terminal-tabs-left.terminal-tabs-sidebar-start .feedback-tray,
5622
- body.terminal-tabs-left.terminal-tabs-sidebar-start .statusbar,
5662
+ body.terminal-tabs-left.terminal-tabs-sidebar-start .footer-status-host,
5623
5663
  body.terminal-tabs-left.terminal-tabs-sidebar-start .context-meter-bar,
5624
5664
  body.terminal-tabs-left.terminal-tabs-sidebar-start .git-workflow-panel,
5625
5665
  body.terminal-tabs-left.terminal-tabs-sidebar-start .composer,
@@ -8305,16 +8345,22 @@ button.git-workflow-step:hover:not(:disabled) {
8305
8345
  padding: 1rem;
8306
8346
  scroll-behavior: smooth;
8307
8347
  }
8348
+ .footer-status-host {
8349
+ position: relative;
8350
+ flex: 0 0 auto;
8351
+ min-width: 0;
8352
+ }
8308
8353
  .main-output-loading[hidden] { display: none !important; }
8309
8354
  .main-output-loading {
8310
8355
  position: absolute;
8311
8356
  z-index: 13;
8312
- top: 0.55rem;
8313
8357
  left: 50%;
8358
+ bottom: calc(100% + 0.3rem);
8314
8359
  display: inline-flex;
8315
8360
  align-items: center;
8316
8361
  gap: 0.48rem;
8317
- max-width: calc(100% - 1.2rem);
8362
+ width: max-content;
8363
+ max-width: calc(100% - 2rem);
8318
8364
  margin: 0;
8319
8365
  transform: translateX(-50%);
8320
8366
  padding: 0.42rem 0.7rem;
@@ -9681,30 +9727,30 @@ summary { cursor: pointer; color: var(--warning); }
9681
9727
  display: none !important;
9682
9728
  }
9683
9729
  .composer-intercom-tags {
9730
+ position: relative;
9684
9731
  pointer-events: auto;
9685
- display: grid;
9686
- grid-auto-flow: column;
9687
- grid-auto-columns: minmax(0, 1fr);
9688
- flex: 0 1 17rem;
9732
+ display: inline-flex;
9733
+ flex: 0 1 50%;
9734
+ flex-direction: row-reverse;
9689
9735
  align-items: center;
9690
9736
  gap: 0.28rem;
9691
9737
  min-width: 0;
9692
- max-width: min(17rem, 100%);
9738
+ max-width: 50%;
9693
9739
  padding-block: 0.12rem;
9740
+ overflow: hidden;
9694
9741
  }
9695
- .composer-intercom-tags[hidden] { display: none !important; }
9696
- .composer-intercom-tags.dense {
9697
- grid-auto-flow: row;
9698
- grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
9699
- align-items: stretch;
9742
+ .composer-intercom-tags.overflow-open {
9743
+ overflow: visible;
9700
9744
  }
9745
+ .composer-intercom-tags[hidden] { display: none !important; }
9701
9746
  .composer-intercom-tag {
9702
9747
  display: inline-flex;
9748
+ flex: 0 0 auto;
9703
9749
  align-items: center;
9704
9750
  gap: 0.34rem;
9705
- width: 100%;
9751
+ width: auto;
9706
9752
  min-width: 0;
9707
- max-width: 100%;
9753
+ max-width: min(13rem, 100%);
9708
9754
  min-height: 0;
9709
9755
  margin: 0;
9710
9756
  padding: 0.14rem 0.5rem;
@@ -9751,9 +9797,53 @@ summary { cursor: pointer; color: var(--warning); }
9751
9797
  line-height: 1.1;
9752
9798
  text-align: center;
9753
9799
  }
9800
+ .composer-intercom-tag.overflow {
9801
+ color: var(--ctp-subtext0);
9802
+ font-variant-numeric: tabular-nums;
9803
+ border-color: rgba(166, 173, 200, 0.30);
9804
+ background: linear-gradient(120deg, rgba(166, 173, 200, 0.22), rgba(166, 173, 200, 0.08)), var(--ctp-crust);
9805
+ }
9806
+ .composer-intercom-tag.overflow[aria-expanded="true"] {
9807
+ color: var(--ctp-green);
9808
+ border-color: rgba(166, 227, 161, 0.78);
9809
+ box-shadow: 0 0.42rem 1rem rgba(var(--ctp-crust-rgb), 0.48), 0 0 1.1rem rgba(166, 227, 161, 0.3);
9810
+ }
9811
+ .composer-intercom-overflow-menu {
9812
+ position: absolute;
9813
+ right: 0;
9814
+ bottom: calc(100% + 0.42rem);
9815
+ z-index: 150;
9816
+ display: grid;
9817
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
9818
+ gap: 0.34rem;
9819
+ box-sizing: border-box;
9820
+ width: min(32rem, calc(100vw - 1.5rem));
9821
+ max-height: min(42vh, 18rem);
9822
+ padding: 0.46rem;
9823
+ overflow-y: auto;
9824
+ overscroll-behavior: contain;
9825
+ pointer-events: auto;
9826
+ border: 1px solid rgba(166, 227, 161, 0.36);
9827
+ border-radius: 0.9rem;
9828
+ background: var(--ctp-crust);
9829
+ box-shadow: 0 0.9rem 2.2rem rgba(var(--ctp-crust-rgb), 0.72), 0 0 1rem rgba(166, 227, 161, 0.18), inset 0 1px 0 rgba(255,255,255,0.05);
9830
+ }
9831
+ .composer-intercom-overflow-menu[hidden] {
9832
+ display: none !important;
9833
+ }
9834
+ .composer-intercom-overflow-menu .composer-intercom-tag {
9835
+ width: 100%;
9836
+ max-width: none;
9837
+ min-height: 2rem;
9838
+ }
9754
9839
  @media (max-width: 720px), (max-device-width: 720px), (pointer: coarse) and (hover: none) {
9755
- .composer-intercom-tags { flex: 1 1 100%; min-width: 0; max-width: 100%; }
9840
+ .composer-intercom-tags { flex: 0 0 100%; width: 100%; min-width: 0; max-width: 100%; }
9756
9841
  .composer-intercom-tag { min-height: 44px; }
9842
+ .composer-intercom-overflow-menu {
9843
+ width: min(32rem, calc(100vw - 1rem));
9844
+ max-height: min(50vh, 20rem);
9845
+ }
9846
+ .composer-intercom-overflow-menu .composer-intercom-tag { min-height: 44px; }
9757
9847
  }
9758
9848
  .composer-feature-category-tag {
9759
9849
  flex: 0 1 auto;
@@ -13028,6 +13118,7 @@ body:not(.mobile-keyboard-open) .composer-input-row:has(.composer-workflow-mode-
13028
13118
  body.subagent-terminal-active .workspace-dashboard,
13029
13119
  body.subagent-terminal-active .widget-area,
13030
13120
  body.subagent-terminal-active .main-output-surface,
13121
+ body.subagent-terminal-active .main-output-loading,
13031
13122
  body.subagent-terminal-active .feedback-tray,
13032
13123
  body.subagent-terminal-active .jump-to-latest-button,
13033
13124
  body.subagent-terminal-active .statusbar,
@@ -19294,6 +19385,7 @@ body:has(#undoToast:not([hidden])) .notice-toast-stack { bottom: calc(max(1rem,
19294
19385
  }
19295
19386
  body.mobile-composer-disclosure .composer-actions-panel > .composer-context-tags {
19296
19387
  display: flex;
19388
+ flex-wrap: wrap;
19297
19389
  min-height: 44px;
19298
19390
  padding: 0.3rem;
19299
19391
  overflow: visible;
@@ -65,7 +65,7 @@ function makeEnvironment({
65
65
  reload: new FakeElement(),
66
66
  copyStatus: new FakeElement(),
67
67
  };
68
- const styleLink = new FakeElement({ href: "http://127.0.0.1:31415/styles.css?v=143", sheet: stylesheetLoaded ? {} : null });
68
+ const styleLink = new FakeElement({ href: "http://127.0.0.1:31415/styles.css?v=152", sheet: stylesheetLoaded ? {} : null });
69
69
  const listeners = new Map();
70
70
  const timers = new Map();
71
71
  let timerId = 0;
@@ -84,7 +84,7 @@ function makeEnvironment({
84
84
  removeEventListener(name) { listeners.delete(name); },
85
85
  };
86
86
  const document = {
87
- currentScript: new FakeElement({ dataset: { appSrc: "/app.js?v=175" } }),
87
+ currentScript: new FakeElement({ dataset: { appSrc: "/app.js?v=182" } }),
88
88
  readyState: "complete",
89
89
  querySelector(selector) {
90
90
  return {
@@ -232,7 +232,7 @@ for (const moduleName of startupModuleNames) {
232
232
  assert.ok(serviceWorker.includes(`"/${moduleName}"`), `the PWA app shell should include every app.js startup module: ${moduleName}`);
233
233
  }
234
234
  assert.match(serviceWorker, /pi-webui-pwa-v\d+/, "the app-shell cache should retain a versioned identity");
235
- assert.ok(html.indexOf('id="webuiBootLoader"') < html.indexOf("/app.js?v=175"), "the inline loader should own app module startup");
235
+ assert.ok(html.indexOf('id="webuiBootLoader"') < html.indexOf("/app.js?v=182"), "the inline loader should own app module startup");
236
236
  assert.doesNotMatch(html, /<script type="module" src="\/app\.js/, "the app module should not bypass the guarded loader");
237
237
 
238
238
  console.log("boot-failure-diagnostics.test.mjs passed");
@@ -229,19 +229,25 @@ test("main output shows non-blocking inline feedback while transcript data loads
229
229
  const loading = page.locator("#mainOutputLoading");
230
230
  const chat = page.locator("#chat");
231
231
  await expect(loading).toBeVisible();
232
- await expect(loading).toContainText("Loading agent output…");
232
+ await expect(loading).toContainText("Loading conversation history…");
233
233
  await expect(loading).toHaveCSS("pointer-events", "none");
234
234
  await expect(chat).toHaveAttribute("aria-busy", "true");
235
235
  await expect(page.locator("#promptInput")).toBeEnabled();
236
236
  assert.equal(await page.evaluate(() => document.querySelectorAll("dialog:modal").length), 0, "loading feedback should not open a popup");
237
237
  const loadingChatBounds = await chat.boundingBox();
238
- assert.ok(loadingChatBounds, "the transcript should have measurable bounds while loading");
238
+ const loadingBounds = await loading.boundingBox();
239
+ const footerBounds = await page.locator("#statusBar").boundingBox();
240
+ assert.ok(loadingChatBounds && loadingBounds && footerBounds, "the transcript, loading status, and footer should have measurable bounds");
241
+ assert.ok(loadingBounds.y + loadingBounds.height <= footerBounds.y, "the loading status should sit above the Git footer status");
239
242
 
240
243
  releaseMessages();
241
244
  await expect(loading).toBeHidden();
242
245
  await expect(chat).toHaveAttribute("aria-busy", "false");
243
246
  const settledChatBounds = await chat.boundingBox();
244
- assert.deepEqual(settledChatBounds, loadingChatBounds, "showing or hiding loading feedback must not move or resize the transcript");
247
+ assert.ok(settledChatBounds, "the settled transcript should have measurable bounds");
248
+ assert.equal(settledChatBounds.x, loadingChatBounds.x, "the loading row should not move the transcript horizontally");
249
+ assert.equal(settledChatBounds.width, loadingChatBounds.width, "the loading row should not resize the transcript horizontally");
250
+ assert.equal(settledChatBounds.height, loadingChatBounds.height, "the loading overlay should not resize the transcript");
245
251
  } finally {
246
252
  releaseMessages?.();
247
253
  await page.unroute(messagesPattern);
@@ -144,55 +144,71 @@ test.afterAll(async () => {
144
144
  await rm(tempRoot, { recursive: true, force: true }).catch(() => {});
145
145
  });
146
146
 
147
- test("the 32-conversation dense grid stays contained and opens the correct truncated conversation", async ({ page }) => {
147
+ test("the 32-conversation strip reaches half the input and keeps overflow chats recognizable", async ({ page }) => {
148
148
  await page.setViewportSize({ width: 900, height: 760 });
149
149
  await page.goto(baseURL);
150
150
  const container = page.locator("#intercomConversationTags");
151
- const tags = container.locator(":scope > .composer-intercom-tag");
152
- const longTag = tags.filter({ hasText: longPeerName });
153
- const longLabel = longTag.locator(".composer-intercom-tag-label");
151
+ const tags = container.locator(":scope > .composer-intercom-tag[data-intercom-conversation-id]");
152
+ const overflow = container.locator(":scope > .composer-intercom-tag.overflow");
153
+ const menu = container.locator(":scope > .composer-intercom-overflow-menu");
154
154
 
155
155
  await expect(tags).toHaveCount(expectedConversationCount);
156
- await expect(container).toHaveClass(/\bdense\b/);
157
- for (let index = 0; index < expectedConversationCount; index += 1) await expect(tags.nth(index)).toBeVisible();
156
+ await expect(overflow).toBeVisible();
157
+ const hiddenCount = Number((await overflow.textContent())?.slice(1));
158
+ assert.ok(hiddenCount > 0 && hiddenCount < expectedConversationCount, `the desktop strip should keep some complete tags visible and hide the rest (${hiddenCount})`);
158
159
 
159
160
  const layout = await container.evaluate((element) => {
160
161
  const containerRect = element.getBoundingClientRect();
161
- const tagRects = [...element.querySelectorAll(":scope > .composer-intercom-tag")].map((tag) => tag.getBoundingClientRect());
162
+ const inputRect = document.querySelector("#promptInput").getBoundingClientRect();
163
+ const visibleRects = [...element.querySelectorAll(":scope > .composer-intercom-tag:not([hidden])")].map((tag) => tag.getBoundingClientRect());
164
+ const visibleConversationRects = [...element.querySelectorAll(":scope > .composer-intercom-tag[data-intercom-conversation-id]:not([hidden])")].map((tag) => tag.getBoundingClientRect());
165
+ const overflowRect = element.querySelector(":scope > .composer-intercom-tag.overflow").getBoundingClientRect();
166
+ const firstConversationRect = visibleConversationRects[0];
162
167
  return {
163
- clientWidth: element.clientWidth,
164
- scrollWidth: element.scrollWidth,
168
+ containerWidth: containerRect.width,
169
+ inputWidth: inputRect.width,
165
170
  rootFontSize: Number.parseFloat(getComputedStyle(document.documentElement).fontSize),
166
- widths: tagRects.map((rect) => rect.width),
167
- rowTops: [...new Set(tagRects.map((rect) => Math.round(rect.top)))],
168
- allContained: tagRects.every((rect) => rect.left >= containerRect.left - 0.5 && rect.right <= containerRect.right + 0.5),
171
+ widths: visibleConversationRects.map((rect) => rect.width),
172
+ rowCenters: visibleRects.map((rect) => rect.top + rect.height / 2),
173
+ firstConversationRightGap: containerRect.right - firstConversationRect.right,
174
+ firstConversationLeft: firstConversationRect.left,
175
+ overflowLeft: overflowRect.left,
176
+ allContained: visibleRects.every((rect) => rect.left >= containerRect.left - 0.5 && rect.right <= containerRect.right + 0.5),
169
177
  };
170
178
  });
171
- assert.ok(layout.allContained, "every desktop conversation tag should remain within the tag container");
172
- assert.ok(layout.clientWidth <= (17 * layout.rootFontSize) + 0.5, `the desktop conversation tag group should stay within 17rem (${layout.clientWidth}px)`);
173
- assert.ok(layout.scrollWidth <= layout.clientWidth, `the desktop tag grid should not overflow horizontally (${layout.scrollWidth} > ${layout.clientWidth})`);
174
- assert.ok(Math.min(...layout.widths) >= 44, `every dense desktop target should be at least 44px wide (minimum ${Math.min(...layout.widths)})`);
175
- assert.ok(layout.rowTops.length > 1, "the 32-conversation desktop fixture should wrap into multiple rows");
179
+ assert.ok(layout.containerWidth <= layout.inputWidth / 2 + 1, `the desktop tag strip should stop at the input midpoint (${layout.containerWidth} > ${layout.inputWidth / 2})`);
180
+ assert.ok(layout.containerWidth >= layout.inputWidth * 0.45, `the desktop tag strip should use the available half-width instead of the old compact cap (${layout.containerWidth} < ${layout.inputWidth * 0.45})`);
181
+ assert.ok(layout.allContained, "every visible desktop conversation tag should stay within the measured strip");
182
+ assert.ok(Math.max(...layout.rowCenters) - Math.min(...layout.rowCenters) <= 1, "visible conversations and +X should remain vertically aligned on one row");
183
+ assert.ok(layout.firstConversationRightGap <= 1, `the newest conversation should start at the right edge (${layout.firstConversationRightGap}px gap)`);
184
+ assert.ok(layout.firstConversationLeft > layout.overflowLeft, "older conversations and +X should extend left toward the input midpoint");
185
+ assert.ok(Math.min(...layout.widths) >= 44, `visible desktop conversation targets should remain recognizable (minimum ${Math.min(...layout.widths)}px)`);
186
+ assert.ok(Math.max(...layout.widths) <= 13 * layout.rootFontSize + 1, `direct conversation tags should stay within 13rem (maximum ${Math.max(...layout.widths)}px)`);
176
187
 
177
- await expect(longTag).toHaveCount(1);
178
- const fullVisualLabel = await longLabel.textContent();
179
- assert.ok(fullVisualLabel?.includes(longPeerName), "the long label fixture should retain its full DOM text");
180
- await expect(longTag).toHaveAttribute("aria-label", `Open agent conversation ${fullVisualLabel}`);
181
- await expect(longTag).toHaveAttribute("title", `${fullVisualLabel} · 1 message`);
182
- const truncation = await longLabel.evaluate((element) => ({ clientWidth: element.clientWidth, scrollWidth: element.scrollWidth }));
183
- assert.ok(truncation.scrollWidth > truncation.clientWidth, `the long label should be visually truncated (${truncation.scrollWidth} <= ${truncation.clientWidth})`);
188
+ await overflow.click();
189
+ await expect(menu).toBeVisible();
190
+ await expect(overflow).toHaveAttribute("aria-expanded", "true");
191
+ const hiddenItems = menu.locator(":scope > .composer-intercom-overflow-menu-item:not([hidden])");
192
+ await expect(hiddenItems).toHaveCount(hiddenCount);
193
+ const longMenuItem = hiddenItems.filter({ hasText: longPeerName });
194
+ await expect(longMenuItem).toHaveCount(1);
195
+ await expect(longMenuItem).toBeVisible();
196
+ const fullVisualLabel = await longMenuItem.locator(".composer-intercom-tag-label").textContent();
197
+ assert.ok(fullVisualLabel?.includes(longPeerName), "the overflow menu should retain the full long conversation label in the DOM");
198
+ await expect(longMenuItem).toHaveAttribute("aria-label", `Open agent conversation ${fullVisualLabel}`);
199
+ await expect(longMenuItem).toHaveAttribute("title", `${fullVisualLabel} · 1 message`);
184
200
 
185
- await longTag.click();
201
+ await longMenuItem.click();
186
202
  await expect(page.locator("#intercomConversationDialog")).toBeVisible();
187
203
  await expect(page.locator("#intercomConversationParticipants")).toContainText(`${longPeerName} (${longPeerId})`);
188
204
  await expect(page.locator("#intercomConversationTranscript")).toContainText("Long-label conversation selected correctly");
189
205
  await page.locator("#intercomConversationCloseButton").click();
190
- await expect(longTag).toBeFocused();
206
+ await expect(overflow).toBeFocused();
191
207
  });
192
208
 
193
209
  test("conversation tag opens a safe chat dialog, refreshes, and restores focus", async ({ page }) => {
194
210
  await page.goto(baseURL);
195
- const tags = page.locator("#intercomConversationTags .composer-intercom-tag");
211
+ const tags = page.locator("#intercomConversationTags > .composer-intercom-tag[data-intercom-conversation-id]");
196
212
  const tag = tags.filter({
197
213
  has: page.locator(".composer-intercom-tag-label").filter({ hasText: /↔ Browser Peer \(peer-browser\)$/ }),
198
214
  });
@@ -261,7 +277,7 @@ test("conversation tag opens a safe chat dialog, refreshes, and restores focus",
261
277
  await expect(stableTagLabel).toHaveAttribute("data-stable-visual-marker", "retained");
262
278
  });
263
279
 
264
- test("conversation tags remain reachable through the narrow composer disclosure", async ({ page }) => {
280
+ test("conversation overflow remains reachable through the narrow composer disclosure", async ({ page }) => {
265
281
  await page.setViewportSize({ width: 390, height: 760 });
266
282
  await page.goto(baseURL);
267
283
  const more = page.locator("#composerActionsButton");
@@ -269,39 +285,46 @@ test("conversation tags remain reachable through the narrow composer disclosure"
269
285
  await more.focus();
270
286
  await more.press("Enter");
271
287
  const tags = page.locator("#intercomConversationTags");
272
- const tagButtons = tags.locator(":scope > .composer-intercom-tag");
273
- const tag = tagButtons.filter({
274
- has: page.locator(".composer-intercom-tag-label").filter({ hasText: /↔ Browser Peer \(peer-browser\)$/ }),
275
- });
288
+ const tagButtons = tags.locator(":scope > .composer-intercom-tag[data-intercom-conversation-id]");
289
+ const overflow = tags.locator(":scope > .composer-intercom-tag.overflow");
276
290
  await expect(tags).toBeVisible();
277
291
  await expect(tagButtons).toHaveCount(expectedConversationCount);
278
- for (let index = 0; index < expectedConversationCount; index += 1) {
279
- await expect(tagButtons.nth(index)).toBeVisible();
280
- await expect(tagButtons.nth(index)).toHaveCSS("min-height", "44px");
281
- }
292
+ await expect(overflow).toBeVisible();
293
+ await expect(overflow).toHaveCSS("min-height", "44px");
294
+
282
295
  const layout = await tags.evaluate((element) => {
283
296
  const containerRect = element.getBoundingClientRect();
284
- const tagRects = [...element.querySelectorAll(":scope > .composer-intercom-tag")].map((button) => button.getBoundingClientRect());
297
+ const contextStyle = getComputedStyle(element.parentElement);
298
+ const contextContentWidth = element.parentElement.clientWidth
299
+ - Number.parseFloat(contextStyle.paddingLeft)
300
+ - Number.parseFloat(contextStyle.paddingRight);
301
+ const visibleRects = [...element.querySelectorAll(":scope > .composer-intercom-tag:not([hidden])")].map((button) => button.getBoundingClientRect());
285
302
  return {
286
- clientWidth: element.clientWidth,
287
- scrollWidth: element.scrollWidth,
288
- widths: tagRects.map((rect) => rect.width),
289
- heights: tagRects.map((rect) => rect.height),
290
- rowTops: [...new Set(tagRects.map((rect) => Math.round(rect.top)))],
291
- allContained: tagRects.every((rect) => rect.left >= containerRect.left - 0.5 && rect.right <= containerRect.right + 0.5),
303
+ containerWidth: containerRect.width,
304
+ contextContentWidth,
305
+ widths: visibleRects.map((rect) => rect.width),
306
+ heights: visibleRects.map((rect) => rect.height),
307
+ rowCenters: visibleRects.map((rect) => rect.top + rect.height / 2),
308
+ allContained: visibleRects.every((rect) => rect.left >= containerRect.left - 0.5 && rect.right <= containerRect.right + 0.5),
292
309
  };
293
310
  });
294
- assert.ok(layout.allContained, "every narrow conversation tag should remain within the tag container");
295
- assert.ok(layout.scrollWidth <= layout.clientWidth, `the narrow tag grid should not overflow horizontally (${layout.scrollWidth} > ${layout.clientWidth})`);
296
- assert.ok(Math.min(...layout.widths) >= 44, `every narrow touch target should be at least 44px wide (minimum ${Math.min(...layout.widths)})`);
297
- assert.ok(Math.min(...layout.heights) >= 44, `every narrow touch target should be at least 44px high (minimum ${Math.min(...layout.heights)})`);
298
- assert.ok(layout.rowTops.length > 1, "the 32-conversation narrow fixture should wrap into multiple rows");
299
- const clippedLabels = await tagButtons.locator(".composer-intercom-tag-label").evaluateAll((labels) => labels.filter((label) => label.scrollWidth > label.clientWidth).length);
300
- assert.ok(clippedLabels > 0, "dense narrow labels should be allowed to truncate visually");
301
- await tag.focus();
302
- await tag.press("Enter");
311
+ assert.ok(layout.containerWidth >= layout.contextContentWidth - 1, `the narrow conversation strip should use the full disclosed row (${layout.containerWidth} < ${layout.contextContentWidth})`);
312
+ assert.ok(layout.allContained, "every visible narrow conversation tag should stay within the tag container");
313
+ assert.ok(Math.min(...layout.widths) >= 44, `every visible narrow touch target should be at least 44px wide (minimum ${Math.min(...layout.widths)})`);
314
+ assert.ok(Math.min(...layout.heights) >= 44, `every visible narrow touch target should be at least 44px high (minimum ${Math.min(...layout.heights)})`);
315
+ assert.ok(Math.max(...layout.rowCenters) - Math.min(...layout.rowCenters) <= 1, "narrow conversation tags should stay vertically aligned on one row before disclosure");
316
+
317
+ const hiddenCount = Number((await overflow.textContent())?.slice(1));
318
+ await overflow.click();
319
+ const hiddenItems = tags.locator(":scope > .composer-intercom-overflow-menu > .composer-intercom-overflow-menu-item:not([hidden])");
320
+ await expect(hiddenItems).toHaveCount(hiddenCount);
321
+ for (let index = 0; index < hiddenCount; index += 1) await expect(hiddenItems.nth(index)).toHaveCSS("min-height", "44px");
322
+ const longMenuItem = hiddenItems.filter({ hasText: longPeerName });
323
+ await expect(longMenuItem).toBeVisible();
324
+ await longMenuItem.focus();
325
+ await longMenuItem.press("Enter");
303
326
  await expect(page.locator("#intercomConversationDialog")).toBeVisible();
304
- await expect(page.locator("#intercomConversationParticipants")).toContainText("Browser Peer (peer-browser)");
327
+ await expect(page.locator("#intercomConversationParticipants")).toContainText(`${longPeerName} (${longPeerId})`);
305
328
  await expect(page.locator("#intercomConversationCloseButton")).toBeVisible();
306
329
  });
307
330
 
@@ -202,3 +202,54 @@ test("Escape closes the composer options menu while its trigger keeps focus", as
202
202
  await page.keyboard.press("Escape");
203
203
  await expect(panel).toBeHidden();
204
204
  });
205
+
206
+ test("a group with more than eight tabs keeps every titled row reachable", async ({ page }) => {
207
+ await page.setViewportSize({ width: 1280, height: 520 });
208
+ await page.goto(baseURL);
209
+ await expect(page.locator("#promptInput")).toBeVisible();
210
+
211
+ const groupedTabs = [];
212
+ for (let index = 1; index <= 9; index += 1) {
213
+ const title = `Overflow title ${index}`;
214
+ const response = await page.request.post(`${baseURL}/api/tabs`, { data: { title } });
215
+ assert.equal(response.ok(), true, `creating ${title} should succeed`);
216
+ const payload = await response.json();
217
+ groupedTabs.push({ id: payload.data.tab.id, title });
218
+ }
219
+
220
+ await page.evaluate((tabs) => {
221
+ localStorage.setItem("pi-webui-terminal-custom-groups-v1", JSON.stringify({
222
+ version: 1,
223
+ groups: [{ id: "overflow-group", title: "Overflow group", tabIds: tabs.map((tab) => tab.id) }],
224
+ }));
225
+ }, groupedTabs);
226
+ await page.reload();
227
+
228
+ const group = page.locator(".terminal-tab-custom-group");
229
+ await expect(group).toHaveCount(1);
230
+ await group.hover();
231
+ const menu = group.locator(".terminal-tab-group-menu");
232
+ await expect(menu).toBeVisible();
233
+ await expect(menu.locator(".terminal-tab-group-item")).toHaveCount(groupedTabs.length);
234
+ assert.deepEqual(
235
+ await menu.locator(".terminal-tab-group-item .terminal-tab-title").allTextContents(),
236
+ groupedTabs.map((tab) => tab.title),
237
+ "the group menu should preserve every server-provided tab title",
238
+ );
239
+
240
+ const bounds = await menu.evaluate((node) => {
241
+ const rect = node.getBoundingClientRect();
242
+ return { bottom: rect.bottom, viewportHeight: window.innerHeight, clientHeight: node.clientHeight, scrollHeight: node.scrollHeight };
243
+ });
244
+ assert.ok(bounds.bottom <= bounds.viewportHeight - 16, `the group menu should stay inside the viewport: ${JSON.stringify(bounds)}`);
245
+ assert.ok(bounds.scrollHeight > bounds.clientHeight, `nine group rows should use the bounded menu scroller: ${JSON.stringify(bounds)}`);
246
+
247
+ await menu.evaluate((node) => { node.scrollTop = node.scrollHeight; });
248
+ const lastRow = menu.locator(".terminal-tab-group-item").last();
249
+ const lastBounds = await lastRow.evaluate((node) => {
250
+ const row = node.getBoundingClientRect();
251
+ const scroller = node.parentElement.getBoundingClientRect();
252
+ return { rowTop: row.top, rowBottom: row.bottom, scrollerTop: scroller.top, scrollerBottom: scroller.bottom };
253
+ });
254
+ assert.ok(lastBounds.rowTop >= lastBounds.scrollerTop && lastBounds.rowBottom <= lastBounds.scrollerBottom, `the final titled row should be reachable by scrolling: ${JSON.stringify(lastBounds)}`);
255
+ });
@@ -55,7 +55,7 @@ assert.match(app, /statusKey === CODEX_FAST_MODE_STATUS_KEY[\s\S]*?applyCodexFas
55
55
  assert.match(technical, /## Normal and compact output[\s\S]*?select \*\*Compact\*\*[\s\S]*?`compact-v1`/, "technical reference should document Compact mode with the stable identifier");
56
56
  assert.match(development, /### Codex subscription Fast mode[\s\S]*?service_tier: "priority"[\s\S]*?1\.5× faster[\s\S]*?2× Standard credits[\s\S]*?2\.5×/, "development guide should document Fast-mode integration and cost semantics");
57
57
  // Intent preserved: browser-asset changes must advance the coherent cache tuple.
58
- assert.match(serviceWorker, /pi-webui-pwa-v142/, "PWA cache identity should be bumped for changed browser assets");
59
- assert.match(html, /data-app-src="\/app\.js\?v=175"/, "browser module URL should be cache-busted for Fast-mode wiring");
58
+ assert.match(serviceWorker, /pi-webui-pwa-v153/, "PWA cache identity should be bumped for changed browser assets");
59
+ assert.match(html, /data-app-src="\/app\.js\?v=182"/, "browser module URL should be cache-busted for Fast-mode wiring");
60
60
 
61
61
  console.log("codex-fast-mode-static.test.mjs passed");
@@ -57,8 +57,8 @@ assert.match(app, /function initializeComposerActionOrdering\(\)[\s\S]*MutationO
57
57
  assert.match(app, /event\.key === COMPOSER_ACTION_ORDER_STORAGE_KEY\) restoreComposerActionOrder\(\)[\s\S]*event\.key === COMPOSER_ACTION_LAYOUT_STORAGE_KEY\) restoreComposerActionSlotLayout\(\)/, "other tabs should apply persisted composer order and sparse-layout changes");
58
58
  assert.match(app, /initializeComposerActionOrdering\(\);[\s\S]*restoreSidePanelSectionOrder\(\);/, "composer ordering should initialize during guarded app startup");
59
59
 
60
- assert.match(html, /styles\.css\?v=143/, "changed composer styles should advance the stylesheet revision");
61
- assert.match(html, /app\.js\?v=175/, "changed composer behavior should advance the app revision");
62
- assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v142"/, "changed browser assets should advance the PWA cache identity");
60
+ assert.match(html, /styles\.css\?v=152/, "changed composer styles should advance the stylesheet revision");
61
+ assert.match(html, /app\.js\?v=182/, "changed composer behavior should advance the app revision");
62
+ assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v153"/, "changed browser assets should advance the PWA cache identity");
63
63
 
64
64
  console.log("composer-action-grid-reorder-static.test.mjs passed");