@shepai/cli 1.100.0 → 1.101.0-pr297.8d52b60

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 (143) hide show
  1. package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.d.ts.map +1 -1
  2. package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.js +1 -1
  3. package/dist/src/presentation/web/components/common/drawer-action-bar/drawer-action-bar.d.ts.map +1 -1
  4. package/dist/src/presentation/web/components/common/drawer-action-bar/drawer-action-bar.js +7 -6
  5. package/dist/src/presentation/web/components/common/feature-drawer-tabs/activity-tab.d.ts.map +1 -1
  6. package/dist/src/presentation/web/components/common/feature-drawer-tabs/activity-tab.js +50 -8
  7. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.d.ts +4 -1
  8. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.d.ts.map +1 -1
  9. package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.js +31 -11
  10. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.d.ts.map +1 -1
  11. package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.js +35 -2
  12. package/dist/tsconfig.build.tsbuildinfo +1 -1
  13. package/package.json +1 -1
  14. package/web/.next/BUILD_ID +1 -1
  15. package/web/.next/build-manifest.json +2 -2
  16. package/web/.next/fallback-build-manifest.json +2 -2
  17. package/web/.next/prerender-manifest.json +3 -3
  18. package/web/.next/required-server-files.js +3 -3
  19. package/web/.next/required-server-files.json +3 -3
  20. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +20 -20
  21. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  22. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  23. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +25 -25
  24. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  25. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  26. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +25 -25
  27. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  28. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  29. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +18 -18
  30. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  31. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  32. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +20 -20
  33. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  34. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  35. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +25 -25
  36. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  37. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  38. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +25 -25
  39. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  40. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  41. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +18 -18
  42. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  43. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  44. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +18 -18
  45. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  46. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  47. package/web/.next/server/app/_global-error.html +2 -2
  48. package/web/.next/server/app/_global-error.rsc +1 -1
  49. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  50. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  51. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  52. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  53. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  54. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  55. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  56. package/web/.next/server/app/settings/page/server-reference-manifest.json +5 -5
  57. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  58. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  59. package/web/.next/server/app/skills/page/server-reference-manifest.json +6 -6
  60. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  61. package/web/.next/server/app/tools/page/server-reference-manifest.json +6 -6
  62. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  63. package/web/.next/server/app/version/page/server-reference-manifest.json +1 -1
  64. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  65. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
  66. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
  67. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_c757eb00.js +1 -1
  68. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_c757eb00.js.map +1 -1
  69. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_7eb49631.js +1 -1
  70. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_7eb49631.js.map +1 -1
  71. package/web/.next/server/chunks/ssr/[root-of-the-server]__11033878._.js +1 -1
  72. package/web/.next/server/chunks/ssr/[root-of-the-server]__11033878._.js.map +1 -1
  73. package/web/.next/server/chunks/ssr/[root-of-the-server]__19fb0bfe._.js +1 -1
  74. package/web/.next/server/chunks/ssr/[root-of-the-server]__19fb0bfe._.js.map +1 -1
  75. package/web/.next/server/chunks/ssr/[root-of-the-server]__24dd0927._.js +2 -2
  76. package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
  77. package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js.map +1 -1
  78. package/web/.next/server/chunks/ssr/[root-of-the-server]__3d6f6b0e._.js +1 -1
  79. package/web/.next/server/chunks/ssr/[root-of-the-server]__3d6f6b0e._.js.map +1 -1
  80. package/web/.next/server/chunks/ssr/[root-of-the-server]__42020c54._.js +1 -1
  81. package/web/.next/server/chunks/ssr/[root-of-the-server]__42020c54._.js.map +1 -1
  82. package/web/.next/server/chunks/ssr/[root-of-the-server]__5d87af2e._.js +1 -1
  83. package/web/.next/server/chunks/ssr/[root-of-the-server]__845a9d2a._.js +1 -1
  84. package/web/.next/server/chunks/ssr/[root-of-the-server]__845a9d2a._.js.map +1 -1
  85. package/web/.next/server/chunks/ssr/[root-of-the-server]__89e8a5cc._.js +2 -2
  86. package/web/.next/server/chunks/ssr/[root-of-the-server]__9cb60e1e._.js +1 -1
  87. package/web/.next/server/chunks/ssr/[root-of-the-server]__9cb60e1e._.js.map +1 -1
  88. package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js +2 -2
  89. package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js.map +1 -1
  90. package/web/.next/server/chunks/ssr/[root-of-the-server]__fdc75809._.js +1 -1
  91. package/web/.next/server/chunks/ssr/[root-of-the-server]__fdc75809._.js.map +1 -1
  92. package/web/.next/server/chunks/ssr/_135edb9c._.js +1 -1
  93. package/web/.next/server/chunks/ssr/_135edb9c._.js.map +1 -1
  94. package/web/.next/server/chunks/ssr/{_5e02bbe2._.js → _55d90438._.js} +2 -2
  95. package/web/.next/server/chunks/ssr/{_5e02bbe2._.js.map → _55d90438._.js.map} +1 -1
  96. package/web/.next/server/chunks/ssr/_8dacd1e7._.js +1 -1
  97. package/web/.next/server/chunks/ssr/_8dacd1e7._.js.map +1 -1
  98. package/web/.next/server/chunks/ssr/{_4e8f836f._.js → _ca4b6ca9._.js} +2 -2
  99. package/web/.next/server/chunks/ssr/{_4e8f836f._.js.map → _ca4b6ca9._.js.map} +1 -1
  100. package/web/.next/server/chunks/ssr/_cc77a143._.js +1 -1
  101. package/web/.next/server/chunks/ssr/_cc77a143._.js.map +1 -1
  102. package/web/.next/server/chunks/ssr/{_3e44c3e3._.js → _d0e455fd._.js} +2 -2
  103. package/web/.next/server/chunks/ssr/{_3e44c3e3._.js.map → _d0e455fd._.js.map} +1 -1
  104. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
  105. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
  106. package/web/.next/server/chunks/ssr/src_presentation_web_3c53a23d._.js +2 -2
  107. package/web/.next/server/chunks/ssr/src_presentation_web_3c53a23d._.js.map +1 -1
  108. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_befd865a.js +1 -1
  109. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_befd865a.js.map +1 -1
  110. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js +1 -1
  111. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js.map +1 -1
  112. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js +1 -1
  113. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js.map +1 -1
  114. package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js +1 -1
  115. package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js.map +1 -1
  116. package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js +1 -1
  117. package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js.map +1 -1
  118. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js +1 -1
  119. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js.map +1 -1
  120. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
  121. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
  122. package/web/.next/server/chunks/ssr/src_presentation_web_ec8c7a4f._.js +2 -2
  123. package/web/.next/server/chunks/ssr/src_presentation_web_ec8c7a4f._.js.map +1 -1
  124. package/web/.next/server/pages/500.html +2 -2
  125. package/web/.next/server/server-reference-manifest.js +1 -1
  126. package/web/.next/server/server-reference-manifest.json +30 -30
  127. package/web/.next/static/chunks/{f64b94a710c96ac2.js → 020e3cf371dc3668.js} +1 -1
  128. package/web/.next/static/chunks/{487d68ae2b90bb00.js → 062db6b08d15886a.js} +2 -2
  129. package/web/.next/static/chunks/0a113dc589f3a485.css +1 -0
  130. package/web/.next/static/chunks/{2c18e017bb6d9ff5.js → 26c849050fe49dc8.js} +1 -1
  131. package/web/.next/static/chunks/{7da527b591d16043.js → 4b636b281e40b7f9.js} +1 -1
  132. package/web/.next/static/chunks/{e84968351a0c2f24.js → 6220dc2afba28980.js} +1 -1
  133. package/web/.next/static/chunks/{4345d35c3109f22e.js → 6f49b4b4563a1763.js} +1 -1
  134. package/web/.next/static/chunks/{4809dbfebf879dc6.js → 76beaf5f0db52643.js} +1 -1
  135. package/web/.next/static/chunks/81924887fd503ef3.js +2 -0
  136. package/web/.next/static/chunks/{6af8daf39e3b9927.js → 845632fe4fbe1082.js} +1 -1
  137. package/web/.next/static/chunks/{e56a63dfbb8721d2.js → 9c2c90aca9ec65ae.js} +1 -1
  138. package/web/.next/static/chunks/{6ff3297c1cab41fb.js → cd4e1d340f1be08e.js} +1 -1
  139. package/web/.next/static/chunks/aaa4116784d11baf.js +0 -2
  140. package/web/.next/static/chunks/cf63857c936b4ca1.css +0 -1
  141. /package/web/.next/static/{ECDLMMv6xmDChEpeONYd6 → 9YFN1qpApQJE6EyH43wLv}/_buildManifest.js +0 -0
  142. /package/web/.next/static/{ECDLMMv6xmDChEpeONYd6 → 9YFN1qpApQJE6EyH43wLv}/_clientMiddlewareManifest.json +0 -0
  143. /package/web/.next/static/{ECDLMMv6xmDChEpeONYd6 → 9YFN1qpApQJE6EyH43wLv}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"feature-drawer-client.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/control-center-drawer/feature-drawer-client.tsx"],"names":[],"mappings":"AAsCA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAG/D,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,UAAU,CAAC;IACjB,8FAA8F;IAC9F,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB;AAED,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,wBAAwB,2CA4iB1F"}
