@firstpick/pi-package-webui 0.9.9 → 0.10.0

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 (56) hide show
  1. package/DEVELOPMENT.md +42 -13
  2. package/README.md +7 -7
  3. package/TECHNICAL.md +8 -8
  4. package/bin/pi-webui.mjs +197 -63
  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 +220 -73
  11. package/public/index.html +2 -2
  12. package/public/service-worker.js +1 -1
  13. package/public/styles.css +63 -15
  14. package/tests/boot-failure-diagnostics.test.mjs +3 -3
  15. package/tests/browser/intercom-conversation-viewer.spec.mjs +76 -53
  16. package/tests/browser/user-noticeable-fixes.spec.mjs +51 -0
  17. package/tests/codex-fast-mode-static.test.mjs +2 -2
  18. package/tests/composer-action-grid-reorder-static.test.mjs +3 -3
  19. package/tests/control-visibility-static.test.mjs +3 -3
  20. package/tests/controls-layout-static.test.mjs +3 -3
  21. package/tests/durable-rpc-supervisor-harness.test.mjs +9 -0
  22. package/tests/events-tree-context-menu-static.test.mjs +3 -3
  23. package/tests/fast-mode-client-static.test.mjs +1 -1
  24. package/tests/feature-decision-output-popup-static.test.mjs +2 -2
  25. package/tests/file-viewer-image-static.test.mjs +3 -3
  26. package/tests/fixtures/fake-pi.mjs +3 -3
  27. package/tests/guided-git-activation-static.test.mjs +24 -12
  28. package/tests/guided-git-fallback-runtime.test.mjs +209 -270
  29. package/tests/guided-git-fallback-ui-static.test.mjs +2 -2
  30. package/tests/guided-git-message-reliability-static.test.mjs +2 -1
  31. package/tests/guided-git-optional-feature.test.mjs +8 -5
  32. package/tests/http-endpoints-harness.test.mjs +22 -4
  33. package/tests/intercom-conversation-viewer-static.test.mjs +7 -6
  34. package/tests/intercom-tag-layout-static.test.mjs +35 -16
  35. package/tests/intercom-tag-overflow-layout.test.mjs +87 -0
  36. package/tests/main-output-loading-static.test.mjs +3 -3
  37. package/tests/middle-button-drag-scroll-static.test.mjs +3 -3
  38. package/tests/mobile-continuity-tablet-static.test.mjs +3 -3
  39. package/tests/mobile-foundation-static.test.mjs +3 -3
  40. package/tests/mobile-phone-experience-static.test.mjs +1 -1
  41. package/tests/mobile-static.test.mjs +11 -6
  42. package/tests/open-issue-wizard-static.test.mjs +1 -1
  43. package/tests/persistent-ui-layout-static.test.mjs +3 -3
  44. package/tests/prompt-input-vertical-scroll-static.test.mjs +3 -3
  45. package/tests/questionnaire-dialog.test.mjs +3 -3
  46. package/tests/remote-auth-settings-harness.test.mjs +18 -3
  47. package/tests/resource-tui-extension.test.mjs +2 -1
  48. package/tests/session-sampling-ui-static.test.mjs +3 -3
  49. package/tests/side-panel-section-height-removal-static.test.mjs +3 -3
  50. package/tests/subagent-observability-static.test.mjs +2 -2
  51. package/tests/syntax-highlighting-static.test.mjs +3 -3
  52. package/tests/theme-customizer-static.test.mjs +1 -1
  53. package/tests/tui-model-profile-selector.test.mjs +102 -0
  54. package/tests/tui-resource-selector.test.mjs +74 -0
  55. package/tests/webui-settings-locking.test.mjs +32 -1
  56. package/tests/windows-drive-cwd-picker-static.test.mjs +3 -3
package/public/app.js CHANGED
@@ -2828,7 +2828,7 @@ const OPTIONAL_FEATURES = [
2828
2828
  label: "Guided Git workflow",
2829
2829
  packageName: "@firstpick/pi-extension-git-guided-workflow",
2830
2830
  capabilityLabel: "/git-guided-workflow",
2831
- description: "Cross-surface launcher with bundled commit, branch, and pull-request prompt templates.",
2831
+ description: "Cross-surface workflow with native commit, branch, and pull-request generation commands.",
2832
2832
  setup: "git-workflow",
2833
2833
  },
2834
2834
  {
@@ -6634,18 +6634,173 @@ function intercomConversationSummarySignature(conversations) {
6634
6634
  ]));
6635
6635
  }
6636
6636
 
