@firstpick/pi-package-webui 0.9.4 → 0.9.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.
Files changed (42) hide show
  1. package/README.md +3 -0
  2. package/lib/ui-layout-settings.mjs +37 -6
  3. package/package.json +1 -1
  4. package/public/app.js +499 -6
  5. package/public/index.html +33 -26
  6. package/public/service-worker.js +1 -1
  7. package/public/stream-output-controller.mjs +31 -2
  8. package/public/styles.css +27 -2
  9. package/tests/boot-failure-diagnostics.test.mjs +3 -3
  10. package/tests/browser/control-deck-side-panels.spec.mjs +42 -0
  11. package/tests/browser/control-visibility.spec.mjs +396 -0
  12. package/tests/browser/persistent-ui-layout.spec.mjs +9 -9
  13. package/tests/codex-fast-mode-static.test.mjs +2 -2
  14. package/tests/composer-action-grid-reorder-static.test.mjs +3 -3
  15. package/tests/control-deck-side-panels-static.test.mjs +3 -1
  16. package/tests/control-visibility-static.test.mjs +294 -0
  17. package/tests/controls-layout-static.test.mjs +3 -3
  18. package/tests/fast-mode-client-static.test.mjs +1 -1
  19. package/tests/feature-decision-output-popup-static.test.mjs +2 -2
  20. package/tests/file-viewer-image-static.test.mjs +3 -3
  21. package/tests/fixtures/streaming-workloads.mjs +131 -0
  22. package/tests/git-workflow-preferences.test.mjs +2 -2
  23. package/tests/http-endpoints-harness.test.mjs +4 -4
  24. package/tests/intercom-conversation-viewer-static.test.mjs +4 -4
  25. package/tests/main-output-loading-static.test.mjs +3 -3
  26. package/tests/middle-button-drag-scroll-static.test.mjs +3 -3
  27. package/tests/mobile-continuity-tablet-static.test.mjs +3 -3
  28. package/tests/mobile-foundation-static.test.mjs +3 -3
  29. package/tests/mobile-phone-experience-static.test.mjs +1 -1
  30. package/tests/mobile-static.test.mjs +3 -3
  31. package/tests/open-issue-wizard-static.test.mjs +2 -2
  32. package/tests/persistent-ui-layout-static.test.mjs +6 -6
  33. package/tests/questionnaire-dialog.test.mjs +3 -3
  34. package/tests/session-sampling-ui-static.test.mjs +3 -3
  35. package/tests/side-panel-section-height-removal-static.test.mjs +3 -3
  36. package/tests/stream-output-isolation-static.test.mjs +7 -0
  37. package/tests/stream-output-workloads.test.mjs +239 -0
  38. package/tests/subagent-observability-static.test.mjs +2 -2
  39. package/tests/syntax-highlighting-static.test.mjs +3 -3
  40. package/tests/theme-customizer-static.test.mjs +1 -1
  41. package/tests/ui-layout-settings.test.mjs +54 -7
  42. package/tests/webui-settings-locking.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=126" />
15
+ <link rel="stylesheet" href="/styles.css?v=129" />
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.
@@ -222,13 +222,13 @@
222
222
  </div>
223
223
  </div>
224
224
  </div>