1
+ {"version":3,"file":"feature-drawer-client.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/control-center-drawer/feature-drawer-client.tsx"],"names":[],"mappings":"AAsCA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAG/D,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,UAAU,CAAC;IACjB,8FAA8F;IAC9F,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB;AAED,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,wBAAwB,2CA6iB1F"}
@@ -329,7 +329,7 @@ export function FeatureDrawerClient({ view: initialView, urlTab }) {
329
329
  // ── Body ──────────────────────────────────────────────────────────────
330
330
  let body = null;
331
331
  if (view.type === 'feature' && featureNode) {
332
- body = (_jsx(FeatureDrawerTabs, { featureNode: featureNode, featureId: featureNode.featureId, initialTab: view.initialTab, urlTab: urlTab, prdData: prdData, prdSelections: prdSelections, onPrdSelect: (qId, oId) => setPrdSelections((prev) => ({ ...prev, [qId]: oId })), onPrdApprove: handlePrdApprove, onPrdReject: handlePrdReject, isPrdLoading: isLoadingPrd, techData: techData, onTechApprove: handleTechApprove, onTechReject: handleTechReject, isTechLoading: isLoadingTech, productData: isLoadingTechProduct ? null : techProductData, mergeData: mergeData, onMergeApprove: handleMergeApprove, onMergeReject: handleMergeReject, isMergeLoading: isLoadingMerge, isRejecting: isRejecting, chatInput: chatInput, onChatInputChange: setChatInput }));
332
+ body = (_jsx(FeatureDrawerTabs, { featureNode: featureNode, featureId: featureNode.featureId, initialTab: view.initialTab, urlTab: urlTab, sseEvents: events, prdData: prdData, prdSelections: prdSelections, onPrdSelect: (qId, oId) => setPrdSelections((prev) => ({ ...prev, [qId]: oId })), onPrdApprove: handlePrdApprove, onPrdReject: handlePrdReject, isPrdLoading: isLoadingPrd, techData: techData, onTechApprove: handleTechApprove, onTechReject: handleTechReject, isTechLoading: isLoadingTech, productData: isLoadingTechProduct ? null : techProductData, mergeData: mergeData, onMergeApprove: handleMergeApprove, onMergeReject: handleMergeReject, isMergeLoading: isLoadingMerge, isRejecting: isRejecting, chatInput: chatInput, onChatInputChange: setChatInput }));
333
333
  }
334
334
  return (_jsx(BaseDrawer, { open: isOpen, onClose: attemptClose, size: "md", modal: false, header: header, "data-testid": view.type === 'feature' ? 'feature-drawer' : 'repository-drawer', children: body }));
335
335
  }