6637
+ let intercomConversationTagLayoutFrame = 0;
6638
+ let intercomConversationTagResizeObserver = null;
6639
+ let intercomConversationOverflowOpen = false;
6640
+
6641
+ function setIntercomConversationOverflowOpen(open, { focusMenu = false, restoreFocus = false } = {}) {
6642
+ const container = elements.intercomConversationTags;
6643
+ const overflow = container?.querySelector("button.composer-intercom-tag.overflow");
6644
+ const menu = container?.querySelector(".composer-intercom-overflow-menu");
6645
+ if (!container || !overflow || !menu) {
6646
+ intercomConversationOverflowOpen = false;
6647
+ return;
6648
+ }
6649
+
6650
+ const availableItems = [...menu.querySelectorAll("button:not([hidden])")];
6651
+ const expanded = Boolean(open && !overflow.hidden && availableItems.length);
6652
+ intercomConversationOverflowOpen = expanded;
6653
+ container.classList.toggle("overflow-open", expanded);
6654
+ overflow.setAttribute("aria-expanded", expanded ? "true" : "false");
6655
+ menu.hidden = !expanded;
6656
+
6657
+ if (expanded && focusMenu) availableItems[0]?.focus();
6658
+ else if (!expanded && restoreFocus) overflow.focus();
6659
+ }
6660
+
6661
+ function fitIntercomConversationTags() {
6662
+ const container = elements.intercomConversationTags;
6663
+ if (!container || container.hidden) return;
6664
+ const tags = [...container.querySelectorAll(":scope > button.composer-intercom-tag:not(.overflow)")];
6665
+ const overflow = container.querySelector("button.composer-intercom-tag.overflow");
6666
+ const menuItems = [...container.querySelectorAll(".composer-intercom-overflow-menu-item")];
6667
+ if (!tags.length || !overflow || menuItems.length !== tags.length) return;
6668
+
6669
+ const availableWidth = container.clientWidth;
6670
+ if (availableWidth <= 0) return;
6671
+
6672
+ for (const tag of tags) tag.hidden = false;
6673
+ overflow.hidden = false;
6674
+
6675
+ const containerStyle = getComputedStyle(container);
6676
+ const gap = Number.parseFloat(containerStyle.columnGap || containerStyle.gap) || 0;
6677
+ const tagWidths = tags.map((tag) => tag.getBoundingClientRect().width);
6678
+ const overflowWidths = new Map();
6679
+ const maxOverflowDigits = String(tags.length).length;
6680
+ for (let digits = 1; digits <= maxOverflowDigits; digits += 1) {
6681
+ overflow.textContent = `+${"0".repeat(digits)}`;
6682
+ overflowWidths.set(digits, overflow.getBoundingClientRect().width);
6683
+ }
6684
+ let visibleCount = 0;
6685
+
6686
+ for (let count = tags.length; count >= 0; count -= 1) {
6687
+ const hiddenCount = tags.length - count;
6688
+ const itemCount = count + (hiddenCount ? 1 : 0);
6689
+ const tagsWidth = tagWidths.slice(0, count).reduce((total, width) => total + width, 0);
6690
+ const overflowWidth = hiddenCount ? overflowWidths.get(String(hiddenCount).length) || 0 : 0;
6691
+ const requiredWidth = tagsWidth + overflowWidth + Math.max(0, itemCount - 1) * gap;
6692
+ if (requiredWidth <= availableWidth + 0.5) {
6693
+ visibleCount = count;
6694
+ break;
6695
+ }
6696
+ }
6697
+
6698
+ tags.forEach((tag, index) => { tag.hidden = index >= visibleCount; });
6699
+ menuItems.forEach((item, index) => { item.hidden = index < visibleCount; });
6700
+ const hiddenCount = tags.length - visibleCount;
6701
+ overflow.hidden = hiddenCount === 0;
6702
+ if (hiddenCount) {
6703
+ const label = `Show ${hiddenCount} more agent conversation${hiddenCount === 1 ? "" : "s"}`;
6704
+ overflow.textContent = `+${hiddenCount}`;
6705
+ overflow.title = `${label}.`;
6706
+ overflow.setAttribute("aria-label", label);
6707
+ if (intercomConversationOverflowOpen) setIntercomConversationOverflowOpen(true);
6708
+ } else {
6709
+ setIntercomConversationOverflowOpen(false);
6710
+ }
6711
+ }
6712
+
6713
+ function scheduleIntercomConversationTagLayout() {
6714
+ if (intercomConversationTagLayoutFrame) return;
6715
+ intercomConversationTagLayoutFrame = requestAnimationFrame(() => {
6716
+ intercomConversationTagLayoutFrame = 0;
6717
+ fitIntercomConversationTags();
6718
+ });
6719
+ }
6720
+
6721
+ function installIntercomConversationTagResizeHandling() {
6722
+ const container = elements.intercomConversationTags;
6723
+ if (!container) return;
6724
+ if (typeof ResizeObserver === "function") {
6725
+ intercomConversationTagResizeObserver = new ResizeObserver(scheduleIntercomConversationTagLayout);
6726
+ intercomConversationTagResizeObserver.observe(container);
6727
+ if (container.parentElement) intercomConversationTagResizeObserver.observe(container.parentElement);
6728
+ } else {
6729
+ window.addEventListener("resize", scheduleIntercomConversationTagLayout, { passive: true });
6730
+ }
6731
+ container.addEventListener("keydown", (event) => {
6732
+ if (event.key !== "Escape" || !intercomConversationOverflowOpen) return;
6733
+ event.preventDefault();
6734
+ event.stopPropagation();
6735
+ setIntercomConversationOverflowOpen(false, { restoreFocus: true });
6736
+ });
6737
+ container.addEventListener("focusout", () => {
6738
+ queueMicrotask(() => {
6739
+ if (intercomConversationOverflowOpen && !container.contains(document.activeElement)) setIntercomConversationOverflowOpen(false);
6740
+ });
6741
+ });
6742
+ document.addEventListener("pointerdown", (event) => {
6743
+ if (intercomConversationOverflowOpen && !container.contains(event.target)) setIntercomConversationOverflowOpen(false);
6744
+ });
6745
+ }
6746
+
6747
+ function updateIntercomConversationTag(tag, conversation) {
6748
+ const label = intercomConversationLabel(conversation);
6749
+ tag.setAttribute("aria-label", `Open agent conversation ${label}`);
6750
+ tag.title = `${label} · ${conversation.messageCount} message${conversation.messageCount === 1 ? "" : "s"}`;
6751
+ const visualSignature = JSON.stringify([label, conversation.messageCount]);
6752
+ if (tag.dataset.intercomVisualSignature === visualSignature) return;
6753
+ const children = [make("span", "composer-intercom-tag-icon", "↔"), make("span", "composer-intercom-tag-label", label)];
6754
+ if (conversation.messageCount > 0) children.push(make("span", "composer-intercom-tag-count", String(conversation.messageCount)));
6755
+ tag.replaceChildren(...children);
6756
+ tag.dataset.intercomVisualSignature = visualSignature;
6757
+ }
6758
+
6637
6759
  function renderIntercomConversationTags(tabId = activeTabId) {
6638
6760
  const container = elements.intercomConversationTags;
6639
6761
  if (!container) return;
6640
6762
  const conversations = intercomConversationSummariesByTab.get(tabId) || [];
6641
- const existingTags = new Map([...container.querySelectorAll(".composer-intercom-tag[data-intercom-conversation-id]")]
6763
+ if (!conversations.length) {
6764
+ intercomConversationOverflowOpen = false;
6765
+ container.classList.remove("overflow-open");
6766
+ container.replaceChildren();
6767
+ container.hidden = true;
6768
+ return;
6769
+ }
6770
+
6771
+ let overflow = container.querySelector("button.composer-intercom-tag.overflow");
6772
+ if (!overflow) {
6773
+ overflow = make("button", "composer-intercom-tag overflow", `+${conversations.length}`);
6774
+ overflow.type = "button";
6775
+ overflow.hidden = true;
6776
+ overflow.setAttribute("aria-haspopup", "dialog");
6777
+ overflow.setAttribute("aria-expanded", "false");
6778
+ overflow.setAttribute("aria-controls", "intercomConversationOverflowMenu");
6779
+ overflow.addEventListener("click", () => {
6780
+ const opening = !intercomConversationOverflowOpen;
6781
+ setIntercomConversationOverflowOpen(opening, { focusMenu: opening });
6782
+ });
6783
+ }
6784
+ let menu = container.querySelector(".composer-intercom-overflow-menu");
6785
+ if (!menu) {
6786
+ menu = make("div", "composer-intercom-overflow-menu");
6787
+ menu.id = "intercomConversationOverflowMenu";
6788
+ menu.hidden = true;
6789
+ menu.setAttribute("role", "dialog");
6790
+ menu.setAttribute("aria-label", "More agent conversations");
6791
+ }
6792
+ container.append(overflow, menu);
6793
+
6794
+ const existingTags = new Map([...container.querySelectorAll(":scope > .composer-intercom-tag[data-intercom-conversation-id]")]
6795
+ .map((tag) => [tag.dataset.intercomConversationId, tag]));
6796
+ const existingMenuItems = new Map([...menu.querySelectorAll(".composer-intercom-overflow-menu-item[data-intercom-conversation-id]")]
6642
6797
  .map((tag) => [tag.dataset.intercomConversationId, tag]));
6643
6798
  const orderedTags = [];
6799
+ const orderedMenuItems = [];
6644
6800
  const seenConversationIds = new Set();
6645
6801
  for (const conversation of conversations) {
6646
6802
  if (seenConversationIds.has(conversation.id)) continue;
6647
6803
  seenConversationIds.add(conversation.id);
6648
- const label = intercomConversationLabel(conversation);
6649
6804
  let tag = existingTags.get(conversation.id);
6650
6805
  if (tag) existingTags.delete(conversation.id);
6651
6806
  else {
@@ -6656,24 +6811,41 @@ function renderIntercomConversationTags(tabId = activeTabId) {
6656
6811
  tag.setAttribute("aria-controls", "intercomConversationDialog");
6657
6812
  tag.addEventListener("click", () => openIntercomConversation(tag.dataset.intercomConversationId));
6658
6813
  }
6659
- tag.setAttribute("aria-label", `Open agent conversation ${label}`);
6660
- tag.title = `${label} · ${conversation.messageCount} message${conversation.messageCount === 1 ? "" : "s"}`;
6661
- const visualSignature = JSON.stringify([label, conversation.messageCount]);
6662
- if (tag.dataset.intercomVisualSignature !== visualSignature) {
6663
- const children = [make("span", "composer-intercom-tag-icon", "↔"), make("span", "composer-intercom-tag-label", label)];
6664
- if (conversation.messageCount > 0) children.push(make("span", "composer-intercom-tag-count", String(conversation.messageCount)));
6665
- tag.replaceChildren(...children);
6666
- tag.dataset.intercomVisualSignature = visualSignature;
6667
- }
6814
+ updateIntercomConversationTag(tag, conversation);
6668
6815
  orderedTags.push(tag);
6816
+
6817
+ let menuItem = existingMenuItems.get(conversation.id);
6818
+ if (menuItem) existingMenuItems.delete(conversation.id);
6819
+ else {
6820
+ menuItem = make("button", "composer-intercom-tag composer-intercom-overflow-menu-item");
6821
+ menuItem.type = "button";
6822
+ menuItem.dataset.intercomConversationId = conversation.id;
6823
+ menuItem.setAttribute("aria-haspopup", "dialog");
6824
+ menuItem.setAttribute("aria-controls", "intercomConversationDialog");
6825
+ menuItem.addEventListener("click", () => {
6826
+ const conversationId = menuItem.dataset.intercomConversationId;
6827
+ setIntercomConversationOverflowOpen(false);
6828
+ overflow.focus();
6829
+ openIntercomConversation(conversationId);
6830
+ });
6831
+ }
6832
+ updateIntercomConversationTag(menuItem, conversation);
6833
+ orderedMenuItems.push(menuItem);
6669
6834
  }
6670
- container.classList.toggle("dense", orderedTags.length > 8);
6835
+
6671
6836
  for (const staleTag of existingTags.values()) staleTag.remove();
6672
- const currentTags = [...container.querySelectorAll(":scope > .composer-intercom-tag")];
6837
+ for (const staleItem of existingMenuItems.values()) staleItem.remove();
6838
+ const currentTags = [...container.querySelectorAll(":scope > .composer-intercom-tag[data-intercom-conversation-id]")];
6673
6839
  if (currentTags.length !== orderedTags.length || orderedTags.some((tag, index) => currentTags[index] !== tag)) {
6674
- for (const tag of orderedTags) container.append(tag);
6840
+ for (const tag of orderedTags) container.insertBefore(tag, overflow);
6841
+ }
6842
+ const currentMenuItems = [...menu.querySelectorAll(":scope > .composer-intercom-overflow-menu-item")];
6843
+ if (currentMenuItems.length !== orderedMenuItems.length || orderedMenuItems.some((tag, index) => currentMenuItems[index] !== tag)) {
6844
+ for (const menuItem of orderedMenuItems) menu.append(menuItem);
6675
6845
  }
6676
- container.hidden = orderedTags.length === 0;
6846
+ container.append(overflow, menu);
6847
+ container.hidden = false;
6848
+ scheduleIntercomConversationTagLayout();
6677
6849
  }
6678
6850
 
6679
6851
  async function refreshIntercomConversationSummaries(tabContext = activeTabContext()) {
@@ -33545,19 +33717,25 @@ function reconcileGuidedGitReviewWidgetRemoval(tabId) {
33545
33717
  return true;
33546
33718
  }
33547
33719
 
33548
- function guidedGitPromptCommandUnavailable(commandName) {
33549
- return `Guided Git browser generation requires /${commandName} from @firstpick/pi-prompts-git-pr in the originating tab.`;
33720
+ function guidedGitNativeCommandUnavailable(commandName) {
33721
+ return `Guided Git browser generation requires the /${commandName} extension command from @firstpick/pi-extension-git-guided-workflow in the originating tab. Same-named prompt templates are not used.`;
33550
33722
  }
33551
33723
 
33552
- function guidedGitPromptCompanionAvailable(tabId) {
33553
- return !isOptionalFeatureDisabled("gitWorkflow") && hasLoadedRpcCommand("git-staged-msg", { tabId });
33724
+ function hasLoadedGuidedGitNativeCommand(commandName, tabId) {
33725
+ return resolveAvailableCommand(commandName, { tabId, rpcOnly: true })?.source === "extension";
33554
33726
  }
33555
33727
 
33556
- function reportGuidedGitPromptCompanionUnavailable(tabId) {
33728
+ function guidedGitNativeCommandsAvailable(tabId) {
33729
+ return !isOptionalFeatureDisabled("gitWorkflow")
33730
+ && ["git-staged-msg", "git-branch-name", "pr"].every((commandName) => hasLoadedGuidedGitNativeCommand(commandName, tabId));
33731
+ }
33732
+
33733
+ function reportGuidedGitNativeCommandsUnavailable(tabId) {
33557
33734
  const tabContext = activeTabContext(tabId);
33735
+ const missing = ["git-staged-msg", "git-branch-name", "pr"].find((commandName) => !hasLoadedGuidedGitNativeCommand(commandName, tabId));
33558
33736
  const message = isOptionalFeatureDisabled("gitWorkflow")
33559
33737
  ? optionalFeatureUnavailableMessage("gitWorkflow")
33560
- : guidedGitPromptCommandUnavailable("git-staged-msg");
33738
+ : guidedGitNativeCommandUnavailable(missing || "git-staged-msg");
33561
33739
  addEvent(message, "warn");
33562
33740
  refreshCommands(tabContext).catch((error) => {
33563
33741
  if (isCurrentTabContext(tabContext)) addEvent(error.message || String(error), "error");
@@ -33567,8 +33745,8 @@ function reportGuidedGitPromptCompanionUnavailable(tabId) {
33567
33745
  function handleGuidedGitActivationRequest(request) {
33568
33746
  if (request?.method !== "setStatus" || request.statusKey !== GUIDED_GIT_START_STATUS_KEY) return false;
33569
33747
  const result = guidedGitActivationController.consume(request, async (tabId, activationIsCurrent) => {
33570
- if (!guidedGitPromptCompanionAvailable(tabId)) {
33571
- reportGuidedGitPromptCompanionUnavailable(tabId);
33748
+ if (!guidedGitNativeCommandsAvailable(tabId)) {
33749
+ reportGuidedGitNativeCommandsUnavailable(tabId);
33572
33750
  return;
33573
33751
  }
33574
33752
  await startGitWorkflow(tabId, { activationIsCurrent });
@@ -33604,35 +33782,13 @@ function guidedGitLaunchAdmitted(tabId) {
33604
33782
  return false;
33605
33783
  }
33606
33784
 
33607
- async function startLegacyGuidedGitWorkflowFallback(tabId) {
33608
- if (!guidedGitLaunchAdmitted(tabId)) return;
33609
- if (!guidedGitPromptCompanionAvailable(tabId)) {
33610
- addEvent(isOptionalFeatureDisabled("gitWorkflow")
33611
- ? optionalFeatureUnavailableMessage("gitWorkflow")
33612
- : "Guided Git is unavailable: install @firstpick/pi-extension-git-guided-workflow. Browser generation also requires @firstpick/pi-prompts-git-pr.", "warn");
33613
- return;
33614
- }
33615
- try {
33616
- await api("/api/git-workflow/launch-admission", { method: "POST", body: {}, tabId });
33617
- } catch (error) {
33618
- reportGuidedGitLaunchRefused("pending");
33619
- return;
33620
- }
33621
- addEvent("Using the temporary prompt-only Guided Git compatibility launcher. Install @firstpick/pi-extension-git-guided-workflow to route future starts through /git-guided-workflow.", "info");
33622
- await guidedGitActivationController.run(tabId, (_tabId, activationIsCurrent) => startGitWorkflow(tabId, { activationIsCurrent }));
33623
- }
33624
-
33625
33785
  async function launchGuidedGitWorkflow(tabId = activeTabId) {
33626
33786
  if (!tabId || !guidedGitLaunchAdmitted(tabId)) return;
33627
33787
  const launchMode = guidedGitLaunchModeForTabCatalog(commandCatalogForTab(tabId), { disabled: isOptionalFeatureDisabled("gitWorkflow") });
33628
- if (launchMode === "fallback") {
33629
- await startLegacyGuidedGitWorkflowFallback(tabId);
33630
- return;
33631
- }
33632
33788
  if (launchMode !== "extension") {
33633
33789
  addEvent(launchMode === "disabled"
33634
33790
  ? optionalFeatureUnavailableMessage("gitWorkflow")
33635
- : "Guided Git is unavailable: install @firstpick/pi-extension-git-guided-workflow. Browser generation also requires @firstpick/pi-prompts-git-pr.", "warn");
33791
+ : "Guided Git is unavailable: install @firstpick/pi-extension-git-guided-workflow and reload the Pi tab.", "warn");
33636
33792
  return;
33637
33793
  }
33638
33794
  const commandName = resolveAvailableCommandName("git-guided-workflow", { tabId, rpcOnly: true });
@@ -33645,14 +33801,14 @@ async function launchGuidedGitWorkflow(tabId = activeTabId) {
33645
33801
 
33646
33802
  async function startGitWorkflow(tabId = activeTabId, { skipSetup = false, activationIsCurrent = () => true } = {}) {
33647
33803
  if (!tabId || !activationIsCurrent()) return;
33648
- if (!guidedGitPromptCompanionAvailable(tabId)) {
33649
- reportGuidedGitPromptCompanionUnavailable(tabId);
33804
+ if (!guidedGitNativeCommandsAvailable(tabId)) {
33805
+ reportGuidedGitNativeCommandsUnavailable(tabId);
33650
33806
  return;
33651
33807
  }
33652
33808
 
33653
33809
  let setupData;
33654
33810
  try {
33655
- const response = await api("/api/git-workflow/preferences", { tabId });
33811
+ const response = await api("/api/git-workflow/preferences?includeModels=false", { tabId });
33656
33812
  setupData = response.data || {};
33657
33813
  if (!activationIsCurrent()) return;
33658
33814
  gitWorkflowPreferences = setupData.preferences || null;
@@ -34122,8 +34278,8 @@ async function loadGitWorkflowDefaultCommitMessage({ runId, tabId = activeTabId
34122
34278
 
34123
34279
  async function runGitMessagePrompt(tabId = gitWorkflowActionTabId()) {
34124
34280
  const tabContext = activeTabContext(tabId);
34125
- if (!hasLoadedRpcCommand("git-staged-msg", { tabId })) {
34126
- failGitWorkflow(new Error(guidedGitPromptCommandUnavailable("git-staged-msg")), "generate", { tabId });
34281
+ if (!hasLoadedGuidedGitNativeCommand("git-staged-msg", tabId)) {
34282
+ failGitWorkflow(new Error(guidedGitNativeCommandUnavailable("git-staged-msg")), "generate", { tabId });
34127
34283
  return;
34128
34284
  }
34129
34285
  const targetTab = tabs.find((tab) => tab.id === tabId);
@@ -34272,19 +34428,8 @@ async function loadGitWorkflowMessage({ requireFresh = false, generationId, runI
34272
34428
  return promise;
34273
34429
  }
34274
34430
 
34275
- function gitBranchNamePromptMessage() {
34276
- if (hasAvailableCommand("git-branch-name")) return "/git-branch-name";
34277
- return [
34278
- "Generate one PR branch name for the current staged work.",
34279
- "Inspect only staged changes (`git diff --cached`) and the generated commit message files if present:",
34280
- "- dev/COMMIT/staged-commit-short.txt",
34281
- "- dev/COMMIT/staged-commit-long.txt",
34282
- "",
34283
- "Write exactly one line to dev/COMMIT/staged-branch-name.txt in this format:",
34284
- "<type>/<short-feature-name>",
34285
- "",
34286
- "Rules: use lowercase kebab-case, no spaces/underscores/uppercase/trailing punctuation, 2-5 words after the slash, and no extra lines or prose in the file.",
34287
- ].join("\n");
34431
+ function gitBranchNamePromptMessage(tabId = gitWorkflowActionTabId()) {
34432
+ return hasLoadedGuidedGitNativeCommand("git-branch-name", tabId) ? "/git-branch-name" : "";
34288
34433
  }
34289
34434
 
34290
34435
  async function createGitPrBranch(tabId = gitWorkflowActionTabId()) {
@@ -34299,8 +34444,8 @@ async function createGitPrBranchManually(tabId = gitWorkflowActionTabId()) {
34299
34444
 
34300
34445
  async function runGitBranchNamePrompt(tabId = gitWorkflowActionTabId()) {
34301
34446
  const tabContext = activeTabContext(tabId);
34302
- if (!hasLoadedRpcCommand("git-branch-name", { tabId })) {
34303
- failGitWorkflow(new Error(guidedGitPromptCommandUnavailable("git-branch-name")), "message", { tabId });
34447
+ if (!hasLoadedGuidedGitNativeCommand("git-branch-name", tabId)) {
34448
+ failGitWorkflow(new Error(guidedGitNativeCommandUnavailable("git-branch-name")), "message", { tabId });
34304
34449
  return;
34305
34450
  }
34306
34451
  const targetTab = tabs.find((tab) => tab.id === tabId);
@@ -34666,8 +34811,8 @@ async function runGitPrPrompt(tabId = gitWorkflowActionTabId(), { prefixOutput =
34666
34811
  failGitWorkflow(new Error("Pi is currently running. Wait for it to finish or abort before generating a PR description."), "push", { tabId });
34667
34812
  return;
34668
34813
  }
34669
- if (!hasLoadedRpcCommand("pr", { tabId })) {
34670
- failGitWorkflow(new Error(guidedGitPromptCommandUnavailable("pr")), "push", { tabId });
34814
+ if (!hasLoadedGuidedGitNativeCommand("pr", tabId)) {
34815
+ failGitWorkflow(new Error(guidedGitNativeCommandUnavailable("pr")), "push", { tabId });
34671
34816
  return;
34672
34817
  }
34673
34818
  const workflow = gitWorkflowForTab(tabId, { create: false });
@@ -41256,7 +41401,7 @@ function updateOptionalFeatureAvailability() {
41256
41401
  optionalFeatureAvailability.bangCommandAutocomplete = hasAvailableCommand("bang-status") || hasAvailableCommand("bang-refresh");
41257
41402
  optionalFeatureAvailability.fishUserBash = hasAvailableCommand("user-bash-shell");
41258
41403
  optionalFeatureAvailability.btwCommand = hasAvailableCommand("btw") || optionalFeatureAvailability.btwCommand || statusEntries.has(BTW_WEBUI_STATUS_KEY) || widgets.has(BTW_OUTPUT_WIDGET_KEY);
41259
- optionalFeatureAvailability.gitWorkflow = hasAvailableCommand("git-guided-workflow") || hasAvailableCommand("git-staged-msg");
41404
+ optionalFeatureAvailability.gitWorkflow = hasAvailableCommand("git-guided-workflow") || hasLoadedGuidedGitNativeCommand("git-staged-msg", activeTabId);
41260
41405
  optionalFeatureAvailability.releaseNpm = hasAvailableCommand("release-npm");
41261
41406
  optionalFeatureAvailability.releaseAur = hasAvailableCommand("release-aur");
41262
41407
  optionalFeatureAvailability.aurReview = hasAvailableCommand("aur-review") || optionalFeatureAvailability.aurReview || widgets.has(AUR_REVIEW_RPC_WIDGET_KEY);
@@ -44248,10 +44393,11 @@ async function openNativeResumeSelector(scope = "current", { query = "" } = {})
44248
44393
  setNativeCommandError("");
44249
44394
  try {
44250
44395
  const result = await nativeCommandApi("/api/switch-session", { method: "POST", body: { sessionPath: selectedItem.session.path } });
44251
- applyResponseTab(result);
44252
- addTransientMessage({ role: "native", title: "/resume", content: result.data?.message || "Resumed selected session.", level: "info" });
44396
+ const resumedTab = syncResponseTabs(result);
44253
44397
  closeNativeCommandDialog();
44254
- await refreshAll();
44398
+ if (resumedTab?.id) await switchTab(resumedTab.id);
44399
+ else await refreshAll();
44400
+ addTransientMessage({ role: "native", title: "/resume", content: result.data?.message || "Resumed selected session in a new terminal tab.", level: "info" });
44255
44401
  } catch (error) {
44256
44402
  setNativeCommandError(error.message || String(error));
44257
44403
  }
@@ -51278,6 +51424,7 @@ restoreBusyPromptBehaviorSetting();
51278
51424
  syncMobileComposerDisclosureLayout();
51279
51425
  updateComposerModeButtons();
51280
51426
  installSessionSkillTagResizeHandling();
51427
+ installIntercomConversationTagResizeHandling();
51281
51428
  updateOptionalFeatureAvailability();
51282
51429
  renderOptionalFeatureMigrationSurface();
51283
51430
  refreshOptionalFeaturePackageStatuses({ announce: true });
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=145" />
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.
@@ -1889,7 +1889,7 @@
1889
1889
  </form>
1890
1890
  </dialog>
1891
1891
 
1892
- <script id="webuiBootLoader" data-app-src="/app.js?v=175">
1892
+ <script id="webuiBootLoader" data-app-src="/app.js?v=177">
1893
1893
  (() => {
1894
1894
  "use strict";
1895
1895
 
@@ -1,4 +1,4 @@
1
- const CACHE_NAME = "pi-webui-pwa-v142";
1
+ const CACHE_NAME = "pi-webui-pwa-v145";
2
2
  const APP_SHELL = [
3
3
  "/",
4
4
  "/index.html",
package/public/styles.css CHANGED
@@ -4954,8 +4954,11 @@ button.subagent-gate-attempt:focus-visible {
4954
4954
  padding-top: 0.38rem;
4955
4955
  min-width: 0;
4956
4956
  max-width: 100%;
4957
- max-height: none;
4958
- overflow: visible;
4957
+ max-height: min(32rem, calc(var(--visual-viewport-height, 100dvh) - 6rem));
4958
+ overflow-x: hidden;
4959
+ overflow-y: auto;
4960
+ overscroll-behavior: contain;
4961
+ scrollbar-gutter: stable;
4959
4962
  }
4960
4963
  .terminal-tab-group:hover .terminal-tab-group-menu,
4961
4964
  .terminal-tab-group:focus-within .terminal-tab-group-menu,
@@ -9681,30 +9684,30 @@ summary { cursor: pointer; color: var(--warning); }
9681
9684
  display: none !important;
9682
9685
  }
9683
9686
  .composer-intercom-tags {
9687
+ position: relative;
9684
9688
  pointer-events: auto;
9685
- display: grid;
9686
- grid-auto-flow: column;
9687
- grid-auto-columns: minmax(0, 1fr);
9688
- flex: 0 1 17rem;
9689
+ display: inline-flex;
9690
+ flex: 0 1 50%;
9691
+ flex-direction: row-reverse;
9689
9692
  align-items: center;
9690
9693
  gap: 0.28rem;
9691
9694
  min-width: 0;
9692
- max-width: min(17rem, 100%);
9695
+ max-width: 50%;
9693
9696
  padding-block: 0.12rem;
9697
+ overflow: hidden;
9694
9698
  }
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;
9699
+ .composer-intercom-tags.overflow-open {
9700
+ overflow: visible;
9700
9701
  }
9702
+ .composer-intercom-tags[hidden] { display: none !important; }
9701
9703
  .composer-intercom-tag {
9702
9704
  display: inline-flex;
9705
+ flex: 0 0 auto;
9703
9706
  align-items: center;
9704
9707
  gap: 0.34rem;
9705
- width: 100%;
9708
+ width: auto;
9706
9709
  min-width: 0;
9707
- max-width: 100%;
9710
+ max-width: min(13rem, 100%);
9708
9711
  min-height: 0;
9709
9712
  margin: 0;
9710
9713
  padding: 0.14rem 0.5rem;
@@ -9751,9 +9754,53 @@ summary { cursor: pointer; color: var(--warning); }
9751
9754
  line-height: 1.1;
9752
9755
  text-align: center;
9753
9756
  }
9757
+ .composer-intercom-tag.overflow {
9758
+ color: var(--ctp-subtext0);
9759
+ font-variant-numeric: tabular-nums;
9760
+ border-color: rgba(166, 173, 200, 0.30);
9761
+ background: linear-gradient(120deg, rgba(166, 173, 200, 0.22), rgba(166, 173, 200, 0.08)), var(--ctp-crust);
9762
+ }
9763
+ .composer-intercom-tag.overflow[aria-expanded="true"] {
9764
+ color: var(--ctp-green);
9765
+ border-color: rgba(166, 227, 161, 0.78);
9766
+ box-shadow: 0 0.42rem 1rem rgba(var(--ctp-crust-rgb), 0.48), 0 0 1.1rem rgba(166, 227, 161, 0.3);
9767
+ }
9768
+ .composer-intercom-overflow-menu {
9769
+ position: absolute;
9770
+ right: 0;
9771
+ bottom: calc(100% + 0.42rem);
9772
+ z-index: 150;
9773
+ display: grid;
9774
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
9775
+ gap: 0.34rem;
9776
+ box-sizing: border-box;
9777
+ width: min(32rem, calc(100vw - 1.5rem));
9778
+ max-height: min(42vh, 18rem);
9779
+ padding: 0.46rem;
9780
+ overflow-y: auto;
9781
+ overscroll-behavior: contain;
9782
+ pointer-events: auto;
9783
+ border: 1px solid rgba(166, 227, 161, 0.36);
9784
+ border-radius: 0.9rem;
9785
+ background: var(--ctp-crust);
9786
+ 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);
9787
+ }
9788
+ .composer-intercom-overflow-menu[hidden] {
9789
+ display: none !important;
9790
+ }
9791
+ .composer-intercom-overflow-menu .composer-intercom-tag {
9792
+ width: 100%;
9793
+ max-width: none;
9794
+ min-height: 2rem;
9795
+ }
9754
9796
  @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%; }
9797
+ .composer-intercom-tags { flex: 0 0 100%; width: 100%; min-width: 0; max-width: 100%; }
9756
9798
  .composer-intercom-tag { min-height: 44px; }
9799
+ .composer-intercom-overflow-menu {
9800
+ width: min(32rem, calc(100vw - 1rem));
9801
+ max-height: min(50vh, 20rem);
9802
+ }
9803
+ .composer-intercom-overflow-menu .composer-intercom-tag { min-height: 44px; }
9757
9804
  }
9758
9805
  .composer-feature-category-tag {
9759
9806
  flex: 0 1 auto;
@@ -19294,6 +19341,7 @@ body:has(#undoToast:not([hidden])) .notice-toast-stack { bottom: calc(max(1rem,
19294
19341
  }
19295
19342
  body.mobile-composer-disclosure .composer-actions-panel > .composer-context-tags {
19296
19343
  display: flex;
19344
+ flex-wrap: wrap;
19297
19345
  min-height: 44px;
19298
19346
  padding: 0.3rem;
19299
19347
  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=145", 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=177" } }),
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=177"), "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");