225
- <div class="terminal-sidebar-actions" aria-label="Tab and workspace actions">
226
- <button id="workspaceSaveButton" class="terminal-workspace-save-button" type="button" aria-label="Save workspace" data-tooltip="Save workspace:&#10;• Captures all open tabs, sessions, order, custom groups, and the active tab.&#10;• Available when at least one tab is open."><svg class="terminal-workspace-save-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M5 4h11l3 3v13H5z" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"/><path d="M8 4v6h7V4M8 19v-5h8v5" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"/></svg></button>
227
- <button id="commandPaletteButton" class="terminal-command-palette-button" type="button" aria-label="Open command palette" data-tooltip="Command palette:&#10;• Search and run actions, slash commands, models, and tabs.&#10;• Shortcut: Ctrl/Cmd+K."><svg class="composer-icon command-palette-launcher-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M5 7.5h14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><path d="M5 12h9" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><path d="M5 16.5h5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><path d="M17 14.5 19.5 17 17 19.5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></button>
228
- <button id="workspaceDashboardToggleButton" class="terminal-dashboard-button" type="button" aria-controls="workspaceDashboard" aria-expanded="false" aria-label="Show workspace overview" data-tooltip="Workspace overview:&#10;• Shows current tab, cwd, model, context, session, and queue.&#10;• Opens common workspace/session actions from one place."><svg class="composer-icon workspace-overview-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M4 11.4 12 4l8 7.4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M6.5 10.5V20h11v-9.5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M10 20v-5h4v5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></button>
225
+ <div class="terminal-sidebar-actions" aria-label="Tab and workspace actions" data-visibility-region="workspace">
226
+ <button id="workspaceSaveButton" class="terminal-workspace-save-button" data-visibility-key="workspace.save" type="button" aria-label="Save workspace" data-tooltip="Save workspace:&#10;• Captures all open tabs, sessions, order, custom groups, and the active tab.&#10;• Available when at least one tab is open."><svg class="terminal-workspace-save-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M5 4h11l3 3v13H5z" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"/><path d="M8 4v6h7V4M8 19v-5h8v5" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"/></svg></button>
227
+ <button id="commandPaletteButton" class="terminal-command-palette-button" data-visibility-key="workspace.command-palette" type="button" aria-label="Open command palette" data-tooltip="Command palette:&#10;• Search and run actions, slash commands, models, and tabs.&#10;• Shortcut: Ctrl/Cmd+K."><svg class="composer-icon command-palette-launcher-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M5 7.5h14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><path d="M5 12h9" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><path d="M5 16.5h5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><path d="M17 14.5 19.5 17 17 19.5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></button>
228
+ <button id="workspaceDashboardToggleButton" class="terminal-dashboard-button" data-visibility-key="workspace.overview" type="button" aria-controls="workspaceDashboard" aria-expanded="false" aria-label="Show workspace overview" data-tooltip="Workspace overview:&#10;• Shows current tab, cwd, model, context, session, and queue.&#10;• Opens common workspace/session actions from one place."><svg class="composer-icon workspace-overview-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M4 11.4 12 4l8 7.4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M6.5 10.5V20h11v-9.5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M10 20v-5h4v5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></button>
229
229
  </div>
230
230
  <div id="remoteAccessIndicator" class="remote-access-indicator" role="status" aria-live="polite" hidden>Remote access open</div>
231
- <button id="closeAllTabsButton" class="terminal-close-all-button" type="button" aria-label="Close all terminal tabs">Close all Tabs</button>
231
+ <button id="closeAllTabsButton" class="terminal-close-all-button" data-visibility-key="workspace.close-all-tabs" type="button" aria-label="Close all terminal tabs">Close all Tabs</button>
232
232
  </div>
233
233
  </header>
234
234
  <button id="terminalTabsBackdrop" class="terminal-tabs-backdrop" type="button" aria-label="Close terminal navigation" tabindex="-1" hidden></button>
@@ -331,8 +331,8 @@
331
331
  <button id="mobileFailedSendDiscardButton" type="button">Discard</button>
332
332
  </section>
333
333
  <div id="commandSuggest" class="command-suggest" role="listbox" aria-label="Command and path suggestions" hidden></div>
334
- <div class="composer-input-row">
335
- <div id="workflowModeControls" class="composer-workflow-mode-dock" role="group" aria-label="Workflow Mode controls" hidden>
334
+ <div class="composer-input-row" data-visibility-region="inputframe">
335
+ <div id="workflowModeControls" class="composer-workflow-mode-dock" role="group" aria-label="Workflow Mode controls" data-visibility-key="input.workflow" hidden>
336
336
  <button
337
337
  id="workflowOverlayOpenButton"
338
338
  class="composer-icon-button composer-workflow-overlay-open-button"
@@ -357,17 +357,18 @@
357
357
  <button
358
358
  id="busyPromptBehaviorTag"
359
359
  class="composer-busy-mode-tag"
360
+ data-visibility-key="tag.prompt-behavior"
360
361
  type="button"
361
362
  aria-haspopup="menu"
362
363
  aria-expanded="false"
363
364
  aria-controls="busyPromptBehaviorMenu"
364
365
  aria-live="polite"
365
366
  >Follow-up</button>