@@ -1 +1 @@
1
- {"version":3,"file":"drawer-action-bar.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/drawer-action-bar/drawer-action-bar.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,oBAAoB,EAAoB,MAAM,4BAA4B,CAAC;AAmEzF,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,mBAAmB,EACnB,YAAoB,EACpB,WAAmB,EACnB,QAAQ,EACR,SAAS,EAAE,mBAAmB,EAC9B,iBAAiB,GAClB,EAAE,oBAAoB,2CA+XtB"}
1
+ {"version":3,"file":"drawer-action-bar.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/drawer-action-bar/drawer-action-bar.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,oBAAoB,EAAoB,MAAM,4BAA4B,CAAC;AAmEzF,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,mBAAmB,EACnB,YAAoB,EACpB,WAAmB,EACnB,QAAQ,EACR,SAAS,EAAE,mBAAmB,EAC9B,iBAAiB,GAClB,EAAE,oBAAoB,2CA2XtB"}
@@ -83,8 +83,9 @@ export function DrawerActionBar({ onReject, onApprove, approveLabel, revisionPla
83
83
  const [hoverExpanded, setHoverExpanded] = useState(false);
84
84
  const [ctrlHeld, setCtrlHeld] = useState(false);
85
85
  const [shiftHeld, setShiftHeld] = useState(false);
86
- const approveExpanded = hoverExpanded || (ctrlHeld && shiftHeld);
87
- const rejectHighlighted = ctrlHeld && !shiftHeld;
86
+ const hasText = chatInput.trim().length > 0;
87
+ const approveExpanded = hasText ? hoverExpanded || (ctrlHeld && shiftHeld) : !hoverExpanded;
88
+ const rejectHighlighted = hasText ? ctrlHeld && !shiftHeld : false;
88
89
  const dragCounterRef = useRef(0);
89
90
  const sessionIdRef = useRef(crypto.randomUUID());
90
91
  const formRef = useRef(null);
@@ -247,8 +248,8 @@ export function DrawerActionBar({ onReject, onApprove, approveLabel, revisionPla
247
248
  function handleFormSubmit(e) {
248
249
  e.preventDefault();
249
250
  const text = chatInput.trim();
250
- if (hoverExpanded || (ctrlHeld && shiftHeld)) {
251
- // Approve mode (hovering arrow or Shift held)
251
+ if (approveExpanded) {
252
+ // Approve mode
252
253
  approveSound.play();
253
254
  onApprove();
254
255
  clearForm();
@@ -269,13 +270,13 @@ export function DrawerActionBar({ onReject, onApprove, approveLabel, revisionPla
269
270
  }
270
271
  }, []);
271
272
  const modKey = typeof navigator !== 'undefined' && /Mac/i.test(navigator.userAgent) ? '⌘' : 'Ctrl';
272
- return (_jsxs("div", { className: "border-border shrink-0 border-t", children: [children, onReject ? (_jsx(TooltipProvider, { delayDuration: 400, children: _jsx("form", { ref: formRef, onSubmit: handleFormSubmit, className: "p-3", children: _jsx("div", { role: "region", "aria-label": "File drop zone", "data-drag-over": isDragOver ? 'true' : 'false', onDragEnter: handleDragEnter, onDragLeave: handleDragLeave, onDragOver: handleDragOver, onDrop: handleDrop, className: cn('rounded-md border-2 border-transparent transition-colors', isDragOver && 'border-primary/50 bg-primary/5'), children: _jsxs("div", { className: "border-input focus-within:ring-ring/50 focus-within:border-ring flex flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow] focus-within:ring-[3px]", children: [_jsx(Textarea, { placeholder: revisionPlaceholder ?? 'Ask AI to revise...', "aria-label": revisionPlaceholder ?? 'Ask AI to revise...', disabled: disabled, value: chatInput, onChange: (e) => setChatInput(e.target.value), onKeyDown: handleKeyDown, onPaste: handlePaste, rows: 3, className: "max-h-[35dvh] min-h-0 flex-1 resize-none overflow-y-auto rounded-none border-0 shadow-none focus-visible:ring-0", "data-testid": "drawer-chat-input" }), attachments.length > 0 && (_jsx("div", { className: "flex flex-wrap items-center gap-1.5 px-3 py-2", children: attachments.map((file) => (_jsx(AttachmentChip, { name: file.name, size: file.size, mimeType: file.mimeType, path: file.path, onRemove: () => handleRemoveFile(file.id), disabled: disabled, loading: file.loading }, file.id))) })), uploadError ? (_jsx("p", { className: "text-destructive px-3 pb-2 text-xs", children: uploadError })) : null, _jsxs("div", { className: "border-input flex items-center gap-2 border-t px-3 py-1.5", children: [_jsxs("span", { className: "text-muted-foreground flex-1 truncate text-[11px]", children: [_jsxs("kbd", { className: "bg-muted rounded px-1 py-0.5 font-mono text-[10px]", children: [modKey, "+Enter"] }), ' ', "reject", _jsx("span", { className: "mx-1 opacity-40", children: "|" }), _jsxs("kbd", { className: "bg-muted rounded px-1 py-0.5 font-mono text-[10px]", children: [modKey, "+Shift+Enter"] }), ' ', "approve"] }), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { type: "button", onClick: handleAddFiles, disabled: disabled, "aria-label": "Attach files", className: "text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors", children: _jsx(PaperclipIcon, { className: "h-4 w-4" }) }) }), _jsx(TooltipContent, { side: "top", children: "Attach files" })] }), _jsx("div", { onMouseLeave: () => setHoverExpanded(false), children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsxs("button", { type: "submit", disabled: disabled, "data-testid": "drawer-action-submit", className: cn('relative flex h-8 min-w-[10rem] cursor-pointer items-center overflow-hidden rounded-md border pr-10 pl-4 text-sm font-medium whitespace-nowrap transition-colors', 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50', approveExpanded
273
+ return (_jsxs("div", { className: "border-border shrink-0 border-t", children: [children, onReject ? (_jsx(TooltipProvider, { delayDuration: 400, children: _jsx("form", { ref: formRef, onSubmit: handleFormSubmit, className: "p-3", children: _jsx("div", { role: "region", "aria-label": "File drop zone", "data-drag-over": isDragOver ? 'true' : 'false', onDragEnter: handleDragEnter, onDragLeave: handleDragLeave, onDragOver: handleDragOver, onDrop: handleDrop, className: cn('rounded-md border-2 border-transparent transition-colors', isDragOver && 'border-primary/50 bg-primary/5'), children: _jsxs("div", { className: "border-input focus-within:ring-ring/50 focus-within:border-ring flex flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow] focus-within:ring-[3px]", children: [_jsx(Textarea, { placeholder: revisionPlaceholder ?? 'Ask AI to revise...', "aria-label": revisionPlaceholder ?? 'Ask AI to revise...', disabled: disabled, value: chatInput, onChange: (e) => setChatInput(e.target.value), onKeyDown: handleKeyDown, onPaste: handlePaste, rows: 3, className: "max-h-[35dvh] min-h-0 flex-1 resize-none overflow-y-auto rounded-none border-0 shadow-none focus-visible:ring-0", "data-testid": "drawer-chat-input" }), attachments.length > 0 && (_jsx("div", { className: "flex flex-wrap items-center gap-1.5 px-3 py-2", children: attachments.map((file) => (_jsx(AttachmentChip, { name: file.name, size: file.size, mimeType: file.mimeType, path: file.path, onRemove: () => handleRemoveFile(file.id), disabled: disabled, loading: file.loading }, file.id))) })), uploadError ? (_jsx("p", { className: "text-destructive px-3 pb-2 text-xs", children: uploadError })) : null, _jsxs("div", { className: "border-input flex items-center gap-2 border-t px-3 py-1.5", children: [_jsxs("span", { className: "text-muted-foreground flex-1 truncate text-[11px]", children: [_jsxs("kbd", { className: "bg-muted rounded px-1 py-0.5 font-mono text-[10px]", children: [modKey, "+Enter"] }), ' ', hasText ? 'reject' : 'approve'] }), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { type: "button", onClick: handleAddFiles, disabled: disabled, "aria-label": "Attach files", className: "text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors", children: _jsx(PaperclipIcon, { className: "h-4 w-4" }) }) }), _jsx(TooltipContent, { side: "top", children: "Attach files" })] }), _jsx("div", { onMouseLeave: () => setHoverExpanded(false), children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsxs("button", { type: "submit", disabled: disabled, "data-testid": "drawer-action-submit", className: cn('relative flex h-8 min-w-[10rem] cursor-pointer items-center overflow-hidden rounded-md border pr-10 pl-4 text-sm font-medium whitespace-nowrap transition-colors', 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50', approveExpanded
273
274
  ? 'border-blue-400/60 text-white'
274
275
  : rejectHighlighted
275
276
  ? 'border-primary bg-muted ring-primary/30 shadow-sm ring-1'
276
277
  : 'border-border bg-muted/50 hover:bg-muted shadow-sm'), children: [_jsx("div", { className: "pointer-events-none absolute inset-0 bg-blue-500/85 transition-transform duration-300 ease-in-out", style: {
277
278
  transform: approveExpanded ? 'translateX(0)' : 'translateX(100%)',
278
- } }), _jsxs("span", { className: cn('absolute inset-0 z-10 flex items-center justify-center gap-1.5 pr-8 transition-opacity duration-300', approveExpanded ? 'opacity-0' : 'opacity-100'), children: [_jsx(Send, { className: "h-3.5 w-3.5 shrink-0" }), "Reject"] }), _jsxs("span", { className: cn('absolute inset-0 z-10 flex items-center justify-center gap-1.5 text-white transition-opacity duration-300', approveExpanded ? 'opacity-100' : 'opacity-0'), children: [_jsx(Check, { className: "h-3.5 w-3.5 shrink-0" }), approveLabel] }), _jsx("span", { className: cn('border-input/60 absolute inset-y-0 right-0 z-20 flex w-8 cursor-pointer items-center justify-center rounded-r-[5px] border-l bg-blue-500/85 transition-opacity duration-300', approveExpanded && 'pointer-events-none opacity-0'), onMouseEnter: () => setHoverExpanded(true), children: _jsx(ChevronLeft, { className: "h-3.5 w-3.5 text-white" }) })] }) }), _jsx(TooltipContent, { side: "top", children: approveExpanded ? 'Approve' : 'Send revision feedback' })] }) })] })] }) }) }) })) : (_jsx("div", { className: "flex items-center gap-2 px-4 pb-4", children: _jsx(Button, { type: "button", className: "flex-1", disabled: disabled, onClick: () => {
279
+ } }), _jsxs("span", { className: cn('absolute inset-0 z-10 flex items-center justify-center gap-1.5 pr-8 transition-opacity duration-300', approveExpanded ? 'opacity-0' : 'opacity-100'), children: [_jsx(Send, { className: "h-3.5 w-3.5 shrink-0" }), "Reject"] }), _jsxs("span", { className: cn('absolute inset-0 z-10 flex items-center justify-center gap-1.5 text-white transition-opacity duration-300', approveExpanded ? 'opacity-100' : 'opacity-0'), children: [_jsx(Check, { className: "h-3.5 w-3.5 shrink-0" }), approveLabel] }), _jsx("span", { className: cn('border-input/60 absolute inset-y-0 right-0 z-20 flex w-8 cursor-pointer items-center justify-center rounded-r-[5px] border-l bg-blue-500/85 transition-opacity duration-300', !hasText && !hoverExpanded && 'pointer-events-none opacity-0'), onMouseEnter: () => setHoverExpanded(true), children: _jsx(ChevronLeft, { className: "h-3.5 w-3.5 text-white" }) })] }) }), _jsx(TooltipContent, { side: "top", children: approveExpanded ? approveLabel : 'Send revision feedback' })] }) })] })] }) }) }) })) : (_jsx("div", { className: "flex items-center gap-2 px-4 pb-4", children: _jsx(Button, { type: "button", className: "flex-1", disabled: disabled, onClick: () => {
279
280
  approveSound.play();
280
281
  onApprove();
281
282
  }, children: approveLabel }) }))] }));