366
- <div id="sessionSkillTags" class="composer-skill-tags" aria-live="polite" hidden></div>
367
- <div id="intercomConversationTags" class="composer-intercom-tags" role="group" aria-label="Agent conversations" aria-live="polite" hidden></div>
368
- <button id="featureCategoryTag" class="composer-feature-category-tag" type="button" aria-haspopup="dialog" aria-controls="featureDecisionDialog" aria-live="polite" aria-atomic="true" disabled hidden></button>
369
- <button id="conversationModeChip" class="composer-conversation-mode-chip" type="button" aria-live="polite" hidden>Voice: off</button>
370
- <button id="workflowModeChip" class="composer-workflow-mode-chip" type="button" aria-live="polite" aria-pressed="true" hidden>Workflow: on</button>
367
+ <div id="sessionSkillTags" class="composer-skill-tags" aria-live="polite" data-visibility-key="tag.skills" hidden></div>
368
+ <div id="intercomConversationTags" class="composer-intercom-tags" role="group" aria-label="Agent conversations" aria-live="polite" data-visibility-key="tag.agent-conversations" hidden></div>
369
+ <button id="featureCategoryTag" class="composer-feature-category-tag" type="button" aria-haspopup="dialog" aria-controls="featureDecisionDialog" aria-live="polite" aria-atomic="true" data-visibility-key="tag.feature-category" disabled hidden></button>
370
+ <button id="conversationModeChip" class="composer-conversation-mode-chip" type="button" aria-live="polite" data-visibility-key="tag.voice-mode" hidden>Voice: off</button>
371
+ <button id="workflowModeChip" class="composer-workflow-mode-chip" type="button" aria-live="polite" aria-pressed="true" data-visibility-key="tag.workflow-mode" hidden>Workflow: on</button>
371
372
  </div>
372
373
  <div id="busyPromptBehaviorMenu" class="composer-busy-mode-menu" role="menu" aria-labelledby="busyPromptBehaviorTag" hidden>
373
374
  <button class="composer-busy-mode-menu-item" type="button" role="menuitemradio" data-busy-prompt-behavior="followUp" aria-checked="true">
@@ -387,6 +388,7 @@
387
388
  id="attachButton"
388
389
  class="composer-icon-button composer-attach-button"
389
390
  type="button"
391
+ data-visibility-key="input.attach-files"
390
392
  title="Attach files"
391
393
  aria-label="Attach images, videos, documents, audio, or other files"
392
394
  data-tooltip="Attach files:&#10;• Click to choose images, videos, audio, PDFs, docs, text/code, or other files.&#10;• Paste images/docs from the clipboard.&#10;• Drag and drop files onto the composer."
@@ -402,15 +404,16 @@
402
404
  <p id="followUpQueueStatus" class="follow-up-queue-status" role="status" aria-live="polite" aria-atomic="true"></p>
403
405
  </section>
404
406
  <div id="attachmentTray" class="attachment-tray" aria-live="polite" hidden></div>
405
- <div class="composer-row">
407
+ <div class="composer-row" data-visibility-region="composer">
406
408
  <button id="composerActionsButton" class="composer-actions-button" type="button" aria-controls="composerActionsPanel" aria-expanded="false" title="Show more composer actions">More</button>
407
409
  <div id="composerActionsPanel" class="composer-actions-panel" aria-label="More composer actions">
408
410
  <h2 class="composer-actions-heading composer-actions-heading-session">Session &amp; workspace</h2>
409
- <button id="newSessionButton" class="composer-new-button" type="button" data-composer-action-id="new" data-composer-action-span="1">New</button>
410
- <button id="compactButton" class="composer-compact-button" type="button" title="Compact the current Pi session context" data-composer-action-id="compact" data-composer-action-span="2">Compact</button>
411
+ <button id="newSessionButton" class="composer-new-button" type="button" data-visibility-key="composer.new" data-composer-action-id="new" data-composer-action-span="1">New</button>
412
+ <button id="compactButton" class="composer-compact-button" type="button" title="Compact the current Pi session context" data-visibility-key="composer.compact" data-composer-action-id="compact" data-composer-action-span="2">Compact</button>
411
413
  <button
412
414
  id="gitWorkflowButton"
413
415
  class="composer-icon-button composer-git-button"
416
+ data-visibility-key="composer.guided-git"
414
417
  data-composer-action-id="git"
415
418
  data-composer-action-span="1"
416
419
  type="button"