@@ -1 +1 @@
1
- {"version":3,"file":"activity-tab.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/feature-drawer-tabs/activity-tab.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,eAAe,EACf,qBAAqB,EACtB,MAAM,yCAAyC,CAAC;AAIjD,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,iBAAiB,CAAC,EAAE,qBAAqB,EAAE,CAAC;CAC7C;AA6BD;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAChC,+BAA+B;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,mEAAmE;IACnE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,8DAA8D;IAC9D,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;CACjC;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,eAAe,EAAE,EAC1B,QAAQ,CAAC,EAAE,qBAAqB,EAAE,GACjC,iBAAiB,EAAE,CAgErB;AAMD,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAAE,gBAAgB,2CAyD3F"}
1
+ {"version":3,"file":"activity-tab.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/feature-drawer-tabs/activity-tab.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,eAAe,EACf,qBAAqB,EACtB,MAAM,yCAAyC,CAAC;AA8CjD,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,iBAAiB,CAAC,EAAE,qBAAqB,EAAE,CAAC;CAC7C;AA6BD;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAChC,+BAA+B;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,mEAAmE;IACnE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,8DAA8D;IAC9D,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;CACjC;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,eAAe,EAAE,EAC1B,QAAQ,CAAC,EAAE,qBAAqB,EAAE,GACjC,iBAAiB,EAAE,CAgErB;AAMD,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAAE,gBAAgB,2CA4D3F"}
@@ -1,8 +1,48 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { useState, useEffect, useRef } from 'react';
3
4
  import { Loader2, AlertCircle, Clock } from 'lucide-react';
4
5
  import { InlineAttachments } from '../../common/inline-attachments/index.js';
5
6
  import { formatDuration } from '../../../lib/format-duration.js';
7
+ /**
8
+ * Computes the effective duration for a phase timing entry.
9
+ * For completed phases, uses the server-provided durationMs.
10
+ * For in-progress phases (has startedAt but no completedAt), computes
11
+ * elapsed time client-side so the UI shows a live-updating timer.
12
+ */
13
+ function getEffectiveDuration(timing, now) {
14
+ if (timing.durationMs != null && timing.durationMs > 0)
15
+ return timing.durationMs;
16
+ if (!timing.completedAt && timing.startedAt) {
17
+ const started = new Date(timing.startedAt).getTime();
18
+ if (!Number.isNaN(started))
19
+ return Math.max(0, now - started);
20
+ }
21
+ return 0;
22
+ }
23
+ /** Returns true if any non-lifecycle phase is still in progress. */
24
+ function hasRunningPhase(timings) {
25
+ return timings.some((t) => !t.phase.startsWith('run:') && !t.completedAt && t.startedAt);
26
+ }
27
+ /** Hook that ticks every second while there are running phases. */
28
+ function useTickingNow(timings) {
29
+ const [now, setNow] = useState(Date.now);
30
+ const intervalRef = useRef(null);
31
+ useEffect(() => {
32
+ const running = timings ? hasRunningPhase(timings) : false;
33
+ if (running) {
34
+ // Tick every second
35
+ intervalRef.current = setInterval(() => setNow(Date.now()), 1000);
36
+ }
37
+ return () => {
38
+ if (intervalRef.current) {
39
+ clearInterval(intervalRef.current);
40
+ intervalRef.current = null;
41
+ }
42
+ };
43
+ }, [timings]);
44
+ return now;
45
+ }
6
46
  const NODE_TO_PHASE = {
7
47
  analyze: 'Analyzing',
8
48
  requirements: 'Requirements',
@@ -94,6 +134,7 @@ export function buildLifecycleTimeline(timings, feedback) {
94
134
  * Component
95
135
  * ------------------------------------------------------------------------- */
96
136
  export function ActivityTab({ timings, loading, error, rejectionFeedback }) {
137
+ const now = useTickingNow(timings);
97
138
  if (loading) {
98
139
  return (_jsx("div", { "data-testid": "activity-tab-loading", className: "flex items-center justify-center p-8", children: _jsx(Loader2, { className: "text-muted-foreground h-6 w-6 animate-spin" }) }));
99
140
  }
@@ -104,24 +145,24 @@ export function ActivityTab({ timings, loading, error, rejectionFeedback }) {
104
145
  return (_jsxs("div", { className: "flex flex-col items-center justify-center gap-2 p-8", children: [_jsx(Clock, { className: "text-muted-foreground h-8 w-8" }), _jsx("p", { className: "text-muted-foreground text-sm", children: "No activity recorded yet" })] }));
105
146
  }
106
147
  const nodeTimings = timings.filter((t) => !isLifecycleEvent(t.phase));
107
- const maxDurationMs = Math.max(...nodeTimings.map((t) => t.durationMs ?? 0), ...nodeTimings.map((t) => t.approvalWaitMs ?? 0), 0);
148
+ const maxDurationMs = Math.max(...nodeTimings.map((t) => getEffectiveDuration(t, now)), ...nodeTimings.map((t) => t.approvalWaitMs ?? 0), 0);
108
149
  const iterations = buildLifecycleTimeline(timings, rejectionFeedback);
109
150
  const hasMultipleIterations = iterations.length > 1;
110
- const totalExecMs = nodeTimings.reduce((sum, t) => sum + (t.durationMs ?? 0), 0);
151
+ const totalExecMs = nodeTimings.reduce((sum, t) => sum + getEffectiveDuration(t, now), 0);
111
152
  const totalWaitMs = nodeTimings.reduce((sum, t) => sum + (t.approvalWaitMs ?? 0), 0);
112
- return (_jsxs("div", { className: "flex flex-col gap-4 p-4", children: [_jsx("div", { "data-testid": "activity-timings", className: "flex flex-col gap-3", children: iterations.map((iteration) => (_jsx(IterationGroup, { iteration: iteration, showHeader: hasMultipleIterations, maxDurationMs: maxDurationMs }, iteration.number))) }), totalExecMs > 0 ? (_jsx(SummaryTotals, { totalExecMs: totalExecMs, totalWaitMs: totalWaitMs })) : null] }));
153
+ return (_jsxs("div", { className: "flex flex-col gap-4 p-4", children: [_jsx("div", { "data-testid": "activity-timings", className: "flex flex-col gap-3", children: iterations.map((iteration) => (_jsx(IterationGroup, { iteration: iteration, showHeader: hasMultipleIterations, maxDurationMs: maxDurationMs, now: now }, iteration.number))) }), totalExecMs > 0 ? (_jsx(SummaryTotals, { totalExecMs: totalExecMs, totalWaitMs: totalWaitMs })) : null] }));
113
154
  }
114
155
  /* ---------------------------------------------------------------------------
115
156
  * Iteration group — one cycle of work
116
157
  * ------------------------------------------------------------------------- */
117
- function IterationGroup({ iteration, showHeader, maxDurationMs, }) {
158
+ function IterationGroup({ iteration, showHeader, maxDurationMs, now, }) {
118
159
  return (_jsxs("div", { "data-testid": `iteration-${iteration.number}`, className: "flex flex-col gap-1.5", children: [showHeader ? (_jsxs("div", { className: "text-muted-foreground text-xs font-medium", children: ["Iteration ", iteration.number] })) : null, iteration.timings.map((t) => {
119
160
  if (isLifecycleEvent(t.phase)) {
120
161
  // For run:rejected, the message comes from the iteration, not a separate map
121
162
  const isRejection = t.phase === 'run:rejected';
122
163
  return (_jsx(LifecycleEventRow, { timing: t, message: isRejection ? iteration.rejectionMessage : undefined, attachments: isRejection ? iteration.rejectionAttachments : undefined }, `${t.agentRunId}-${t.phase}-${t.startedAt}`));
123
164
  }
124
- return (_jsx(NodeTimingRow, { timing: t, maxDurationMs: maxDurationMs }, `${t.agentRunId}-${t.phase}-${t.startedAt}`));
165
+ return (_jsx(NodeTimingRow, { timing: t, maxDurationMs: maxDurationMs, now: now }, `${t.agentRunId}-${t.phase}-${t.startedAt}`));
125
166
  })] }));
126
167
  }
127
168
  /* ---------------------------------------------------------------------------
@@ -134,14 +175,15 @@ function LifecycleEventRow({ timing, message, attachments, }) {
134
175
  const hasAttachments = attachments && attachments.length > 0;
135
176
  return (_jsxs("div", { className: `text-xs ${event.colorClass}`, children: [_jsx("span", { children: event.label }), message ? (_jsxs("span", { "data-testid": "rejection-feedback-text", className: "text-muted-foreground ml-2 font-normal italic", children: ["\u2014 ", message] })) : null, hasAttachments ? (_jsx("div", { "data-testid": "rejection-feedback-attachments", className: "mt-1.5 ml-2", children: _jsx(InlineAttachments, { text: "", attachmentPaths: attachments }) })) : null] }));
136
177
  }
137
- function NodeTimingRow({ timing, maxDurationMs, }) {
178
+ function NodeTimingRow({ timing, maxDurationMs, now, }) {
138
179
  const label = timing.phase.includes(':')
139
180
  ? `rev ${timing.phase.split(':')[1]}`
140
181
  : (NODE_TO_PHASE[timing.phase] ?? timing.phase);
141
- const durationMs = timing.durationMs ?? 0;
182
+ const durationMs = getEffectiveDuration(timing, now);
142
183
  const barPercent = maxDurationMs > 0 ? Math.max(2, (durationMs / maxDurationMs) * 100) : 2;
184
+ const isRunning = !timing.completedAt && !!timing.startedAt;
143
185
  const barColorClass = timing.completedAt ? 'bg-emerald-500' : 'bg-blue-500';
144
- return (_jsxs("div", { className: "flex flex-col gap-1", children: [_jsxs("div", { "data-testid": `timing-bar-${timing.phase}`, className: "flex items-center gap-3", children: [_jsx("span", { className: "text-muted-foreground w-24 shrink-0 text-xs", children: label }), _jsx("div", { className: "bg-muted h-3 flex-1 overflow-hidden rounded-full", children: _jsx("div", { className: `h-full rounded-full ${barColorClass}`, style: { width: `${Math.min(barPercent, 100)}%` } }) }), _jsx("span", { className: "text-muted-foreground w-14 shrink-0 text-right text-xs", children: formatDuration(durationMs) })] }), timing.approvalWaitMs != null && timing.approvalWaitMs > 0 ? (_jsx(ApprovalWaitRow, { timing: timing, maxDurationMs: maxDurationMs })) : null] }));
186
+ return (_jsxs("div", { className: "flex flex-col gap-1", children: [_jsxs("div", { "data-testid": `timing-bar-${timing.phase}`, className: "flex items-center gap-3", children: [_jsx("span", { className: "text-muted-foreground w-24 shrink-0 text-xs", children: label }), _jsx("div", { className: "bg-muted h-3 flex-1 overflow-hidden rounded-full", children: _jsx("div", { className: `h-full rounded-full ${barColorClass}${isRunning ? 'animate-pulse' : ''}`, style: { width: `${Math.min(barPercent, 100)}%` } }) }), _jsx("span", { className: "text-muted-foreground w-14 shrink-0 text-right text-xs", children: formatDuration(durationMs) })] }), timing.approvalWaitMs != null && timing.approvalWaitMs > 0 ? (_jsx(ApprovalWaitRow, { timing: timing, maxDurationMs: maxDurationMs })) : null] }));
145
187
  }
146
188
  function ApprovalWaitRow({ timing, maxDurationMs, }) {
147
189
  const waitMs = timing.approvalWaitMs ?? 0;
@@ -1,3 +1,4 @@
1
+ import type { NotificationEvent } from '../../../../../../packages/core/src/domain/generated/output.js';
1
2
  import type { FeatureNodeData } from '../../common/feature-node/index.js';
2
3
  import type { PrdQuestionnaireData } from '../../common/prd-questionnaire/index.js';
3
4
  import type { TechDecisionsReviewData } from '../../common/tech-decisions-review/index.js';
@@ -11,6 +12,8 @@ export interface FeatureDrawerTabsProps {
11
12
  initialTab?: FeatureTabKey;
12
13
  /** Tab key from URL path segment (e.g. /feature/[id]/activity → 'activity'). */
13
14
  urlTab?: FeatureTabKey;
15
+ /** SSE events from the agent events provider, used to trigger tab data refresh. */
16
+ sseEvents?: readonly NotificationEvent[];
14
17
  prdData?: PrdQuestionnaireData | null;
15
18
  prdSelections?: Record<string, string>;
16
19
  onPrdSelect?: (questionId: string, optionId: string) => void;
@@ -30,5 +33,5 @@ export interface FeatureDrawerTabsProps {
30
33
  chatInput?: string;
31
34
  onChatInputChange?: (value: string) => void;
32
35
  }
33
- export declare function FeatureDrawerTabs({ featureNode, featureId, initialTab, urlTab, prdData, prdSelections, onPrdSelect, onPrdApprove, onPrdReject, isPrdLoading, techData, onTechApprove, onTechReject, isTechLoading, productData, mergeData, onMergeApprove, onMergeReject, isMergeLoading, isRejecting, chatInput, onChatInputChange, }: FeatureDrawerTabsProps): import("react/jsx-runtime").JSX.Element;
36
+ export declare function FeatureDrawerTabs({ featureNode, featureId, initialTab, urlTab, prdData, prdSelections, onPrdSelect, onPrdApprove, onPrdReject, isPrdLoading, techData, onTechApprove, onTechReject, isTechLoading, productData, mergeData, onMergeApprove, onMergeReject, isMergeLoading, isRejecting, chatInput, onChatInputChange, sseEvents, }: FeatureDrawerTabsProps): import("react/jsx-runtime").JSX.Element;
34
37
  //# sourceMappingURL=feature-drawer-tabs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"feature-drawer-tabs.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACzF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AACjG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAMxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAQ9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uDAAuD,CAAC;AAiD3F,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,eAAe,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,gFAAgF;IAChF,MAAM,CAAC,EAAE,aAAa,CAAC;IAGvB,OAAO,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACtC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,WAAW,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7D,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;IAC1E,YAAY,CAAC,EAAE,OAAO,CAAC;IAGvB,QAAQ,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAAC;IAC1C,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;IAC3E,aAAa,CAAC,EAAE,OAAO,CAAC;IAGxB,WAAW,CAAC,EAAE,2BAA2B,GAAG,IAAI,CAAC;IAGjD,SAAS,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IACnC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;IAC5E,cAAc,CAAC,EAAE,OAAO,CAAC;IAGzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C;AAwBD,wBAAgB,iBAAiB,CAAC,EAChC,WAAW,EACX,SAAS,EACT,UAAU,EACV,MAAM,EACN,OAAO,EACP,aAAa,EACb,WAAW,EACX,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,aAAa,EACb,WAAW,EACX,SAAS,EACT,cAAc,EACd,aAAa,EACb,cAAc,EACd,WAAW,EACX,SAAS,EACT,iBAAiB,GAClB,EAAE,sBAAsB,2CAmSxB"}
1
+ {"version":3,"file":"feature-drawer-tabs.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAS9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACzF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AACjG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAMxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAQ9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uDAAuD,CAAC;AAiD3F,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,eAAe,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,gFAAgF;IAChF,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,mFAAmF;IACnF,SAAS,CAAC,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAGzC,OAAO,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACtC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,WAAW,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7D,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;IAC1E,YAAY,CAAC,EAAE,OAAO,CAAC;IAGvB,QAAQ,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAAC;IAC1C,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;IAC3E,aAAa,CAAC,EAAE,OAAO,CAAC;IAGxB,WAAW,CAAC,EAAE,2BAA2B,GAAG,IAAI,CAAC;IAGjD,SAAS,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IACnC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;IAC5E,cAAc,CAAC,EAAE,OAAO,CAAC;IAGzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C;AAwBD,wBAAgB,iBAAiB,CAAC,EAChC,WAAW,EACX,SAAS,EACT,UAAU,EACV,MAAM,EACN,OAAO,EACP,aAAa,EACb,WAAW,EACX,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,aAAa,EACb,WAAW,EACX,SAAS,EACT,cAAc,EACd,aAAa,EACb,cAAc,EACd,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,SAAS,GACV,EAAE,sBAAsB,2CAwTxB"}
@@ -64,7 +64,7 @@ const TAB_FETCHERS = {
64
64
  activity: fetchActivity,
65
65
  plan: fetchPlan,
66
66
  };
67
- export function FeatureDrawerTabs({ featureNode, featureId, initialTab, urlTab, prdData, prdSelections, onPrdSelect, onPrdApprove, onPrdReject, isPrdLoading, techData, onTechApprove, onTechReject, isTechLoading, productData, mergeData, onMergeApprove, onMergeReject, isMergeLoading, isRejecting, chatInput, onChatInputChange, }) {
67
+ export function FeatureDrawerTabs({ featureNode, featureId, initialTab, urlTab, prdData, prdSelections, onPrdSelect, onPrdApprove, onPrdReject, isPrdLoading, techData, onTechApprove, onTechReject, isTechLoading, productData, mergeData, onMergeApprove, onMergeReject, isMergeLoading, isRejecting, chatInput, onChatInputChange, sseEvents, }) {
68
68
  const pathname = usePathname();
69
69
  const featureLogs = useFeatureLogs(featureId);
70
70
  const visibleTabs = useMemo(() => computeVisibleTabs(featureNode), [featureNode]);
@@ -159,6 +159,7 @@ export function FeatureDrawerTabs({ featureNode, featureId, initialTab, urlTab,
159
159
  }, [featureId]);
160
160
  // When initialTab changes (e.g. SSE updates lifecycle), switch to it if visible
161
161
  // and sync the URL with replaceState so the address bar reflects the new tab.
162
+ // Also trigger lazy fetch for the new tab so data is ready immediately.
162
163
  const prevInitialTabRef = useRef(initialTab);
163
164
  useEffect(() => {
164
165
  if (prevInitialTabRef.current !== initialTab &&
@@ -166,13 +167,17 @@ export function FeatureDrawerTabs({ featureNode, featureId, initialTab, urlTab,
166
167
  visibleTabs.includes(initialTab)) {
167
168
  prevInitialTabRef.current = initialTab;
168
169
  setActiveTab(initialTab);
170
+ // Trigger lazy fetch for the new tab if it's a lazy-loaded tab
171
+ if (initialTab === 'activity' || initialTab === 'plan') {
172
+ fetchTab(initialTab);
173
+ }
169
174
  // Sync URL to match the new tab
170
175
  const targetUrl = initialTab === 'overview' ? basePath : `${basePath}/${initialTab}`;
171
176
  if (targetUrl !== window.location.pathname) {
172
177
  window.history.replaceState(null, '', targetUrl);
173
178
  }
174
179
  }
175
- }, [initialTab, visibleTabs, basePath]);
180
+ }, [initialTab, visibleTabs, basePath, fetchTab]);
176
181
  // If the active tab becomes invisible (lifecycle changed), fall back to overview
177
182
  // and sync the URL accordingly.
178
183
  useEffect(() => {
@@ -183,19 +188,34 @@ export function FeatureDrawerTabs({ featureNode, featureId, initialTab, urlTab,
183
188
  }
184
189
  }
185
190
  }, [visibleTabs, activeTab, basePath]);
186
- // SSE refresh: re-fetch active lazy tab when featureNode reference changes
187
- const featureNodeRef = useRef(featureNode);
191
+ // SSE refresh: re-fetch lazy tab data when relevant SSE events arrive
192
+ // for this feature (e.g. PhaseCompleted, AgentStarted, AgentCompleted).
193
+ // Always refresh 'activity' data (even if not the active tab) so switching
194
+ // to the activity tab shows up-to-date timings without a loading flash.
188
195
  const activeTabRef = useRef(activeTab);
189
196
  activeTabRef.current = activeTab;
197
+ const sseProcessedRef = useRef(0);
190
198
  useEffect(() => {
191
- if (featureNodeRef.current !== featureNode) {
192
- featureNodeRef.current = featureNode;
193
- const current = activeTabRef.current;
194
- if (current === 'activity' || current === 'plan') {
195
- refreshTab(current);
196
- }
199
+ if (!sseEvents || sseEvents.length === 0)
200
+ return;
201
+ // Clamp cursor if events were pruned
202
+ if (sseProcessedRef.current > sseEvents.length) {
203
+ sseProcessedRef.current = 0;
204
+ }
205
+ if (sseEvents.length <= sseProcessedRef.current)
206
+ return;
207
+ const newEvents = sseEvents.slice(sseProcessedRef.current);
208
+ sseProcessedRef.current = sseEvents.length;
209
+ const hasRelevantEvent = newEvents.some((e) => e.featureId === featureId);
210
+ if (!hasRelevantEvent)
211
+ return;
212
+ // Always refresh activity data so it stays current for when the user switches tabs
213
+ refreshTab('activity');
214
+ const current = activeTabRef.current;
215
+ if (current === 'plan') {
216
+ refreshTab(current);
197
217
  }
198
- }, [featureNode, refreshTab]);
218
+ }, [sseEvents, featureId, refreshTab]);
199
219
  const handleTabChange = useCallback((value) => {
200
220
  const tab = value;
201
221
  isUserInteraction.current = true;
@@ -1 +1 @@
1
- {"version":3,"file":"overview-tab.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/feature-drawer-tabs/overview-tab.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAMxE,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,eAAe,CAAC;CACvB;AAED,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,EAAE,gBAAgB,2CAwCrD"}
1
+ {"version":3,"file":"overview-tab.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/feature-drawer-tabs/overview-tab.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAOxE,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,eAAe,CAAC;CACvB;AAED,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,EAAE,gBAAgB,2CAwCrD"}
@@ -1,5 +1,6 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { useState, useEffect, useRef } from 'react';
3
4
  import { ExternalLink, GitBranch, GitCommitHorizontal, Zap } from 'lucide-react';
4
5
  import { InlineAttachments } from '../../common/inline-attachments/index.js';
5
6
  import { PrStatus } from '../../../../../../packages/core/src/domain/generated/output.js';
@@ -10,6 +11,7 @@ import { CiStatusBadge } from '../../common/ci-status-badge/index.js';
10
11
  import { CometSpinner } from '../../ui/comet-spinner.js';
11
12
  import { featureNodeStateConfig, lifecycleDisplayLabels } from '../../common/feature-node/index.js';
12
13
  import { getAgentTypeIcon, agentTypeLabels, } from '../../common/feature-node/agent-type-icons.js';
14
+ import { formatDuration } from '../../../lib/format-duration.js';
13
15
  export function OverviewTab({ data }) {
14
16
  const isCompleted = data.lifecycle === 'maintain';
15
17
  return (_jsxs(_Fragment, { children: [_jsxs("div", { "data-testid": "feature-drawer-status", className: "flex flex-col gap-3 p-4", children: [_jsx("div", { className: "text-muted-foreground text-xs font-semibold tracking-wider", children: lifecycleDisplayLabels[data.lifecycle] }), _jsx(FeatureStateBadge, { data: data }), !isCompleted && data.progress > 0 ? (_jsxs("div", { "data-testid": "feature-drawer-progress", className: "flex flex-col gap-1", children: [_jsxs("div", { className: "text-muted-foreground flex items-center justify-between text-xs", children: [_jsx("span", { children: "Progress" }), _jsxs("span", { children: [data.progress, "%"] })] }), _jsx("div", { className: "bg-muted h-2 w-full overflow-hidden rounded-full", children: _jsx("div", { className: cn('h-full rounded-full transition-all', featureNodeStateConfig[data.state].progressClass), style: { width: `${data.progress}%` } }) })] })) : null, isCompleted && data.pr ? _jsx(FeaturePrInfo, { pr: data.pr }) : null] }), _jsx(FeatureInfo, { data: data }), !isCompleted && data.pr ? (_jsxs(_Fragment, { children: [_jsx(Separator, {}), _jsx("div", { className: "p-4", children: _jsx(FeaturePrInfo, { pr: data.pr }) })] })) : null, _jsx(FeatureDetails, { data: data })] }));
@@ -63,11 +65,42 @@ function FeaturePrInfo({ pr }) {
63
65
  return (_jsx("div", { "data-testid": "feature-drawer-pr", children: _jsxs("div", { className: "space-y-3", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("a", { href: pr.url, target: "_blank", rel: "noopener noreferrer", className: "text-primary flex items-center gap-1.5 text-sm font-semibold underline underline-offset-2", children: ["PR #", pr.number, _jsx(ExternalLink, { className: "h-3.5 w-3.5" })] }), _jsx(Badge, { className: prStatusStyles[pr.status], children: pr.status })] }), pr.ciStatus ? (_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-muted-foreground text-xs font-medium", children: "CI Status" }), _jsx(CiStatusBadge, { status: pr.ciStatus })] })) : null, pr.commitHash ? (_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-muted-foreground text-xs font-medium", children: "Commit" }), _jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx(GitCommitHorizontal, { className: "text-muted-foreground h-3.5 w-3.5" }), _jsx("code", { className: "bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]", children: pr.commitHash.slice(0, 7) })] })] })) : null] }) }));