@@ -420,7 +423,7 @@
420
423
  data-tooltip="Guided Git workflow:&#10;1. Stage all changes with git add .&#10;2. Generate and preview staged commit messages.&#10;3. Optional: create or type a PR branch worktree before committing.&#10;4. Commit with the short or long message in the worktree tab.&#10;5. Push normally, or push the PR worktree branch, generate/review /pr, and create the PR.&#10;Cancel is available at each step."
421
424
  ><svg class="composer-icon composer-icon-github" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8Z"/></svg></button>
422
425
  <h2 class="composer-actions-heading composer-actions-heading-tools">Tools &amp; commands</h2>
423
- <div class="composer-publish-menu" data-composer-action-id="publish" data-composer-action-span="1" hidden>
426
+ <div class="composer-publish-menu" data-visibility-key="composer.publish" data-composer-action-id="publish" data-composer-action-span="1" hidden>
424
427
  <button
425
428
  id="publishButton"
426
429
  class="composer-icon-button composer-publish-button"
@@ -441,7 +444,7 @@
441
444
  </button>
442
445
  </div>
443
446
  </div>
444
- <div class="composer-publish-menu composer-native-command-menu" data-composer-action-id="native-command" data-composer-action-span="1" hidden>
447
+ <div class="composer-publish-menu composer-native-command-menu" data-visibility-key="composer.tools-skills" data-composer-action-id="native-command" data-composer-action-span="1" hidden>
445
448
  <button
446
449
  id="nativeCommandMenuButton"
447
450
  class="composer-icon-button composer-publish-button composer-native-command-button"
@@ -462,7 +465,7 @@
462
465
  </button>
463
466
  </div>
464
467
  </div>
465
- <div class="composer-publish-menu composer-options-menu" data-composer-action-id="options" data-composer-action-span="1">
468
+ <div class="composer-publish-menu composer-options-menu" data-visibility-key="composer.common-options" data-composer-action-id="options" data-composer-action-span="1">
466
469
  <button
467
470
  id="optionsMenuButton"
468
471
  class="composer-icon-button composer-publish-button composer-options-button"
@@ -578,7 +581,7 @@
578
581
  </div>
579
582
  </div>
580
583
  </div>
581
- <div id="appRunnerMenu" class="composer-publish-menu composer-app-runner-menu" data-composer-action-id="app-runner" data-composer-action-span="2" hidden>
584
+ <div id="appRunnerMenu" class="composer-publish-menu composer-app-runner-menu" data-visibility-key="composer.app-runner" data-composer-action-id="app-runner" data-composer-action-span="2" hidden>
582
585
  <button
583
586
  id="appRunnerInfoButton"
584
587
  class="composer-icon-button composer-app-runner-info-button"
@@ -608,6 +611,7 @@
608
611
  <button
609
612
  id="steerButton"
610
613
  type="button"
614
+ data-visibility-key="composer.steer"
611
615
  data-composer-action-id="steer"
612
616
  data-composer-action-span="2"
613
617
  title="Type your message first, then tap Steer to guide the active Pi run without sending a normal prompt. Use it for corrections or direction changes while Pi is working."
@@ -617,6 +621,7 @@
617
621
  <button
618
622
  id="followUpButton"
619
623
  type="button"
624
+ data-visibility-key="composer.follow-up"
620
625
  data-composer-action-id="follow-up"
621
626
  data-composer-action-span="2"
622
627
  title="Type your message first, then tap Follow-up to send it as a follow-up instead of a normal prompt. Use it to add extra context or the next request."
@@ -632,6 +637,7 @@
632
637
  <button
633
638
  id="btwButton"
634
639
  class="composer-icon-button composer-btw-button"
640
+ data-visibility-key="composer.btw"
635
641
  data-composer-action-id="btw"
636
642
  data-composer-action-span="1"
637
643
  type="button"
@@ -640,7 +646,7 @@
640
646
  data-tooltip="/btw side question:&#10;Type a question, then tap /btw to ask without adding it to the main conversation."
641
647
  hidden
642
648
  ><svg class="composer-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M5.5 6.5h10.75a2.25 2.25 0 0 1 2.25 2.25v4.5a2.25 2.25 0 0 1-2.25 2.25h-4.4L8 18.25V15.5H5.5a2.25 2.25 0 0 1-2.25-2.25v-4.5A2.25 2.25 0 0 1 5.5 6.5Z" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"/><path d="m15.75 5.25 1.1-2.1 1.1 2.1 2.3 1.1-2.3 1.1-1.1 2.1-1.1-2.1-2.3-1.1 2.3-1.1Z" fill="currentColor"/><path d="M7.25 10.25h5.8M7.25 12.75h4.1" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"/></svg></button>
643
- <button id="sendButton" type="submit" class="primary" title="Send prompt" data-composer-action-id="send" data-composer-action-span="2">Send</button>
649
+ <button id="sendButton" type="submit" class="primary" title="Send prompt — Shift+F10 opens visibility options" aria-keyshortcuts="Alt+ArrowLeft Alt+ArrowRight Alt+ArrowUp Alt+ArrowDown ContextMenu Shift+F10" data-composer-action-id="send" data-composer-action-span="2">Send</button>
644
650
  <div id="composerActionGridGuide" class="composer-action-grid-guide" aria-hidden="true" hidden></div>
645
651
  </div>
646
652
  <p id="composerActionOrderStatus" class="sr-only" role="status" aria-live="polite" aria-atomic="true"></p>
@@ -714,11 +720,11 @@
714
720
  <div id="controlDeckMovementAnnouncer" class="sr-only" role="status" aria-live="polite" aria-atomic="true"></div>
715
721
  <aside id="sidePanel" class="side-panel side-panel-right" aria-label="Right Control Deck" data-control-deck-shell="right">
716
722
  <div id="sidePanelResizeHandle" class="side-panel-resize-handle side-panel-resize-handle-right" role="separator" aria-orientation="vertical" aria-label="Resize right Control Deck width" tabindex="0" title="Drag to resize right Control Deck"></div>
717
- <div class="side-panel-header">
723
+ <div class="side-panel-header" data-visibility-region="control-deck">
718
724
  <div class="side-panel-heading">
719
725
  <div class="side-panel-brand-row">
720
726
  <span class="side-panel-kicker">Pi Web UI</span>
721
- <a class="sponsor-link" href="https://github.com/sponsors/Firstp1ck" target="_blank" rel="noopener noreferrer" aria-label="Sponsor Firstp1ck on GitHub" title="Sponsor Firstp1ck on GitHub">♡</a>
727
+ <a class="sponsor-link" data-visibility-key="control-deck.sponsor" href="https://github.com/sponsors/Firstp1ck" target="_blank" rel="noopener noreferrer" aria-label="Sponsor Firstp1ck on GitHub" title="Sponsor Firstp1ck on GitHub">♡</a>
722
728
  </div>
723
729
  <strong class="side-panel-title">Control Deck</strong>
724
730
  <span id="sidePanelEditHint" class="side-panel-edit-hint" role="status" aria-live="polite" hidden>Drag sections or use Alt+↑/↓</span>
@@ -1205,8 +1211,8 @@
1205
1211
  </div>
1206
1212
  </section>
1207
1213
  </div>
1208
- <footer class="side-panel-footer" data-control-deck-shared-footer>
1209
- <button id="openIssueButton" class="open-issue-button" type="button" aria-haspopup="dialog" aria-controls="issueWizardDialog">Open Issue</button>
1214
+ <footer class="side-panel-footer" data-control-deck-shared-footer data-visibility-region="control-deck">
1215
+ <button id="openIssueButton" class="open-issue-button" data-visibility-key="control-deck.open-issue" type="button" aria-haspopup="dialog" aria-controls="issueWizardDialog">Open Issue</button>
1210
1216
  </footer>
1211
1217
  </aside>
1212
1218
  </main>
@@ -1219,6 +1225,7 @@
1219
1225
  </div>
1220
1226
  <div id="gitPanelContextMenu" class="file-context-menu git-side-panel-context-menu" role="menu" aria-label="Git actions" hidden></div>
1221
1227
  <div id="sidePanelContextMenu" class="file-context-menu side-panel-context-menu" role="menu" aria-label="Choose visible side panel sections" hidden></div>
1228
+ <div id="visibilityContextMenu" class="file-context-menu control-visibility-context-menu" role="menu" aria-label="Choose visible controls" hidden></div>
1222
1229
  <div id="gitFooterContextMenu" class="file-context-menu git-footer-context-menu" role="menu" aria-label="Git footer box actions" hidden>