64
66
  }
65
67
  // ── Details section ──────────────────────────────────────────────────
68
+ /** Hook that returns a live-updating elapsed time string for running features. */
69
+ function useElapsedTime(startedAt) {
70
+ const [elapsed, setElapsed] = useState(null);
71
+ const intervalRef = useRef(null);
72
+ useEffect(() => {
73
+ if (!startedAt) {
74
+ setElapsed(null);
75
+ return;
76
+ }
77
+ // Compute immediately
78
+ setElapsed(formatDuration(Math.max(0, Date.now() - startedAt)));
79
+ // Tick every second
80
+ intervalRef.current = setInterval(() => {
81
+ setElapsed(formatDuration(Math.max(0, Date.now() - startedAt)));
82
+ }, 1000);
83
+ return () => {
84
+ if (intervalRef.current) {
85
+ clearInterval(intervalRef.current);
86
+ intervalRef.current = null;
87
+ }
88
+ };
89
+ }, [startedAt]);
90
+ return elapsed;
91
+ }
66
92
  function FeatureDetails({ data }) {
67
- const hasAnyDetail = data.fastMode ?? data.agentType ?? data.runtime ?? data.blockedBy ?? data.errorMessage;
93
+ const isRunning = data.state === 'running' || data.state === 'action-required';
94
+ const elapsedTime = useElapsedTime(isRunning ? data.startedAt : undefined);
95
+ const hasAnyDetail = data.fastMode ??
96
+ data.agentType ??
97
+ data.runtime ??
98
+ elapsedTime ??
99
+ data.blockedBy ??
100
+ data.errorMessage;
68
101
  if (!hasAnyDetail)
69
102
  return null;
70
- return (_jsxs(_Fragment, { children: [_jsx(Separator, {}), _jsxs("div", { "data-testid": "feature-drawer-details", className: "flex flex-col gap-3 p-4", children: [data.fastMode ? (_jsxs("div", { className: "flex flex-col gap-0.5", children: [_jsx("span", { className: "text-muted-foreground text-xs font-medium", children: "Mode" }), _jsxs("span", { className: "flex items-center gap-2 text-sm", children: [_jsx(Zap, { className: "h-4 w-4 shrink-0 text-amber-500" }), "Fast Mode"] })] })) : null, data.agentType ? _jsx(AgentDetailRow, { agentType: data.agentType }) : null, data.runtime ? _jsx(DetailRow, { label: "Runtime", value: data.runtime }) : null, data.blockedBy ? _jsx(DetailRow, { label: "Blocked by", value: data.blockedBy }) : null, data.errorMessage ? _jsx(DetailRow, { label: "Error", value: data.errorMessage }) : null] })] }));
103
+ return (_jsxs(_Fragment, { children: [_jsx(Separator, {}), _jsxs("div", { "data-testid": "feature-drawer-details", className: "flex flex-col gap-3 p-4", children: [data.fastMode ? (_jsxs("div", { className: "flex flex-col gap-0.5", children: [_jsx("span", { className: "text-muted-foreground text-xs font-medium", children: "Mode" }), _jsxs("span", { className: "flex items-center gap-2 text-sm", children: [_jsx(Zap, { className: "h-4 w-4 shrink-0 text-amber-500" }), "Fast Mode"] })] })) : null, data.agentType ? _jsx(AgentDetailRow, { agentType: data.agentType }) : null, data.runtime ? _jsx(DetailRow, { label: "Runtime", value: data.runtime }) : null, !data.runtime && elapsedTime ? (_jsx(DetailRow, { label: "Running for", value: elapsedTime })) : null, data.blockedBy ? _jsx(DetailRow, { label: "Blocked by", value: data.blockedBy }) : null, data.errorMessage ? _jsx(DetailRow, { label: "Error", value: data.errorMessage }) : null] })] }));
71
104
  }
72
105
  function AgentDetailRow({ agentType }) {
73
106
  const Icon = getAgentTypeIcon(agentType);