1223
1230
  <button type="button" role="menuitem" data-git-footer-menu-action="disable">Disable this box</button>
1224
1231
  <button type="button" role="menuitem" data-git-footer-menu-action="visibility">Open Git-footer Visibility</button>
@@ -1819,7 +1826,7 @@
1819
1826
  </form>
1820
1827
  </dialog>
1821
1828
 
1822
- <script id="webuiBootLoader" data-app-src="/app.js?v=148">
1829
+ <script id="webuiBootLoader" data-app-src="/app.js?v=150">
1823
1830
  (() => {
1824
1831
  "use strict";
1825
1832
 
@@ -1,4 +1,4 @@
1
- const CACHE_NAME = "pi-webui-pwa-v112";
1
+ const CACHE_NAME = "pi-webui-pwa-v115";
2
2
  const APP_SHELL = [
3
3
  "/",
4
4
  "/index.html",
@@ -49,6 +49,10 @@ export function classifyTranscriptStreamEvent(event) {
49
49
  });
50
50
  }
51
51
 
52
+ function defaultNow() {
53
+ return typeof globalThis.performance?.now === "function" ? globalThis.performance.now() : Date.now();
54
+ }
55
+
52
56
  function defaultScheduleFrame(callback) {
53
57
  if (typeof globalThis.requestAnimationFrame === "function") return globalThis.requestAnimationFrame(callback);
54
58
  return globalThis.setTimeout(callback, 0);
@@ -106,6 +110,7 @@ function mergedAdjacentEntry(previous, incoming) {
106
110
  return {
107
111
  ...incoming,
108
112
  event,
113
+ receivedAt: previous.receivedAt !== undefined ? previous.receivedAt : incoming.receivedAt,
109
114
  bytes: eventByteSize(event),
110
115
  sourceCount: previous.sourceCount + incoming.sourceCount,
111
116
  sourceIndexes: [...previous.sourceIndexes, ...incoming.sourceIndexes].slice(-DIAGNOSTIC_INDEX_LIMIT),
@@ -123,6 +128,7 @@ function mergedAdjacentEntry(previous, incoming) {
123
128
  return {
124
129
  ...incoming,
125
130
  event,
131
+ receivedAt: previous.receivedAt !== undefined ? previous.receivedAt : incoming.receivedAt,
126
132
  bytes: eventByteSize(event),
127
133
  sourceCount: previous.sourceCount + incoming.sourceCount,
128
134
  sourceIndexes: [...previous.sourceIndexes, ...incoming.sourceIndexes].slice(-DIAGNOSTIC_INDEX_LIMIT),
@@ -140,6 +146,7 @@ function mergedAdjacentEntry(previous, incoming) {
140
146
  export function createStreamOutputController({
141
147
  scheduleFrame = defaultScheduleFrame,
142
148
  cancelFrame = defaultCancelFrame,
149
+ now = defaultNow,
143
150
  isOwnerCurrent = () => true,
144
151
  applyTextUpdate = () => {},
145
152
  applyThinkingUpdate = () => {},
@@ -157,6 +164,7 @@ export function createStreamOutputController({
157
164
  if (typeof scheduleFrame !== "function" || typeof cancelFrame !== "function") {
158
165
  throw new TypeError("scheduleFrame and cancelFrame must be functions");
159
166
  }
167
+ if (typeof now !== "function") throw new TypeError("now must be a function");
160
168
  const entryLimit = positiveLimit(maxPendingEntries, DEFAULT_STREAM_PENDING_ENTRY_LIMIT, "maxPendingEntries");
161
169
  const byteLimit = positiveLimit(maxPendingBytes, DEFAULT_STREAM_PENDING_BYTE_LIMIT, "maxPendingBytes");
162
170
  const diagnosticsEnabled = typeof onDiagnostic === "function";
@@ -226,12 +234,28 @@ export function createStreamOutputController({
226
234
  const entries = pending;
227
235
  pending = [];
228
236
  pendingBytes = 0;
237
+ // Latency/duration measurement only runs when a diagnostic hook is
238
+ // installed so the disabled hot path never pays for clock reads.
239
+ const drainStart = diagnosticsEnabled ? now() : 0;
229
240
  let applied = 0;
230
241
  for (const entry of entries) {
231
242
  if (applyEntry(entry)) applied += 1;
232
243
  }
233
244
  if (applied > 0) applyFollowScroll();
234
- emitDiagnostic({ type: "batch", entries: entries.length, sourceCount: entries.reduce((total, entry) => total + entry.sourceCount, 0), applied });
245
+ if (diagnosticsEnabled) {
246
+ let maxAgeMs = 0;
247
+ for (const entry of entries) {
248
+ if (typeof entry.receivedAt === "number") maxAgeMs = Math.max(maxAgeMs, drainStart - entry.receivedAt);
249
+ }
250
+ emitDiagnostic({
251
+ type: "batch",
252
+ entries: entries.length,
253
+ sourceCount: entries.reduce((total, entry) => total + entry.sourceCount, 0),
254
+ applied,
255
+ maxAgeMs,
256
+ drainMs: now() - drainStart,
257
+ });
258
+ }
235
259
  return applied;
236
260
  };
237
261
 
@@ -249,9 +273,13 @@ export function createStreamOutputController({
249
273
  };
250
274
 
251
275
  const applyOversize = (entry) => {
276
+ const applyStart = diagnosticsEnabled ? now() : 0;
252
277
  const applied = applyEntry(entry) ? 1 : 0;
253
278
  if (applied) applyFollowScroll();
254
- emitDiagnostic({ type: "batch", entries: 1, sourceCount: entry.sourceCount, applied, direct: true });
279
+ if (diagnosticsEnabled) {
280
+ const maxAgeMs = typeof entry.receivedAt === "number" ? Math.max(0, applyStart - entry.receivedAt) : 0;
281
+ emitDiagnostic({ type: "batch", entries: 1, sourceCount: entry.sourceCount, applied, direct: true, maxAgeMs, drainMs: now() - applyStart });
282
+ }
255
283
  return applied;
256
284
  };
257
285
 
@@ -298,6 +326,7 @@ export function createStreamOutputController({
298
326
  event,
299
327
  classification,
300
328
  owner,
329
+ receivedAt: diagnosticsEnabled ? now() : undefined,
301
330
  bytes: eventByteSize(event),
302
331
  sourceCount: 1,
303
332
  sourceIndexes: diagnosticsEnabled && index !== null ? [index] : [],
package/public/styles.css CHANGED
@@ -1165,6 +1165,26 @@ body.terminal-tabs-resizing * {
1165
1165
  letter-spacing: 0.06em;
1166
1166
  text-transform: uppercase;
1167
1167
  }
1168
+ .control-visibility-context-menu {
1169
+ max-height: calc(100vh - 1rem);
1170
+ max-height: calc(100dvh - 1rem);
1171
+ overflow-y: auto;
1172
+ }
1173
+ .control-visibility-menu-label {
1174
+ padding: 0.38rem 0.58rem 0.24rem;
1175
+ color: var(--ctp-subtext);
1176
+ font-size: var(--text-xs);
1177
+ font-weight: 850;
1178
+ letter-spacing: 0.06em;
1179
+ text-transform: uppercase;
1180
+ }
1181
+ .control-visibility-menu-action {
1182
+ border-top: 1px solid color-mix(in srgb, var(--ctp-subtext), transparent 78%);
1183
+ }
1184
+ /* User-hidden preference state composes with capability-owned hidden attributes. */
1185
+ .webui-user-hidden {
1186
+ display: none !important;
1187
+ }
1168
1188
  .side-panel-context-menu-item {
1169
1189
  display: grid;
1170
1190
  grid-template-columns: 1.1rem minmax(0, 1fr);
@@ -1191,7 +1211,8 @@ body.terminal-tabs-resizing * {
1191
1211
  background: var(--ctp-teal);
1192
1212
  }
1193
1213
  body.embedded-split .layout,
1194
- body.embedded-split.side-panel-collapsed .layout {
1214
+ body.embedded-split.side-panel-collapsed .layout,
1215
+ body.embedded-split:not(.control-deck-left):not(.control-deck-both) .layout {
1195
1216
  grid-template-columns: minmax(0, 1fr);
1196
1217
  gap: 0;
1197
1218
  width: 100%;
@@ -1201,8 +1222,12 @@ body.embedded-split.side-panel-collapsed .layout {
1201
1222
  padding: 0;
1202
1223
  overflow: hidden;
1203
1224
  }
1204
- body.embedded-split .chat-panel {
1225
+ body.embedded-split .chat-panel,
1226
+ body.embedded-split.terminal-tabs-left .chat-panel {
1227
+ display: flex;
1228
+ flex-direction: column;
1205
1229
  height: 100%;
1230
+ overflow: hidden;
1206
1231
  border-radius: 0;
1207
1232
  }
1208
1233
  body.embedded-split .terminal-tabs-shell,
@@ -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=126", sheet: stylesheetLoaded ? {} : null });
68
+ const styleLink = new FakeElement({ href: "http://127.0.0.1:31415/styles.css?v=129", 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=148" } }),
87
+ currentScript: new FakeElement({ dataset: { appSrc: "/app.js?v=150" } }),
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=148"), "the inline loader should own app module startup");
235
+ assert.ok(html.indexOf('id="webuiBootLoader"') < html.indexOf("/app.js?v=150"), "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");
@@ -134,6 +134,48 @@ test("Mobile v2 repeatedly returns canonical project content to its Control Deck
134
134
  await context.close();
135
135
  });
136
136
 
137
+ test("embedded split terminal fills every desktop pane width with inherited sidebar classes", async ({ page }) => {
138
+ test.setTimeout(45_000);
139
+ await page.setViewportSize({ width: 1200, height: 900 });
140
+ await page.goto(baseURL);
141
+ const tabId = await page.locator("[data-tab-id]").first().getAttribute("data-tab-id");
142
+ assert.ok(tabId, "the fixture should expose a terminal tab for the embedded split");
143
+
144
+ for (const width of [721, 900, 1200]) {
145
+ await page.setViewportSize({ width, height: 900 });
146
+ await page.goto(`${baseURL}/?embed=split&tab=${encodeURIComponent(tabId)}`);
147
+ await page.locator("body").evaluate((body) => {
148
+ body.classList.add("terminal-tabs-left", "terminal-tabs-sidebar-start");
149
+ body.style.setProperty("--terminal-tabs-sidebar-width", "560px");
150
+ });
151
+ await expect(page.locator("body")).toHaveClass(/embedded-split/);
152
+ await expect(page.locator("body")).toHaveClass(/terminal-tabs-left/);
153
+ await expect(page.locator("#terminalTabsShell")).toBeHidden();
154
+ const geometry = await page.evaluate(() => {
155
+ const panel = document.querySelector(".chat-panel");
156
+ const chat = document.querySelector(".chat");
157
+ const composer = document.querySelector(".composer");
158
+ const panelRect = panel?.getBoundingClientRect();
159
+ const chatRect = chat?.getBoundingClientRect();
160
+ const composerRect = composer?.getBoundingClientRect();
161
+ const style = panel ? getComputedStyle(panel) : null;
162
+ return {
163
+ viewportWidth: window.innerWidth,
164
+ panelWidth: panelRect?.width || 0,
165
+ chatWidth: chatRect?.width || 0,
166
+ composerWidth: composerRect?.width || 0,
167
+ display: style?.display || "",
168
+ flexDirection: style?.flexDirection || "",
169
+ };
170
+ });
171
+ assert.equal(geometry.display, "flex", `embedded chat panel should remain flex at ${width}px`);
172
+ assert.equal(geometry.flexDirection, "column", `embedded chat panel should remain vertical at ${width}px`);
173
+ assert.ok(Math.abs(geometry.panelWidth - geometry.viewportWidth) <= 1, `embedded panel should fill ${width}px: ${JSON.stringify(geometry)}`);
174
+ assert.ok(Math.abs(geometry.chatWidth - geometry.panelWidth) <= 2, `embedded transcript should fill ${width}px inside the panel border: ${JSON.stringify(geometry)}`);
175
+ assert.ok(Math.abs(geometry.composerWidth - geometry.panelWidth) <= 2, `embedded composer should fill ${width}px inside the panel border: ${JSON.stringify(geometry)}`);
176
+ }
177
+ });
178
+
137
179
  test("Right, Left, Both, Sidebar rail, independent state, overlay, singleton ARIA, and reload", async ({ page }) => {
138
180
  test.setTimeout(60_000);
139
181
  await page.setViewportSize({ width: 2200, height: 1000 });