@kortix/ui 0.15.6 → 0.15.8

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 (226) hide show
  1. package/README.md +7 -7
  2. package/dist/_vendor/kortix-shared.js +36 -1
  3. package/dist/_vendor/shared/my-kortix-agent.d.ts +7 -0
  4. package/dist/_vendor/shared/pixel-mark.d.ts +18 -0
  5. package/dist/customize/connectors/catalog/connector-categories.d.ts +2 -2
  6. package/dist/customize/connectors/catalog/connector-categories.js +2 -2
  7. package/dist/customize/connectors/detail/connector-modal.js +1 -1
  8. package/dist/customize/providers/provider-accordion.js +3 -2
  9. package/dist/customize/providers/provider-connect.d.ts +7 -0
  10. package/dist/customize/providers/provider-connect.js +21 -2
  11. package/dist/customize/providers/provider-sheet.js +3 -2
  12. package/dist/customize/sections/gateway-view.d.ts +2 -2
  13. package/dist/customize/sections/gateway-view.js +30 -15
  14. package/dist/customize/sections/llm-provider/chatgpt-subscription-connect.d.ts +3 -1
  15. package/dist/customize/sections/llm-provider/chatgpt-subscription-connect.js +2 -2
  16. package/dist/customize/sections/view/account-secret-resources-panel.js +8 -5
  17. package/dist/customize/sections/view/agent-editor-basics-fields.js +1 -1
  18. package/dist/customize/sections/view/gateway/gateway-logs.d.ts +1 -1
  19. package/dist/customize/sections/view/git-view.js +1 -1
  20. package/dist/customize/sections/view/permission-editor.js +1 -1
  21. package/dist/customize/sections/view/review-center-connected.js +15 -3
  22. package/dist/customize/sections/view/subscription-usage.d.ts +269 -17
  23. package/dist/customize/sections/view/subscription-usage.js +197 -54
  24. package/dist/customize/shared/entity/entity-modal.js +8 -10
  25. package/dist/files/project/components/drive-toolbar.d.ts +1 -1
  26. package/dist/files/project/components/drive-toolbar.js +1 -1
  27. package/dist/files/project/store/version-store.d.ts +1 -1
  28. package/dist/files/renderers/shared/scroll-area-compat.d.ts +6 -6
  29. package/dist/files/renderers/shared/scroll-area-compat.js +7 -9
  30. package/dist/files/renderers/shared/select-compat.js +3 -7
  31. package/dist/files/viewer/file-preview-modal.d.ts +10 -11
  32. package/dist/files/viewer/file-preview-modal.js +17 -18
  33. package/dist/i18n/en.d.ts +40 -47
  34. package/dist/i18n/en.js +47 -54
  35. package/dist/i18n/ui-catalog/app-registry-translation-keys.generated.js +5 -0
  36. package/dist/index.js +1 -1
  37. package/dist/internal/account-hub/account-hub-location.js +2 -2
  38. package/dist/internal/account-hub/use-account-members.d.ts +28 -1
  39. package/dist/internal/account-hub/use-account-members.js +27 -10
  40. package/dist/internal/auth/auth-primitives.d.ts +27 -0
  41. package/dist/internal/auth/auth-primitives.js +21 -0
  42. package/dist/internal/billing/index.d.ts +1 -0
  43. package/dist/internal/billing/index.js +2 -0
  44. package/dist/internal/billing/use-free-grant-unspent.d.ts +10 -0
  45. package/dist/internal/billing/use-free-grant-unspent.js +20 -0
  46. package/dist/internal/components/agent-mark.d.ts +1 -8
  47. package/dist/internal/components/agent-mark.js +2 -19
  48. package/dist/internal/lib/billing/billing-gate-state.d.ts +20 -0
  49. package/dist/internal/lib/billing/billing-gate-state.js +22 -0
  50. package/dist/internal/lib/error-handler.js +0 -2
  51. package/dist/internal/lib/navigation/modified-click.js +2 -2
  52. package/dist/internal/lib/pixel-mark.d.ts +3 -20
  53. package/dist/internal/lib/pixel-mark.js +3 -34
  54. package/dist/internal/notifications/notification-inbox.js +1 -1
  55. package/dist/internal/stores/active-space-store.d.ts +1 -1
  56. package/dist/internal/stores/browser-recents-store.d.ts +1 -1
  57. package/dist/internal/stores/current-account-store.d.ts +1 -1
  58. package/dist/internal/stores/first-chat-store.d.ts +1 -1
  59. package/dist/internal/stores/mobile-app-promo-store.d.ts +1 -1
  60. package/dist/internal/stores/session-browser-store.d.ts +1 -1
  61. package/dist/internal/stores/session-expanded-store.d.ts +1 -1
  62. package/dist/internal/stores/session-filter-store.d.ts +1 -1
  63. package/dist/internal/stores/session-history-view-store.d.ts +1 -1
  64. package/dist/internal/stores/session-hover-store.d.ts +1 -1
  65. package/dist/internal/stores/session-hover-store.js +1 -1
  66. package/dist/internal/stores/session-panel-memory-store.d.ts +1 -1
  67. package/dist/internal/stores/sound-store.d.ts +1 -1
  68. package/dist/internal/stores/tab-store.d.ts +1 -1
  69. package/dist/internal/stores/upgrade-dialog-store.d.ts +0 -2
  70. package/dist/internal/stores/upgrade-dialog-store.js +0 -2
  71. package/dist/internal/stores/user-preferences-store.d.ts +1 -1
  72. package/dist/internal/stores/web-notification-store.d.ts +1 -1
  73. package/dist/lib/base-ui-compat.d.ts +149 -0
  74. package/dist/lib/base-ui-compat.js +339 -0
  75. package/dist/lib/portal-container.d.ts +3 -7
  76. package/dist/lib/portal-container.js +5 -3
  77. package/dist/lib/z-stack.d.ts +4 -4
  78. package/dist/lib/z-stack.js +5 -5
  79. package/dist/markdown/setup-links/approval-decision.d.ts +1 -1
  80. package/dist/markdown/setup-links/approval-decision.js +1 -1
  81. package/dist/primitives/accordion.d.ts +36 -5
  82. package/dist/primitives/accordion.js +41 -8
  83. package/dist/primitives/alert-dialog.d.ts +33 -11
  84. package/dist/primitives/alert-dialog.js +41 -19
  85. package/dist/primitives/avatar.d.ts +5 -2
  86. package/dist/primitives/avatar.js +3 -3
  87. package/dist/primitives/badge.js +1 -1
  88. package/dist/primitives/breadcrumb.js +1 -1
  89. package/dist/primitives/button-group.js +3 -3
  90. package/dist/primitives/button.js +1 -1
  91. package/dist/primitives/checkbox.d.ts +14 -5
  92. package/dist/primitives/checkbox.js +24 -9
  93. package/dist/primitives/collapsible.d.ts +16 -4
  94. package/dist/primitives/collapsible.js +18 -7
  95. package/dist/primitives/command-core.d.ts +121 -0
  96. package/dist/primitives/command-core.js +642 -0
  97. package/dist/primitives/command.d.ts +38 -4
  98. package/dist/primitives/command.js +22 -13
  99. package/dist/primitives/context-menu.d.ts +61 -31
  100. package/dist/primitives/context-menu.js +40 -53
  101. package/dist/primitives/dialog.d.ts +48 -10
  102. package/dist/primitives/dialog.js +48 -19
  103. package/dist/primitives/disclosure.d.ts +1 -1
  104. package/dist/primitives/disclosure.js +2 -2
  105. package/dist/primitives/drawer.d.ts +28 -9
  106. package/dist/primitives/drawer.js +42 -18
  107. package/dist/primitives/dropdown-menu.d.ts +55 -33
  108. package/dist/primitives/dropdown-menu.js +46 -82
  109. package/dist/primitives/faded-scroll-area.js +2 -1
  110. package/dist/primitives/hint.js +3 -3
  111. package/dist/primitives/hover-card.d.ts +17 -5
  112. package/dist/primitives/hover-card.js +45 -8
  113. package/dist/primitives/item.js +2 -2
  114. package/dist/primitives/label.d.ts +5 -2
  115. package/dist/primitives/label.js +10 -3
  116. package/dist/primitives/menu-base.d.ts +150 -0
  117. package/dist/primitives/menu-base.js +171 -0
  118. package/dist/primitives/menu-recipe.d.ts +1 -1
  119. package/dist/primitives/menu-recipe.js +2 -7
  120. package/dist/primitives/modal.d.ts +19 -52
  121. package/dist/primitives/modal.js +24 -28
  122. package/dist/primitives/navigation-menu.d.ts +36 -11
  123. package/dist/primitives/navigation-menu.js +31 -12
  124. package/dist/primitives/popover.d.ts +31 -6
  125. package/dist/primitives/popover.js +79 -12
  126. package/dist/primitives/preview-image.d.ts +18 -7
  127. package/dist/primitives/preview-image.js +14 -11
  128. package/dist/primitives/progress.d.ts +4 -2
  129. package/dist/primitives/progress.js +4 -3
  130. package/dist/primitives/project-icon-picker.js +2 -2
  131. package/dist/primitives/radio-group.d.ts +28 -5
  132. package/dist/primitives/radio-group.js +18 -10
  133. package/dist/primitives/scroll-area.d.ts +2 -2
  134. package/dist/primitives/scroll-area.js +8 -3
  135. package/dist/primitives/select.d.ts +55 -12
  136. package/dist/primitives/select.js +93 -36
  137. package/dist/primitives/separator.d.ts +6 -2
  138. package/dist/primitives/separator.js +10 -2
  139. package/dist/primitives/sheet.d.ts +17 -10
  140. package/dist/primitives/sheet.js +19 -22
  141. package/dist/primitives/sidebar-menu-primitives.js +8 -8
  142. package/dist/primitives/slider-native.d.ts +2 -2
  143. package/dist/primitives/slider-native.js +11 -9
  144. package/dist/primitives/slider.d.ts +24 -6
  145. package/dist/primitives/slider.js +26 -24
  146. package/dist/primitives/slot.d.ts +6 -0
  147. package/dist/primitives/slot.js +7 -0
  148. package/dist/primitives/split-sheet.js +1 -1
  149. package/dist/primitives/stepper.js +1 -1
  150. package/dist/primitives/switch.d.ts +16 -3
  151. package/dist/primitives/switch.js +7 -6
  152. package/dist/primitives/tabs.d.ts +36 -20
  153. package/dist/primitives/tabs.js +131 -102
  154. package/dist/primitives/toggle.d.ts +16 -3
  155. package/dist/primitives/toggle.js +8 -3
  156. package/dist/primitives/tooltip.d.ts +24 -5
  157. package/dist/primitives/tooltip.js +32 -10
  158. package/dist/primitives/type-to-confirm-dialog.d.ts +1 -1
  159. package/dist/primitives/type-to-confirm-dialog.js +1 -1
  160. package/dist/session/composer/animated-placeholder.js +1 -1
  161. package/dist/session/composer/chat-input/chat-input-control.js +3 -3
  162. package/dist/session/composer/editor/composer-editor.js +1 -1
  163. package/dist/session/composer/menus/menu-shell.d.ts +1 -1
  164. package/dist/session/composer/menus/menu-shell.js +1 -1
  165. package/dist/session/composer/menus/mount.js +1 -1
  166. package/dist/session/composer/reasoning-effort-selector.js +1 -1
  167. package/dist/session/header/session-site-header.js +2 -2
  168. package/dist/session/header/subagent-hover-card.js +2 -2
  169. package/dist/session/media/image-preview.js +1 -1
  170. package/dist/session/models/model-selector.d.ts +1 -1
  171. package/dist/session/models/model-selector.js +18 -12
  172. package/dist/session/models/subscription-switcher.d.ts +37 -0
  173. package/dist/session/models/subscription-switcher.js +97 -0
  174. package/dist/session/models/subscription-windows.d.ts +40 -0
  175. package/dist/session/models/subscription-windows.js +86 -0
  176. package/dist/session/overrides/session-overrides-control.js +3 -3
  177. package/dist/session/panel/diff-dialog.js +1 -1
  178. package/dist/session/panel/easy/detail-view.js +3 -3
  179. package/dist/session/panel/mobile-tool-drawer.js +2 -2
  180. package/dist/session/panel/panel-fallback.js +1 -1
  181. package/dist/session/panel/session-files-explorer.d.ts +1 -1
  182. package/dist/session/panel/session-files-explorer.js +1 -1
  183. package/dist/session/prompts/ask-deck.d.ts +14 -2
  184. package/dist/session/prompts/ask-deck.js +6 -2
  185. package/dist/session/thread/session-chat.js +2 -2
  186. package/dist/session/thread/session-context-message-explorer.js +1 -1
  187. package/dist/session/thread/turn-share.js +3 -4
  188. package/dist/session/tool/shared/show-helpers.js +1 -1
  189. package/dist/session/turn/message-time-label.js +1 -1
  190. package/dist/styles.css +1 -1
  191. package/dist/test-utils/intl.d.ts +40 -47
  192. package/dist/workspace/admin/settings-search.js +4 -12
  193. package/dist/workspace/inbox/workspace-inbox.js +11 -2
  194. package/dist/workspace/layout/new-session-create.d.ts +4 -2
  195. package/dist/workspace/layout/new-session-create.js +11 -0
  196. package/dist/workspace/projects/modal/project-icon-field.js +9 -23
  197. package/dist/workspace/review/approval-modal.d.ts +6 -6
  198. package/dist/workspace/review/approval-modal.js +10 -14
  199. package/dist/workspace/review/review-center.d.ts +9 -2
  200. package/dist/workspace/review/review-center.js +258 -126
  201. package/dist/workspace/review/review-detail.d.ts +20 -10
  202. package/dist/workspace/review/review-detail.js +39 -44
  203. package/dist/workspace/review/review-meta.d.ts +27 -6
  204. package/dist/workspace/review/review-meta.js +46 -34
  205. package/dist/workspace/sessions/session-row.js +1 -1
  206. package/dist/workspace/sidebar/footer/project-download-app-nav.d.ts +10 -0
  207. package/dist/workspace/sidebar/footer/project-download-app-nav.js +53 -0
  208. package/dist/workspace/sidebar/footer/promo-nav-row.d.ts +2 -1
  209. package/dist/workspace/sidebar/footer/promo-nav-row.js +1 -1
  210. package/dist/workspace/sidebar/project-session-list.js +2 -2
  211. package/dist/workspace/sidebar/project-sidebar.d.ts +6 -1
  212. package/dist/workspace/sidebar/project-sidebar.js +3 -2
  213. package/dist/workspace/sidebar/session-brief-hover-card.d.ts +1 -1
  214. package/dist/workspace/sidebar/session-brief-hover-card.js +3 -3
  215. package/dist/workspace/sidebar/session-title.d.ts +2 -2
  216. package/dist/workspace/sidebar/session-title.js +2 -2
  217. package/dist/workspace/sidebar/workspace-menu-model.d.ts +19 -13
  218. package/dist/workspace/sidebar/workspace-menu-model.js +7 -8
  219. package/dist/workspace/sidebar/workspace-menu-section.js +1 -1
  220. package/dist/workspace/spaces/space-links.js +1 -1
  221. package/dist/workspace/spaces/space-threads-tab.js +1 -1
  222. package/package.json +16 -35
  223. package/skills/kortix-ui/SKILL.md +1 -1
  224. package/skills/kortix-ui/references/custom-dashboard.md +1 -1
  225. package/dist/customize/sections/view/subscription-usage-tab.d.ts +0 -25
  226. package/dist/customize/sections/view/subscription-usage-tab.js +0 -121
@@ -17,7 +17,7 @@ import { Checkbox } from '../../primitives/checkbox.js';
17
17
  import { ConfirmDialog } from '../../primitives/confirm-dialog.js';
18
18
  import { CountBadge } from '../../primitives/count-badge.js';
19
19
  import { Button } from '../../primitives/button.js';
20
- import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, } from '../../primitives/dropdown-menu.js';
20
+ import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, } from '../../primitives/dropdown-menu.js';
21
21
  import Hint from '../../primitives/hint.js';
22
22
  import { InputGroupSearch, InputGroupSearchIcon, InputGroupSearchInput, } from '../../primitives/input-group.js';
23
23
  import { Kbd } from '../../primitives/kbd.js';
@@ -27,6 +27,7 @@ import { Skeleton } from '../../primitives/skeleton.js';
27
27
  import { DiffStat } from '../../primitives/status.js';
28
28
  import { Tabs, TabsList, TabsTrigger } from '../../primitives/tabs.js';
29
29
  import { errorToast, infoToast, successToast, toastIcon, undoToast, } from '../../primitives/toast.js';
30
+ import { EmptyArt } from '../../primitives/empty-art.js';
30
31
  import { EmptyState } from '../../primitives/empty-state.js';
31
32
  import { ErrorState } from '../../primitives/error-state.js';
32
33
  import { localizeUiCatalog } from '../../i18n/ui-catalog/localize-ui-catalog.js';
@@ -35,18 +36,18 @@ import { cn } from '../../internal/lib/utils.js';
35
36
  import { hasOpenFloatingLayer } from '../../lib/z-stack.js';
36
37
  import { SelectionBar } from '../../internal/selection/selection-bar.js';
37
38
  import { selectRange, toggleId } from '../../internal/selection/selection.js';
38
- import { ArrowUUpLeftIcon as ArrowUUpLeft, CheckIcon as Check, CheckCircleIcon as CheckCircleSolid, CheckSquareIcon, CaretDownIcon as ChevronDown, ClockIcon as Clock, DotsThreeIcon as DotsThree, MagnifyingGlassIcon as Search, WarningIcon, XIcon as X, } from '@phosphor-icons/react';
39
+ import { ChatsIcon as Chats, CheckCircleIcon as CheckCircleSolid, CheckSquareIcon, ClockCountdownIcon as ClockCountdown, DotsThreeIcon as DotsThree, FunnelSimpleIcon as FunnelSimple, MagnifyingGlassIcon as Search, ShapesIcon as Shapes, ShieldCheckIcon as ShieldCheck, TrayIcon as Tray, WarningIcon, XIcon as X, } from '@phosphor-icons/react';
39
40
  import { useUiPathname, useUiRouter, useUiSearchParams } from '../../providers/ui-provider.js';
40
- import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
41
+ import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
41
42
  import { statusToVerdict } from './map.js';
42
43
  import { getLocalizedMockItems } from './mock-data.js';
43
44
  import { BULK_MAX, BULK_VERDICT, bulkResultMessage, bulkSelectable, bulkSkipMessage, bulkSupports, formatExpiresIn, formatItemAge, isQuickDecidableApproval, resolveBulkOutcome, } from './review-actions.js';
44
45
  import { reviewArgsSummary } from '../../session/prompts/session-approval-review.js';
45
46
  import { approvalIdentity } from '../../markdown/setup-links/approval-decision.js';
46
47
  import { ConnectorAppMark } from '../../markdown/setup-links/connector-handshake.js';
47
- import { ApprovalDecisionModal, reviewApprovalAsker, reviewApprovalDenyOnly, reviewApprovalDetails, } from './approval-modal.js';
48
- import { ReviewDetail, ReviewItemModal } from './review-detail.js';
49
- import { KIND_META, reviewKindLabel, reviewStatusLabel, } from './review-meta.js';
48
+ import { ApprovalDecisionPane, reviewApprovalAsker, reviewApprovalDenyOnly, reviewApprovalDetails, } from './approval-modal.js';
49
+ import { ClosePaneButton, ReviewDetail } from './review-detail.js';
50
+ import { ROW_MERGED_GLYPH, ROW_STATUS_GLYPH, ROW_TILE, ROW_TILE_NEUTRAL, reviewKindLabel, reviewStatusLabel, } from './review-meta.js';
50
51
  import { bulkSetStatus, decideApprovalAction, filterItems, groupBySession, isPromiseLike, REVIEW_VERDICT_ANNOUNCED, sessionOptions, setStatus, } from './review-reducer.js';
51
52
  import { segmentForStatus, } from './types.js';
52
53
  /**
@@ -59,9 +60,9 @@ function TimeAgo({ iso }) {
59
60
  useEffect(() => setMounted(true), []);
60
61
  return _jsx("span", { className: "tabular-nums", children: mounted ? formatItemAge(iso) : '' });
61
62
  }
62
- /** "Expires in 3h" on a pending approval. Under one hour a clock glyph in the
63
- * warning accent leads it; the text stays muted (an accent paints a glyph,
64
- * never text). Client-only, like `TimeAgo`. Nothing once no time is left. */
63
+ /** "Expires in 3h" on a pending approval. Under one hour a countdown glyph in
64
+ * the warning accent leads it; the text stays muted (an accent paints a
65
+ * glyph, never text). Client-only, like `TimeAgo`. Nothing once no time is left. */
65
66
  function ExpiresIn({ iso }) {
66
67
  const tHardcodedUi = useTranslations('hardcodedUi');
67
68
  const [mounted, setMounted] = useState(false);
@@ -69,7 +70,7 @@ function ExpiresIn({ iso }) {
69
70
  const left = mounted ? formatExpiresIn(iso) : null;
70
71
  if (!left)
71
72
  return null;
72
- return (_jsxs(_Fragment, { children: [_jsx(Dot, {}), left.soon ? (_jsx(Clock, { "aria-hidden": true, className: "text-kortix-orange size-3.5 shrink-0" })) : null, _jsx("span", { className: "shrink-0 tabular-nums", children: tHardcodedUi('approvalPage.expiresIn', { time: left.time }) })] }));
73
+ return (_jsxs(_Fragment, { children: [_jsx(Dot, {}), left.soon ? (_jsx(ClockCountdown, { "aria-hidden": true, className: "text-kortix-orange size-3.5 shrink-0" })) : null, _jsx("span", { className: "shrink-0 tabular-nums", children: tHardcodedUi('approvalPage.expiresIn', { time: left.time }) })] }));
73
74
  }
74
75
  const SEGMENTS = [
75
76
  { value: 'needs_you', label: 'Needs you' },
@@ -94,57 +95,67 @@ const SHORTCUTS = [
94
95
  { keys: ['/'], label: 'Search' },
95
96
  { keys: ['?'], label: 'This help' },
96
97
  ];
97
- /** Flat rows, no chrome — the row itself lifts on hover/focus/select. */
98
- const LIST_CLASS = 'space-y-1 py-2.5';
99
- /** One small glyph after the title says where the item landed; the row
100
- * carries no status badge. `needs_you` has no glyph — its action button is
101
- * the state. */
102
- const STATUS_GLYPH = {
103
- approved: { icon: Check, className: 'text-kortix-green' },
104
- done: { icon: Check, className: 'text-kortix-green' },
105
- waiting: { icon: Clock, className: 'text-muted-foreground' },
106
- changes_requested: { icon: ArrowUUpLeft, className: 'text-kortix-orange' },
107
- rejected: { icon: X, className: 'text-kortix-red' },
108
- dismissed: { icon: X, className: 'text-muted-foreground' },
109
- expired: { icon: Clock, className: 'text-muted-foreground' },
110
- };
98
+ /** Flat rows, no chrome: the row itself lifts on hover, focus and selection. */
99
+ const LIST_CLASS = 'space-y-px';
111
100
  function Dot() {
112
- return (_jsx("span", { "aria-hidden": true, className: "text-muted-foreground", children: "\u2022" }));
101
+ return (_jsx("span", { "aria-hidden": true, className: "text-muted-foreground", children: "\u00B7" }));
113
102
  }
114
- function ItemRow({ item, idx, focused, fresh, sessionLabel, onOpen, onAskChanges, onDismiss, onOpenSession, selection, }) {
103
+ /**
104
+ * The 32 px leading tile: a connector call shows its app's mark; every other
105
+ * kind its own glyph, tinted while it needs you and neutral once it does not.
106
+ * A small corner badge adds what the tile cannot say: a connector call is an
107
+ * approval, a change has merge conflicts.
108
+ */
109
+ function RowTile({ item, className }) {
110
+ const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
111
+ const pending = item.status === 'needs_you';
112
+ const connector = item.kind === 'approval' ? reviewApprovalDetails(item) : null;
113
+ const who = connector ? approvalIdentity(connector) : null;
114
+ const tile = ROW_TILE[item.kind];
115
+ const conflicted = item.kind === 'change' && (item.detail.conflicts?.length ?? 0) > 0;
116
+ const badge = who
117
+ ? { icon: ShieldCheck, className: pending ? 'text-kortix-orange' : 'text-muted-foreground' }
118
+ : conflicted
119
+ ? { icon: WarningIcon, className: 'text-kortix-orange' }
120
+ : null;
121
+ return (_jsxs("span", { className: cn('relative flex size-8 shrink-0', className), "aria-label": reviewKindLabel(item.kind, tI18nComplete), role: "img", children: [who ? (_jsx(ConnectorAppMark, { name: who.connector ?? item.title, slug: who.slug, iconUrl: who.iconUrl, size: "md" })) : (_jsx("span", { className: cn('flex size-8 items-center justify-center rounded-md', pending ? tile.tint : ROW_TILE_NEUTRAL), children: _jsx(tile.icon, { className: "size-4" }) })), badge ? (_jsx("span", { className: "bg-background absolute -right-1 -bottom-1 flex size-4 items-center justify-center rounded-full", children: _jsx(badge.icon, { weight: "fill", className: cn('size-3', badge.className) }) })) : null] }));
122
+ }
123
+ function ItemRow({ item, idx, focused, active, fresh, sessionLabel, onOpen, onAskChanges, onDismiss, onOpenSession, selection, }) {
115
124
  const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
116
125
  const tBulk = useTranslations('hardcodedUi.reviewBulk');
117
- const kind = KIND_META[item.kind];
126
+ const tReview = useTranslations('hardcodedUi.approvalPage');
118
127
  const segment = segmentForStatus(item.status);
119
128
  const pending = segment === 'needs_you';
120
129
  const number = item.kind === 'change' ? item.detail.number : undefined;
121
130
  const diff = item.kind === 'change' ? item.detail.advanced : undefined;
122
- const glyph = STATUS_GLYPH[item.status];
123
- // Meta line: when · who · where. The session stands in for the repo; when
131
+ const glyph = item.kind === 'change' && item.status === 'approved'
132
+ ? ROW_MERGED_GLYPH
133
+ : ROW_STATUS_GLYPH[item.status];
134
+ const statusLabel = reviewStatusLabel(item.status, tI18nComplete);
135
+ // Second line: who, then where. The session stands in for the repo; when
124
136
  // the group already names it, the row's own summary fills the slot.
125
137
  const where = sessionLabel ?? item.summary;
126
- // Nothing to review: the modal offers only Deny, so the row says so in
138
+ // Nothing to review: the pane offers only Deny, so the row says so in
127
139
  // place of "awaiting approval". Nothing is denied automatically.
128
140
  const denyOnly = pending && reviewApprovalDenyOnly(item);
129
- const tReview = useTranslations('hardcodedUi.approvalPage');
130
141
  const selecting = selection?.selecting ?? false;
131
142
  const selectable = !!selection && !selection.disabled;
132
- // The leading icon names the kind by shape and the outcome by color:
133
- // blue while it needs you, then green/orange/red/muted once decided — the
134
- // same tone as the status check beside the title.
135
- const kindIcon = (_jsx(kind.icon, { className: cn('size-5 shrink-0', glyph ? glyph.className : kind.iconColor, selectable && !selecting && 'group-focus-within:hidden group-hover:hidden'), "aria-label": reviewKindLabel(item.kind, tI18nComplete) }));
136
- // One fixed 20 px slot: the kind icon, swapped for the checkbox on row
137
- // hover and for the whole of select mode. Nothing shifts.
138
- const leading = !selectable || !selection ? (kindIcon) : (_jsx("span", { className: "flex size-5 shrink-0 items-center justify-center", children: selecting ? (_jsx(Checkbox, { checked: selection.checked, tabIndex: -1, "aria-hidden": true, className: "pointer-events-none" })) : (_jsxs(_Fragment, { children: [kindIcon, _jsx(Checkbox, { checked: false, "aria-label": tBulk('selectRow', { title: item.title }), onClick: (e) => {
139
- // The row's own state decides; Radix skips its toggle.
143
+ const highRisk = segment !== 'done' && item.risk === 'high';
144
+ // One fixed 32 px slot: the tile, swapped for the checkbox on row hover and
145
+ // for the whole of select mode. Nothing shifts.
146
+ const tile = (_jsx(RowTile, { item: item, className: cn(selectable && !selecting && 'group-focus-within:hidden group-hover:hidden') }));
147
+ const leading = !selectable || !selection ? (tile) : (_jsx("span", { className: "flex size-8 shrink-0 items-center justify-center", children: selecting ? (_jsx(Checkbox, { checked: selection.checked, tabIndex: -1, "aria-hidden": true, className: "pointer-events-none" })) : (_jsxs(_Fragment, { children: [tile, _jsx(Checkbox, { checked: false, "aria-label": tBulk('selectRow', { title: item.title }), onClick: (e) => {
148
+ // The row's own state decides; the checkbox skips its toggle.
140
149
  e.preventDefault();
141
150
  selection.onToggle(e.shiftKey);
142
151
  }, className: "hidden group-focus-within:flex group-hover:flex" })] })) }));
143
- const body = (_jsxs(_Fragment, { children: [_jsxs("span", { className: "flex items-center gap-1.5", children: [_jsx("span", { className: "text-foreground truncate text-sm font-medium", children: item.title }), number != null && (_jsxs("span", { className: "text-muted-foreground shrink-0 text-sm tabular-nums", children: ["#", number] })), glyph && (_jsx(Hint, { label: reviewStatusLabel(item.status, tI18nComplete), children: _jsx(glyph.icon, { className: cn('size-3.5 shrink-0', glyph.className), "aria-label": reviewStatusLabel(item.status, tI18nComplete) }) })), fresh && (_jsx(Badge, { variant: "new", size: "sm", className: "shrink-0", children: tI18nComplete.raw('text18fdd549b2ed') }))] }), _jsxs("span", { className: "text-muted-foreground mt-0.5 flex min-w-0 items-center gap-1.5 text-xs", children: [_jsx(TimeAgo, { iso: item.createdAt }), item.kind === 'approval' && segment !== 'done' && item.expiresAt ? (_jsx(ExpiresIn, { iso: item.expiresAt })) : null, _jsx(Dot, {}), _jsx("span", { className: "truncate", children: item.agent }), denyOnly ? (_jsxs(_Fragment, { children: [_jsx(Dot, {}), _jsxs("span", { className: "flex min-w-0 items-center gap-1", children: [_jsx(WarningIcon, { "aria-hidden": true, className: "text-kortix-orange size-3.5 shrink-0" }), _jsx("span", { className: "truncate", children: tReview('canOnlyBeDenied') })] })] })) : where ? (_jsxs(_Fragment, { children: [_jsx(Dot, {}), _jsx("span", { className: "truncate", children: where })] })) : null] })] }));
152
+ const body = (_jsxs(_Fragment, { children: [_jsxs("span", { className: "flex min-w-0 items-center gap-1.5", children: [fresh ? (_jsx("span", { "aria-label": tI18nComplete.raw('text18fdd549b2ed'), role: "img", className: "bg-kortix-blue size-1.5 shrink-0 rounded-full" })) : null, _jsx("span", { className: cn('truncate text-sm', pending || fresh ? 'text-foreground font-medium' : 'text-muted-foreground'), children: item.title }), number != null && (_jsxs("span", { className: "text-muted-foreground shrink-0 text-sm tabular-nums", children: ["#", number] }))] }), _jsx("span", { className: "text-muted-foreground mt-0.5 flex min-w-0 items-center gap-1.5 text-xs", children: denyOnly ? (_jsxs("span", { className: "flex min-w-0 items-center gap-1", children: [_jsx(WarningIcon, { "aria-hidden": true, className: "text-kortix-orange size-3.5 shrink-0" }), _jsx("span", { className: "truncate", children: tReview('canOnlyBeDenied') })] })) : (_jsxs(_Fragment, { children: [_jsx("span", { className: "max-w-[45%] shrink-0 truncate", children: item.agent }), item.kind === 'approval' && segment !== 'done' && item.expiresAt ? (_jsx(ExpiresIn, { iso: item.expiresAt })) : diff && (diff.additions > 0 || diff.deletions > 0) ? (_jsxs(_Fragment, { children: [_jsx(Dot, {}), _jsx(DiffStat, { additions: diff.additions, deletions: diff.deletions, className: "shrink-0 text-xs" })] })) : where ? (_jsxs(_Fragment, { children: [_jsx(Dot, {}), _jsx("span", { className: "truncate", children: where })] })) : null] })) })] }));
153
+ // Right column: where it stands on top, how old it is below.
154
+ const trailing = (_jsxs("span", { className: "flex shrink-0 flex-col items-end gap-1 pt-0.5", children: [_jsx(Hint, { label: statusLabel, children: _jsx("span", { role: "img", "aria-label": statusLabel, className: "flex shrink-0", children: _jsx(glyph.icon, { className: cn('size-4 shrink-0', glyph.className) }) }) }), _jsxs("span", { className: "text-muted-foreground flex items-center gap-1 text-xs", children: [highRisk ? (_jsx(Hint, { label: tBulk('riskHigh'), children: _jsx(WarningIcon, { weight: "fill", "aria-label": tBulk('riskHigh'), className: "text-kortix-orange size-3.5 shrink-0" }) })) : null, _jsx(TimeAgo, { iso: item.createdAt })] })] }));
144
155
  // The menu's Select hands focus to the row (select mode drops the menu), not
145
156
  // back to the trigger that is about to unmount.
146
157
  const enteringSelect = useRef(false);
147
- const diffStat = diff ? (_jsx(DiffStat, { additions: diff.additions, deletions: diff.deletions, className: "hidden text-xs sm:inline-flex" })) : null;
158
+ const rowClass = 'relative flex items-start gap-3 rounded-md px-2.5 py-2.5';
148
159
  // Select mode: the whole row is the option (trigger-list.tsx), with no
149
160
  // open button and no menu inside it to steal the click.
150
161
  if (selecting && selection) {
@@ -153,20 +164,20 @@ function ItemRow({ item, idx, focused, fresh, sessionLabel, onOpen, onAskChanges
153
164
  e.preventDefault();
154
165
  selection.onToggle(e.shiftKey);
155
166
  }
156
- }, className: cn('flex items-center gap-3 rounded-md px-3 py-1.5 outline-none select-none', 'focus-visible:ring-ring focus-visible:ring-2', focused || selection.checked ? 'bg-active' : selectable && 'hover:bg-hover', selectable && 'cursor-pointer'), children: [leading, _jsx("span", { className: "min-w-0 flex-1", children: body }), diffStat ? _jsx("span", { className: "flex shrink-0 items-center", children: diffStat }) : null] }));
167
+ }, className: cn(rowClass, 'outline-none select-none focus-visible:ring-ring focus-visible:ring-2', focused || selection.checked ? 'bg-active' : selectable && 'hover:bg-hover', selectable && 'cursor-pointer'), children: [leading, _jsx("span", { className: "min-w-0 flex-1", children: body }), trailing] }));
157
168
  }
158
- return (_jsxs("li", { "data-idx": idx, className: cn('group relative flex items-center gap-3 rounded-md px-3 py-1.5', focused ? 'bg-active' : 'hover:bg-hover'), children: [leading, _jsx("button", { type: "button", onClick: onOpen, className: "focus-visible:ring-ring min-w-0 flex-1 rounded-sm text-left focus-visible:ring-2 focus-visible:outline-none", children: body }), _jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [diffStat, _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": tI18nComplete('textcbd7bbfcd257', { value0: item.title }), className: "text-muted-foreground", children: _jsx(DotsThree, { className: "size-4" }) }) }), _jsxs(DropdownMenuContent, { align: "end", className: "w-52", onCloseAutoFocus: (e) => {
159
- if (enteringSelect.current)
160
- e.preventDefault();
161
- enteringSelect.current = false;
162
- }, children: [_jsxs(DropdownMenuItem, { onClick: onOpen, children: [tI18nComplete.raw('texted077f3d8125'), _jsx(DropdownMenuShortcut, { children: "\u21B5" })] }), onOpenSession && (_jsx(DropdownMenuItem, { onClick: onOpenSession, children: tI18nComplete.raw('textb205bb47f81a') })), pending && (onAskChanges || onDismiss) && _jsx(DropdownMenuSeparator, {}), pending && onAskChanges && (_jsxs(DropdownMenuItem, { onClick: onAskChanges, children: [tI18nComplete.raw('text705364916412'), _jsx(DropdownMenuShortcut, { children: "e" })] })), pending && onDismiss && (_jsxs(DropdownMenuItem, { variant: "destructive", onClick: onDismiss, children: [tI18nComplete.raw('text48845bff334a'), _jsx(DropdownMenuShortcut, { children: "d" })] })), selectable && selection ? (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { onSelect: () => {
163
- enteringSelect.current = true;
164
- selection.onToggle(false);
165
- }, children: [_jsx(CheckSquareIcon, {}), tI18nComplete.raw('text2a78025de6aa'), _jsx(DropdownMenuShortcut, { children: "x" })] })] })) : null] })] })] })] }));
169
+ return (_jsxs("li", { "data-idx": idx, "aria-current": active || undefined, className: cn('group', rowClass, active ? 'bg-active' : focused ? 'bg-hover' : 'hover:bg-hover'), children: [leading, _jsx("button", { type: "button", "data-row-open": true, onClick: onOpen, className: "focus-visible:ring-ring min-w-0 flex-1 rounded-sm text-left focus-visible:ring-2 focus-visible:outline-none", children: body }), _jsxs("span", { className: "relative flex shrink-0", children: [_jsx("span", { className: "group-focus-within:invisible group-hover:invisible", children: trailing }), _jsx("span", { className: "invisible absolute top-0 right-0 group-focus-within:visible group-hover:visible", children: _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": tI18nComplete('textcbd7bbfcd257', { value0: item.title }), className: "text-muted-foreground", children: _jsx(DotsThree, { className: "size-4" }) }) }), _jsxs(DropdownMenuContent, { align: "end", className: "w-52", onCloseAutoFocus: (e) => {
170
+ if (enteringSelect.current)
171
+ e.preventDefault();
172
+ enteringSelect.current = false;
173
+ }, children: [_jsxs(DropdownMenuItem, { onClick: onOpen, children: [tI18nComplete.raw('texted077f3d8125'), _jsx(DropdownMenuShortcut, { children: "\u21B5" })] }), onOpenSession && (_jsx(DropdownMenuItem, { onClick: onOpenSession, children: tI18nComplete.raw('textb205bb47f81a') })), pending && (onAskChanges || onDismiss) && _jsx(DropdownMenuSeparator, {}), pending && onAskChanges && (_jsxs(DropdownMenuItem, { onClick: onAskChanges, children: [tI18nComplete.raw('text705364916412'), _jsx(DropdownMenuShortcut, { children: "e" })] })), pending && onDismiss && (_jsxs(DropdownMenuItem, { variant: "destructive", onClick: onDismiss, children: [tI18nComplete.raw('text48845bff334a'), _jsx(DropdownMenuShortcut, { children: "d" })] })), selectable && selection ? (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { onSelect: () => {
174
+ enteringSelect.current = true;
175
+ selection.onToggle(false);
176
+ }, children: [_jsx(CheckSquareIcon, {}), tI18nComplete.raw('text2a78025de6aa'), _jsx(DropdownMenuShortcut, { children: "x" })] })] })) : null] })] }) })] })] }));
166
177
  }
167
178
  /** One plain bar per row, row height, while the inbox loads. */
168
179
  function ListSkeleton({ rows = 4 }) {
169
- return (_jsx("div", { className: "space-y-1", children: Array.from({ length: rows }).map((_, i) => (_jsx(Skeleton, { className: "h-12 w-full rounded-md" }, i))) }));
180
+ return (_jsx("div", { className: "space-y-1 p-1.5", children: Array.from({ length: rows }).map((_, i) => (_jsx(Skeleton, { className: "h-14 w-full rounded-md" }, i))) }));
170
181
  }
171
182
  function KeyboardHelp({ open, onClose }) {
172
183
  const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
@@ -197,6 +208,26 @@ const RISK_BADGE = {
197
208
  medium: { variant: 'warning', key: 'riskMedium' },
198
209
  high: { variant: 'destructive', key: 'riskHigh' },
199
210
  };
211
+ /** `@3xl` in px: the inbox width from which list and detail sit side by side. */
212
+ const TWO_PANE_PX = 768;
213
+ /** Whether `ref`'s element is at least `min` px wide, kept current on resize.
214
+ * True until measured: the server render and a desktop first paint agree. */
215
+ function useContainerWide(ref, min) {
216
+ const [wide, setWide] = useState(true);
217
+ // Before paint: a narrow inbox mounts the asks deck above the list on its
218
+ // first frame, not one frame late.
219
+ useLayoutEffect(() => {
220
+ const el = ref.current;
221
+ if (!el || typeof ResizeObserver === 'undefined')
222
+ return;
223
+ const measure = () => setWide(el.getBoundingClientRect().width >= min);
224
+ measure();
225
+ const observer = new ResizeObserver(measure);
226
+ observer.observe(el);
227
+ return () => observer.disconnect();
228
+ }, [ref, min]);
229
+ return wide;
230
+ }
200
231
  export function ReviewCenter({ initialItems, segment: segmentProp, onSegmentChange, loadMore, onAct, onBulkAct, onOpenSession, onRecoverChange, recoveringCrId, onRefresh, isLoading, isFetching, isFetched, isError, sessionLabels, verdictAllowed = EVERY_VERDICT, needsYouDeck, } = {}) {
201
232
  const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
202
233
  const tBulk = useTranslations('hardcodedUi.reviewBulk');
@@ -211,6 +242,12 @@ export function ReviewCenter({ initialItems, segment: segmentProp, onSegmentChan
211
242
  const setSegment = onSegmentChange ?? setLocalSegment;
212
243
  const [kindFilter, setKindFilter] = useState('all');
213
244
  const [query, setQuery] = useState('');
245
+ const [searchOpen, setSearchOpen] = useState(false);
246
+ const tPane = useTranslations('hardcodedUi.reviewPane');
247
+ // Two panes from `@3xl` (48rem) of the inbox's own width. CSS lays the panes
248
+ // out; this flag only decides where the asks deck mounts, once.
249
+ const rootRef = useRef(null);
250
+ const wide = useContainerWide(rootRef, TWO_PANE_PX);
214
251
  // Per-session view: filter to one session, and/or group the list by session so
215
252
  // a session's reviews + approvals sit together. Both operate on `sessionId`.
216
253
  const [sessionFilter, setSessionFilter] = useState('all');
@@ -254,7 +291,7 @@ export function ReviewCenter({ initialItems, segment: segmentProp, onSegmentChan
254
291
  const sourceItems = initialItems ?? items;
255
292
  const selectedId = useMemo(() => (idParam && sourceItems.some((i) => i.id === idParam) ? idParam : null), [sourceItems, idParam]);
256
293
  const listLoaded = !connected || isFetched === true;
257
- const setSelectedId = useCallback((id) => {
294
+ const setSelectedId = useCallback((id, how) => {
258
295
  const params = new URLSearchParams(search?.toString() ?? '');
259
296
  if (id)
260
297
  params.set('id', id);
@@ -262,15 +299,26 @@ export function ReviewCenter({ initialItems, segment: segmentProp, onSegmentChan
262
299
  params.delete('id');
263
300
  const suffix = params.toString();
264
301
  const href = suffix ? `${pathname}?${suffix}` : pathname;
265
- // Opening pushes so the browser's Back returns to the inbox; closing
266
- // replaces so Back never lands on the page you just left.
267
- if (id)
302
+ // Opening from nothing pushes, so the browser's Back returns to the
303
+ // empty pane. Moving between items (j/k, the next row after a verdict)
304
+ // and closing replace: Back never walks the list item by item.
305
+ if ((how ?? (id && !idParam ? 'push' : 'replace')) === 'push') {
268
306
  router.push(href, { scroll: false });
269
- else
307
+ }
308
+ else {
270
309
  router.replace(href, { scroll: false });
271
- }, [pathname, router, search]);
310
+ }
311
+ }, [idParam, pathname, router, search]);
272
312
  const labelFor = useMemo(() => (id) => sessionLabels?.[id], [sessionLabels]);
273
313
  const visible = useMemo(() => filterItems(items, segment, kindFilter, query, sessionFilter), [items, segment, kindFilter, query, sessionFilter]);
314
+ /** After a verdict the item leaves its list: open the row that took its
315
+ * place (the next one, else the one above).
316
+ * Reads the list as it was before the verdict. */
317
+ const advanceFrom = (id) => {
318
+ const at = visible.findIndex((i) => i.id === id);
319
+ const next = at >= 0 ? (visible[at + 1] ?? visible[at - 1]) : undefined;
320
+ setSelectedId(next?.id ?? null, 'replace');
321
+ };
274
322
  const kindCounts = useMemo(() => {
275
323
  // Respect the active session filter so the kind-tab badges never contradict
276
324
  // the visible list when scoped to one session.
@@ -632,31 +680,67 @@ export function ReviewCenter({ initialItems, segment: segmentProp, onSegmentChan
632
680
  }
633
681
  return;
634
682
  }
635
- // Help, a review page or the bulk confirm owns the keyboard.
636
- if (helpOpen || selectedId || confirm.open)
683
+ // Help or the bulk confirm owns the keyboard. An open item does not:
684
+ // j/k walk the list beside it.
685
+ if (helpOpen || confirm.open)
637
686
  return;
638
687
  if (typing)
639
688
  return; // don't hijack search typing
689
+ if (hasOpenFloatingLayer())
690
+ return; // a menu or dialog owns its keys
640
691
  if (e.key === '/') {
641
692
  e.preventDefault();
642
- document.getElementById('review-search')?.focus();
693
+ setSearchOpen(true);
694
+ requestAnimationFrame(() => document.getElementById('review-search')?.focus());
643
695
  return;
644
696
  }
645
697
  if (e.key === '1' || e.key === '2' || e.key === '3') {
646
698
  setSegment(segments[Number(e.key) - 1].value);
647
699
  return;
648
700
  }
701
+ // a/e/d decide the open item whenever one is open, even when a filter
702
+ // hides its row or empties the list: the verdict goes to what the pane
703
+ // shows. Select mode gives them no verb.
704
+ const openItem = selectedId
705
+ ? (items.find((i) => i.id === selectedId) ?? sourceItems.find((i) => i.id === selectedId))
706
+ : undefined;
707
+ if (openItem && !selectMode && (e.key === 'a' || e.key === 'e' || e.key === 'd')) {
708
+ if (e.key === 'a')
709
+ quickPrimary(openItem);
710
+ else if (e.key === 'e')
711
+ quickAskChanges(openItem);
712
+ else
713
+ dismissIds([openItem.id]);
714
+ return;
715
+ }
649
716
  if (visible.length === 0)
650
717
  return;
651
- const cur = visible[Math.min(focusedIdx, visible.length - 1)];
718
+ // j/k/x move from the open item's row when one is open, else from the
719
+ // cursor's row. Select mode moves the cursor, not the open item: there
720
+ // it wins.
721
+ const cur = (selectedId && !selectMode ? visible.find((i) => i.id === selectedId) : undefined) ??
722
+ visible[Math.min(focusedIdx, visible.length - 1)];
652
723
  setKbNav(true);
653
- if (e.key === 'j' || e.key === 'ArrowDown') {
724
+ if (e.key === 'j' || e.key === 'ArrowDown' || e.key === 'k' || e.key === 'ArrowUp') {
654
725
  e.preventDefault();
655
- setFocusedIdx((i) => Math.min(visible.length - 1, i + 1));
656
- }
657
- else if (e.key === 'k' || e.key === 'ArrowUp') {
658
- e.preventDefault();
659
- setFocusedIdx((i) => Math.max(0, i - 1));
726
+ const down = e.key === 'j' || e.key === 'ArrowDown';
727
+ // From the open item's row when one is open (rows of a deep link
728
+ // can arrive after it), else from the keyboard cursor.
729
+ const openAt = cur ? visible.indexOf(cur) : -1;
730
+ const from = openAt >= 0 ? openAt : Math.min(focusedIdx, visible.length - 1);
731
+ const to = down ? Math.min(visible.length - 1, from + 1) : Math.max(0, from - 1);
732
+ setFocusedIdx(to);
733
+ // DOM focus follows the cursor out of the list (a click left it on a
734
+ // row), so a later Enter clicks the row the user sees.
735
+ const active = document.activeElement;
736
+ if (active && listRef.current?.contains(active)) {
737
+ listRef.current
738
+ .querySelector(`[data-idx="${to}"] [data-row-open]`)
739
+ ?.focus({ preventScroll: true });
740
+ }
741
+ // With an item open, the pane follows the cursor.
742
+ if (selectedId && !selectMode && visible[to])
743
+ setSelectedId(visible[to].id, 'replace');
660
744
  }
661
745
  else if (e.key === 'x') {
662
746
  if (cur && selectableIds.includes(cur.id))
@@ -667,6 +751,12 @@ export function ReviewCenter({ initialItems, segment: segmentProp, onSegmentChan
667
751
  return;
668
752
  }
669
753
  else if (e.key === 'Enter' || e.key === 'o') {
754
+ // Enter on a focused button or link (Approve, an answer, a session
755
+ // link) is that control's click, not "open the focused row".
756
+ if (e.defaultPrevented ||
757
+ (e.key === 'Enter' && el instanceof HTMLElement && el.closest('button, a, [role="button"]'))) {
758
+ return;
759
+ }
670
760
  e.preventDefault();
671
761
  if (cur)
672
762
  setSelectedId(cur.id);
@@ -694,7 +784,7 @@ export function ReviewCenter({ initialItems, segment: segmentProp, onSegmentChan
694
784
  sourceItems.find((i) => i.id === selectedId) ??
695
785
  null)
696
786
  : null;
697
- const renderRow = (item, idx, inGroup) => (_jsx(ItemRow, { item: item, idx: idx, focused: kbNav && idx === focusedIdx, fresh: freshIds.has(item.id), sessionLabel: !inGroup && item.sessionId ? labelFor(item.sessionId) : undefined, onOpen: () => setSelectedId(item.id), onAskChanges: verdictAllowed(item, 'changes') ? () => quickAskChanges(item) : undefined, onDismiss: verdictAllowed(item, 'dismiss') ? () => dismissIds([item.id]) : undefined, onOpenSession: item.sessionId && onOpenSession ? () => onOpenSession(item.sessionId) : undefined, selection: selectMode || selectableIds.includes(item.id)
787
+ const renderRow = (item, idx, inGroup) => (_jsx(ItemRow, { item: item, idx: idx, focused: kbNav && idx === focusedIdx, active: item.id === selectedId, fresh: freshIds.has(item.id), sessionLabel: !inGroup && item.sessionId ? labelFor(item.sessionId) : undefined, onOpen: () => setSelectedId(item.id), onAskChanges: verdictAllowed(item, 'changes') ? () => quickAskChanges(item) : undefined, onDismiss: verdictAllowed(item, 'dismiss') ? () => dismissIds([item.id]) : undefined, onOpenSession: item.sessionId && onOpenSession ? () => onOpenSession(item.sessionId) : undefined, selection: selectMode || selectableIds.includes(item.id)
698
788
  ? {
699
789
  checked: selectedIds.has(item.id),
700
790
  selecting: !!selectMode,
@@ -722,7 +812,6 @@ export function ReviewCenter({ initialItems, segment: segmentProp, onSegmentChan
722
812
  : loadMore.isError
723
813
  ? tSidebar('retry')
724
814
  : tSidebar('loadMore') }) })) : null;
725
- const shortcutsButton = (_jsxs("button", { type: "button", onClick: () => setHelpOpen(true), className: "text-muted-foreground hover:text-foreground duration-fast hidden items-center gap-1.5 text-xs transition-colors sm:flex", children: [_jsx(Kbd, { children: "?" }), tI18nComplete.raw('text46e978d0c193')] }));
726
815
  const bulkActions = [
727
816
  {
728
817
  id: 'approve',
@@ -777,63 +866,106 @@ export function ReviewCenter({ initialItems, segment: segmentProp, onSegmentChan
777
866
  confirm: tBulk('dismissConfirm', { count: confirmCount }),
778
867
  description: withList(tBulk('dismissDescription')),
779
868
  };
780
- // A `?id=` we cannot resolve yet: hold the row skeleton until the list has
781
- // fetched once, so a refresh never flashes the inbox on the way to the page.
782
- if (idParam && !selected && !listLoaded && !isError) {
783
- return (_jsx("div", { className: "flex h-full min-h-0 flex-col", children: _jsx("div", { className: "min-h-0 flex-1 overflow-y-auto", children: _jsx("div", { className: "w-full p-4", children: _jsx(ListSkeleton, {}) }) }) }));
784
- }
785
- // A Connector call opens the standalone approve page's panel in a modal over
786
- // the inbox, so it reads and decides the same way on both surfaces.
869
+ // A Connector call renders the standalone approve page's panel in the
870
+ // detail pane, so it reads and decides the same way on both surfaces.
787
871
  const approval = selected ? reviewApprovalDetails(selected) : null;
788
872
  const approvalCall = approval && selected?.kind === 'approval' ? selected.detail.actions?.[0] : undefined;
789
- const approvalModal = (_jsx(ApprovalDecisionModal, { details: approval, previewAuthorized: approvalCall?.previewAuthorized !== false, resolvers: approvalCall?.resolvers, ...(approval && selected ? reviewApprovalAsker(selected, sessionLabels) : null), busyDecision: selected && pendingId === selected.id ? pendingDecision : null, onDecision:
790
- // Only the viewer the API lets decide this call gets the decision.
791
- connected && selected && verdictAllowed(selected, 'approve')
792
- ? (decision, note) => actions.resolve(selected.id, decision === 'approve' ? 'approved' : 'rejected', decision === 'approve'
793
- ? tI18nComplete.raw('text0674d4a026cb')
794
- : tI18nComplete.raw('text4341be8eb7f0'), note)
795
- : undefined, onOpenSession: selected?.sessionId && onOpenSession
796
- ? () => onOpenSession(selected.sessionId)
797
- : undefined, onClose: () => setSelectedId(null) }));
798
- // Every other item opens in a modal over the inbox, the same way.
799
- const itemModal = (_jsx(ReviewItemModal, { item: selected && !approval && selected.kind !== 'change' ? selected : null, actions: actions, onClose: () => setSelectedId(null) }));
800
- // A change request replaces the inbox in place: its diff needs the width.
801
- // Escape and "Back to inbox" return to the list.
802
- if (selected?.kind === 'change') {
803
- return (_jsxs("div", { className: "flex h-full min-h-0 flex-col", children: [_jsx("div", { className: "min-h-0 flex-1 overflow-y-auto", children: _jsx(ReviewDetail, { item: selected, actions: actions, onBack: () => setSelectedId(null) }) }), _jsx(KeyboardHelp, { open: helpOpen, onClose: () => setHelpOpen(false) })] }));
804
- }
805
- return (_jsxs("div", { className: "relative flex h-full min-h-0 flex-col", children: [_jsx("div", { className: "min-h-0 flex-1 overflow-y-auto", children: _jsxs("div", { className: cn('w-full px-4', selectMode && segment === 'needs_you' && 'pb-20'), children: [_jsxs("div", { className: "flex flex-col gap-2 py-4 sm:flex-row sm:items-center sm:justify-between", children: [_jsx(Tabs, { value: segment, onValueChange: (v) => {
806
- setSegment(v);
807
- markSeen();
808
- }, className: "min-w-0", children: _jsx(TabsList, { className: "flex w-full items-center justify-start", children: segments.map((s) => (_jsx(TabsTrigger, { value: s.value, size: "sm", children: s.label }, s.value))) }) }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { type: "button", variant: kindFilter === 'all' ? 'outline' : 'secondary', children: [kindFilter === 'all'
809
- ? tI18nComplete.raw('textf10988e79e8d')
810
- : kindFilters.find((f) => f.value === kindFilter)?.label, _jsx(ChevronDown, { className: "text-muted-foreground size-3.5 shrink-0" })] }) }), _jsxs(DropdownMenuContent, { align: "end", className: "w-52", children: [_jsx(DropdownMenuLabel, { children: tI18nComplete.raw('textbaaddf70fb5d') }), _jsx(DropdownMenuRadioGroup, { value: kindFilter, onValueChange: (v) => setKindFilter(v), children: kindFilters.map((f) => (_jsxs(DropdownMenuRadioItem, { value: f.value, side: "left", children: [f.label, (kindCounts[f.value] ?? 0) > 0 && (_jsx(CountBadge, { count: kindCounts[f.value] ?? 0, className: "ml-auto" }))] }, f.value))) })] })] }), sessionOpts.length > 0 && (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { type: "button", variant: sessionFilter === 'all' && !grouped ? 'outline' : 'secondary', className: "max-w-64", children: [_jsx("span", { className: "truncate", children: sessionFilter === 'all'
811
- ? tI18nComplete.raw('text78648d4d6649')
812
- : (sessionOpts.find((s) => s.sessionId === sessionFilter)?.label ??
813
- 'Session') }), _jsx(ChevronDown, { className: "text-muted-foreground size-3.5 shrink-0" })] }) }), _jsxs(DropdownMenuContent, { align: "end", className: "max-h-72 w-64 overflow-y-auto", children: [_jsx(DropdownMenuLabel, { children: tI18nComplete.raw('text6959b4159575') }), _jsxs(DropdownMenuRadioGroup, { value: sessionFilter, onValueChange: setSessionFilter, children: [_jsxs(DropdownMenuRadioItem, { value: "all", side: "left", children: [tI18nComplete.raw('text78648d4d6649'), _jsx(CountBadge, { count: filterItems(items, segment, kindFilter, query, 'all').length, className: "ml-auto" })] }), sessionOpts.map((s) => (_jsxs(DropdownMenuRadioItem, { value: s.sessionId, side: "left", children: [_jsx("span", { className: "truncate", children: s.label }), _jsx(CountBadge, { count: filterItems(items, segment, kindFilter, query, s.sessionId).length, className: "ml-auto" })] }, s.sessionId)))] }), _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuCheckboxItem, { checked: grouped, onCheckedChange: setGrouped, className: "pl-8", children: tI18nComplete.raw('text137f98df3b9b') })] })] })), _jsxs(InputGroupSearch, { className: "sm:w-56", children: [_jsx(InputGroupSearchIcon, { children: _jsx(Search, {}) }), _jsx(InputGroupSearchInput, { id: "review-search", value: query, onChange: (e) => {
814
- setQuery(e.target.value);
815
- setFocusedIdx(0);
816
- }, placeholder: tI18nComplete.raw('text49c266baaaa7'), variant: "popover", size: "sm" }), !query && _jsx(Kbd, { className: "absolute top-1/2 right-2 -translate-y-1/2", children: "/" })] })] })] }), segment === 'needs_you' && needsYouDeck ? _jsx("div", { className: "pb-4", children: needsYouDeck }) : null, isError && items.length === 0 ? (_jsx(ErrorState, { size: "sm", title: tI18nComplete.raw('text23686ff6ba91'), description: tI18nComplete.raw('text481859b689b0'), action: _jsxs(Button, { variant: "outline", size: "sm", onClick: onRefresh, disabled: isFetching, children: [isFetching ? _jsx(Loading, { className: "size-3.5 shrink-0" }) : null, tI18nComplete.raw('text942087cc2d41')] }) })) : isLoading && items.length === 0 ? (_jsx(ListSkeleton, {})) : visible.length === 0 && loadMore ? (
817
- // Nothing on the pages read so far matches, and more pages exist:
818
- // offer them, never the empty state (KRTX-1727).
819
- _jsx("div", { className: "pt-6", children: loadMoreButton })) : visible.length === 0 && segment === 'needs_you' && needsYouDeck && !query ? (
820
- // The deck above owns the Needs you empty state: an empty list
821
- // under open asks must not say "all caught up".
822
- null) : visible.length === 0 ? (_jsx(EmptyState, { icon: CheckCircleSolid, size: "sm", title: query
823
- ? tI18nComplete.raw('text2df01a03ff43')
824
- : segment === 'needs_you'
825
- ? tI18nComplete.raw('text2f485b9971df')
826
- : tI18nComplete.raw('textf4c7f41c12d6'), description: query
827
- ? tI18nComplete.raw('text2e6d79de50dc')
828
- : segment === 'needs_you'
829
- ? tI18nComplete.raw('text67735374cc20')
830
- : segment === 'waiting'
831
- ? tI18nComplete.raw('text2c192433a710')
832
- : tI18nComplete.raw('text6a00736dae3c') })) : grouped ? (_jsx("div", { ...listProps, className: "space-y-5", children: groups.map((g) => (_jsxs("section", { className: "space-y-2", children: [_jsxs("div", { className: "flex items-center gap-2 px-1", children: [_jsx("h2", { className: "text-foreground truncate text-xs font-medium", children: g.label }), _jsx(Badge, { variant: "secondary", size: "xs", className: "tabular-nums", children: g.items.length }), g.sessionId && onOpenSession && (_jsx("button", { type: "button", className: "text-muted-foreground hover:text-foreground duration-fast ml-auto shrink-0 text-xs transition-colors", onClick: () => onOpenSession(g.sessionId), children: tI18nComplete.raw('textb205bb47f81a') }))] }), _jsx("ul", { ...listboxProps, className: LIST_CLASS, children: g.items.map((item) => renderRow(item, visibleIndexById.get(item.id) ?? 0, true)) })] }, g.sessionId ?? '__none__'))) })) : (_jsx("ul", { ...listProps, ...listboxProps, className: LIST_CLASS, children: visible.map((item, idx) => renderRow(item, idx, false)) })), visible.length > 0 && loadMore ? loadMoreButton : null] }) }), selectMode && segment === 'needs_you' ? (
833
- // Pinned to the bottom of the list column, not to the end of the list:
834
- // `sticky` stops where a short list ends (schedule-view.tsx).
835
- _jsx("div", { className: "pointer-events-none absolute inset-x-0 bottom-4 z-10 flex justify-center px-4", children: _jsx("div", { className: "pointer-events-auto w-full max-w-xl", children: _jsx(SelectionBar, { selectedCount: selectedItems.length, allSelected: selectableIds.length > 0 &&
836
- selectedItems.length >= Math.min(BULK_MAX, selectableIds.length), canSelectAll: selectableIds.length > 0, onSelectAll: () => setSelectedIds(new Set(selectableIds.slice(0, BULK_MAX))), onClear: () => setSelectedIds(new Set()), onExit: exitSelectMode, actions: bulkActions, progress: bulkProgress, animateIn: selectMode !== 'key', note: selectedItems.length >= BULK_MAX && selectableIds.length > BULK_MAX
837
- ? tBulk('limitNote', { count: BULK_MAX })
838
- : undefined }) }) })) : null, _jsx(ConfirmDialog, { open: confirm.open, onOpenChange: (open) => setConfirm((c) => ({ ...c, open })), title: confirmCopy.title, description: confirmCopy.description, confirmLabel: confirmCopy.confirm, confirmVariant: confirm.verb === 'approve' ? 'default' : 'destructive', onConfirm: () => void runBulk(confirm.verb) }), approvalModal, itemModal, _jsx(KeyboardHelp, { open: helpOpen, onClose: () => setHelpOpen(false) })] }));
873
+ // Filters set beyond the defaults, as removable chips under the list header.
874
+ const activeKind = kindFilter === 'all' ? null : kindFilters.find((f) => f.value === kindFilter);
875
+ const activeSession = sessionFilter === 'all' ? null : sessionOpts.find((s) => s.sessionId === sessionFilter);
876
+ const filtered = !!activeKind || !!activeSession || grouped;
877
+ const showSearch = searchOpen || query.length > 0;
878
+ const clearFilters = () => {
879
+ setKindFilter('all');
880
+ setSessionFilter('all');
881
+ setGrouped(false);
882
+ };
883
+ const back = () => setSelectedId(null);
884
+ const listBody = isError && items.length === 0 ? (_jsx(ErrorState, { size: "sm", title: tI18nComplete.raw('text23686ff6ba91'), description: tI18nComplete.raw('text481859b689b0'), action: _jsxs(Button, { variant: "outline", size: "sm", onClick: onRefresh, disabled: isFetching, children: [isFetching ? _jsx(Loading, { className: "size-3.5 shrink-0" }) : null, tI18nComplete.raw('text942087cc2d41')] }) })) : isLoading && items.length === 0 ? (_jsx(ListSkeleton, {})) : visible.length === 0 && loadMore ? (
885
+ // Nothing on the pages read so far matches, and more pages exist:
886
+ // offer them, never the empty state (KRTX-1727).
887
+ _jsx("div", { className: "pt-6", children: loadMoreButton })) : visible.length === 0 && segment === 'needs_you' && needsYouDeck && !query && !wide ? (
888
+ // Narrow inbox: the deck above owns the Needs you empty state; an empty
889
+ // list under open asks must not say "all caught up". Once the deck
890
+ // draws nothing (`peer-empty`), it does.
891
+ _jsx("div", { className: "hidden peer-empty:block", children: _jsx(EmptyState, { icon: CheckCircleSolid, size: "sm", title: tI18nComplete.raw('text2f485b9971df'), description: tI18nComplete.raw('text67735374cc20') }) })) : visible.length === 0 ? (_jsx(EmptyState, { icon: CheckCircleSolid, size: "sm", title: query
892
+ ? tI18nComplete.raw('text2df01a03ff43')
893
+ : segment === 'needs_you' && needsYouDeck
894
+ ? // The asks deck beside the list still waits on you: not "all
895
+ // caught up", only no review items.
896
+ tI18nComplete.raw('textf4c7f41c12d6')
897
+ : segment === 'needs_you'
898
+ ? tI18nComplete.raw('text2f485b9971df')
899
+ : tI18nComplete.raw('textf4c7f41c12d6'), description: query
900
+ ? tI18nComplete.raw('text2e6d79de50dc')
901
+ : segment === 'needs_you'
902
+ ? tI18nComplete.raw('text67735374cc20')
903
+ : segment === 'waiting'
904
+ ? tI18nComplete.raw('text2c192433a710')
905
+ : tI18nComplete.raw('text6a00736dae3c') })) : grouped ? (_jsx("div", { ...listProps, className: "space-y-4", children: groups.map((g) => (_jsxs("section", { className: "space-y-1", children: [_jsxs("div", { className: "flex h-7 items-center gap-2 px-2.5", children: [_jsx("h2", { className: "text-muted-foreground truncate text-xs font-medium", children: g.label }), _jsx(CountBadge, { count: g.items.length }), g.sessionId && onOpenSession && (_jsx("button", { type: "button", className: "text-muted-foreground hover:text-foreground duration-fast ml-auto shrink-0 text-xs transition-colors", onClick: () => onOpenSession(g.sessionId), children: tI18nComplete.raw('textb205bb47f81a') }))] }), _jsx("ul", { ...listboxProps, className: LIST_CLASS, children: g.items.map((item) => renderRow(item, visibleIndexById.get(item.id) ?? 0, true)) })] }, g.sessionId ?? '__none__'))) })) : (_jsx("ul", { ...listProps, ...listboxProps, className: LIST_CLASS, children: visible.map((item, idx) => renderRow(item, idx, false)) }));
906
+ /** Nothing open: a quiet prompt to pick a row. */
907
+ const paneEmpty = (_jsx("div", { className: "flex min-h-full flex-1 items-center justify-center px-6 py-8", children: _jsx(EmptyState, { media: _jsx(EmptyArt, { icon: Tray }), size: "sm", title: tPane('emptyTitle'), description: tPane('emptyDescription') }) }));
908
+ // The detail pane: the open item, else (Needs you, wide) what the agents
909
+ // ask of you, else a quiet prompt to pick a row.
910
+ const detail = selected ? (approval ? (_jsxs("div", { className: "flex min-h-full flex-col", children: [_jsx("div", { className: "flex h-11 shrink-0 items-center px-4 @3xl/inbox:justify-end", children: _jsx(ClosePaneButton, { onClick: back }) }), _jsx("div", { className: "flex flex-1 items-start justify-center px-6 py-8", children: _jsx(ApprovalDecisionPane, { details: approval, previewAuthorized: approvalCall?.previewAuthorized !== false, resolvers: approvalCall?.resolvers, ...reviewApprovalAsker(selected, sessionLabels), busyDecision: pendingId === selected.id ? pendingDecision : null, onDecision:
911
+ // Only the viewer the API lets decide this call gets the decision.
912
+ connected && verdictAllowed(selected, 'approve')
913
+ ? (decision, note) => {
914
+ actions.resolve(selected.id, decision === 'approve' ? 'approved' : 'rejected', decision === 'approve'
915
+ ? tI18nComplete.raw('text0674d4a026cb')
916
+ : tI18nComplete.raw('text4341be8eb7f0'), note);
917
+ advanceFrom(selected.id);
918
+ }
919
+ : undefined, onOpenSession: selected.sessionId && onOpenSession
920
+ ? () => onOpenSession(selected.sessionId)
921
+ : undefined }, selected.id) })] })) : (_jsx(ReviewDetail, { item: selected, actions: actions, onBack: back, onResolved: () => advanceFrom(selected.id) }, selected.id))) : idParam && !listLoaded && !isError ? (
922
+ // A `?id=` we cannot resolve yet: hold a skeleton until the list has
923
+ // fetched once, so a refresh never flashes the empty pane on the way.
924
+ _jsxs("div", { className: "space-y-4 px-6 py-6", children: [_jsx(Skeleton, { className: "h-6 w-2/3" }), _jsx(Skeleton, { className: "h-4 w-1/3" }), _jsx(Skeleton, { className: "h-40 w-full" })] })) : (paneEmpty);
925
+ // Wide inbox, Needs you: the asks deck holds the empty pane.
926
+ const deckInPane = wide && segment === 'needs_you' && !!needsYouDeck;
927
+ return (
928
+ // Two panes in a named container: the inbox's own width picks the layout,
929
+ // not the viewport, since this view also mounts in the narrow settings
930
+ // panel. Below `@3xl` one pane shows at a time: the list, or the open item.
931
+ _jsxs("div", { ref: rootRef, className: "@container/inbox relative flex h-full min-h-0", children: [_jsxs("div", { className: cn('border-border min-h-0 w-full min-w-0 flex-col @3xl/inbox:flex @3xl/inbox:w-sm @3xl/inbox:shrink-0 @6xl/inbox:w-md @3xl/inbox:border-r', selected ? 'hidden' : 'flex'), children: [_jsxs("div", { className: "border-border flex h-11 shrink-0 items-center gap-1 border-b px-2.5", children: [_jsx(Tabs, { value: segment, onValueChange: (v) => {
932
+ setSegment(v);
933
+ markSeen();
934
+ }, className: "min-w-0", children: _jsx(TabsList, { variant: "secondary", size: "sm", children: segments.map((s) => (_jsx(TabsTrigger, { value: s.value, className: "w-fit flex-none px-2.5", children: s.label }, s.value))) }) }), _jsxs("div", { className: "ml-auto flex shrink-0 items-center gap-0.5", children: [_jsx(Hint, { label: _jsxs("span", { className: "flex items-center gap-1.5", children: [tI18nComplete.raw('text49c266baaaa7'), _jsx(Kbd, { children: "/" })] }), children: _jsx(Button, { type: "button", variant: showSearch ? 'secondary' : 'ghost', size: "icon-sm", "aria-label": tI18nComplete.raw('text49c266baaaa7'), "aria-expanded": showSearch, className: cn(!showSearch && 'text-muted-foreground'), onClick: () => {
935
+ if (showSearch && !query) {
936
+ setSearchOpen(false);
937
+ return;
938
+ }
939
+ setSearchOpen(true);
940
+ requestAnimationFrame(() => document.getElementById('review-search')?.focus());
941
+ }, children: _jsx(Search, { className: "size-4" }) }) }), _jsxs(DropdownMenu, { children: [_jsx(Hint, { label: tI18nComplete.raw('text638e249f4a15'), children: _jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { type: "button", variant: filtered ? 'secondary' : 'ghost', size: "icon-sm", "aria-label": tI18nComplete.raw('text638e249f4a15'), className: cn(!filtered && 'text-muted-foreground'), children: _jsx(FunnelSimple, { className: "size-4" }) }) }) }), _jsxs(DropdownMenuContent, { align: "end", className: "w-56", children: [_jsxs(DropdownMenuSub, { children: [_jsxs(DropdownMenuSubTrigger, { children: [_jsx(Shapes, {}), tI18nComplete.raw('textbaaddf70fb5d')] }), _jsx(DropdownMenuSubContent, { className: "w-52", children: _jsx(DropdownMenuRadioGroup, { value: kindFilter, onValueChange: (v) => setKindFilter(v), children: kindFilters.map((f) => {
942
+ const Glyph = f.value === 'all' ? Shapes : ROW_TILE[f.value].icon;
943
+ return (_jsxs(DropdownMenuRadioItem, { value: f.value, side: "left", children: [_jsx(Glyph, { className: "text-muted-foreground size-4 shrink-0" }), f.label, (kindCounts[f.value] ?? 0) > 0 && (_jsx(CountBadge, { count: kindCounts[f.value] ?? 0, className: "ml-auto" }))] }, f.value));
944
+ }) }) })] }), sessionOpts.length > 0 && (_jsxs(DropdownMenuSub, { children: [_jsxs(DropdownMenuSubTrigger, { children: [_jsx(Chats, {}), tI18nComplete.raw('text6959b4159575')] }), _jsx(DropdownMenuSubContent, { className: "max-h-72 w-64 overflow-y-auto", children: _jsxs(DropdownMenuRadioGroup, { value: sessionFilter, onValueChange: setSessionFilter, children: [_jsxs(DropdownMenuRadioItem, { value: "all", side: "left", children: [tI18nComplete.raw('text78648d4d6649'), _jsx(CountBadge, { count: filterItems(items, segment, kindFilter, query, 'all').length, className: "ml-auto" })] }), sessionOpts.map((s) => (_jsxs(DropdownMenuRadioItem, { value: s.sessionId, side: "left", children: [_jsx("span", { className: "truncate", children: s.label }), _jsx(CountBadge, { count: filterItems(items, segment, kindFilter, query, s.sessionId).length, className: "ml-auto" })] }, s.sessionId)))] }) })] })), sessionOpts.length > 0 && (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuCheckboxItem, { checked: grouped, onCheckedChange: setGrouped, className: "pl-8", children: tI18nComplete.raw('text137f98df3b9b') })] })), filtered ? (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuItem, { onSelect: clearFilters, children: tI18nComplete.raw('text7179ea0035fc') })] })) : null] })] })] })] }), showSearch || filtered ? (_jsxs("div", { className: "border-border flex shrink-0 flex-col gap-2 border-b px-2.5 py-2", children: [showSearch ? (_jsxs(InputGroupSearch, { className: "w-full", children: [_jsx(InputGroupSearchIcon, { children: _jsx(Search, {}) }), _jsx(InputGroupSearchInput, { id: "review-search", value: query, onChange: (e) => {
945
+ setQuery(e.target.value);
946
+ setFocusedIdx(0);
947
+ }, onBlur: () => {
948
+ if (!query)
949
+ setSearchOpen(false);
950
+ }, placeholder: tI18nComplete.raw('text49c266baaaa7'), variant: "popover", size: "sm" })] })) : null, filtered ? (_jsxs("div", { className: "flex flex-wrap items-center gap-1.5", children: [activeKind ? (_jsx(FilterChip, { label: activeKind.label, onRemove: () => setKindFilter('all') })) : null, activeSession ? (_jsx(FilterChip, { label: activeSession.label, onRemove: () => setSessionFilter('all') })) : null, grouped ? (_jsx(FilterChip, { label: tI18nComplete.raw('text137f98df3b9b'), onRemove: () => setGrouped(false) })) : null] })) : null] })) : null, _jsxs("div", { className: cn('min-h-0 flex-1 overflow-y-auto p-1.5', selectMode && segment === 'needs_you' && 'pb-20'), children: [segment === 'needs_you' && needsYouDeck && !wide ? (
951
+ // `peer`: when the deck draws nothing (its Undo window after the
952
+ // last card), the list's empty state below shows instead.
953
+ _jsx("div", { className: "peer px-1 pt-1 pb-3 empty:hidden", children: needsYouDeck({ paused: !!selected }) })) : null, listBody, visible.length > 0 && loadMore ? _jsx("div", { className: "pt-2", children: loadMoreButton }) : null] }), selectMode && segment === 'needs_you' ? (
954
+ // Pinned to the bottom of the inbox, not to the end of the list
955
+ // (`sticky` stops where a short list ends, schedule-view.tsx), and
956
+ // across the whole inbox: the list column is too narrow for its verbs.
957
+ _jsx("div", { className: "pointer-events-none absolute inset-x-0 bottom-4 z-10 flex justify-center px-4", children: _jsx("div", { className: "pointer-events-auto w-full max-w-xl", children: _jsx(SelectionBar, { selectedCount: selectedItems.length, allSelected: selectableIds.length > 0 &&
958
+ selectedItems.length >= Math.min(BULK_MAX, selectableIds.length), canSelectAll: selectableIds.length > 0, onSelectAll: () => setSelectedIds(new Set(selectableIds.slice(0, BULK_MAX))), onClear: () => setSelectedIds(new Set()), onExit: exitSelectMode, actions: bulkActions, progress: bulkProgress, animateIn: selectMode !== 'key', note: selectedItems.length >= BULK_MAX && selectableIds.length > BULK_MAX
959
+ ? tBulk('limitNote', { count: BULK_MAX })
960
+ : undefined }) }) })) : null] }), _jsxs("div", { className: cn('min-h-0 min-w-0 flex-1 flex-col @3xl/inbox:flex', selected ? 'flex' : 'hidden'), children: [deckInPane && needsYouDeck ? (
961
+ // Not keyed by the open item and kept mounted while one is open
962
+ // (`paused`, hidden): a staged answer keeps its Undo window.
963
+ _jsxs("div", { className: cn('min-h-0 flex-1 flex-col overflow-y-auto', selected ? 'hidden' : 'flex'), children: [_jsx("div", { className: "peer mx-auto flex min-h-full w-full max-w-2xl flex-col justify-center px-6 py-8 empty:hidden", children: needsYouDeck({ paused: !!selected }) }), _jsx("div", { className: "hidden min-h-full flex-1 peer-empty:flex", children: paneEmpty })] })) : null, selected || !deckInPane ? (
964
+ // Keyed by the open item: each one opens scrolled to its top.
965
+ _jsx("div", { className: "flex min-h-0 flex-1 flex-col overflow-y-auto", children: detail }, selected?.id ?? 'none')) : null] }), _jsx(ConfirmDialog, { open: confirm.open, onOpenChange: (open) => setConfirm((c) => ({ ...c, open })), title: confirmCopy.title, description: confirmCopy.description, confirmLabel: confirmCopy.confirm, confirmVariant: confirm.verb === 'approve' ? 'default' : 'destructive', onConfirm: () => void runBulk(confirm.verb) }), _jsx(KeyboardHelp, { open: helpOpen, onClose: () => setHelpOpen(false) })] }));
966
+ }
967
+ /** One filter in effect, under the list header: its name and a remove button. */
968
+ function FilterChip({ label, onRemove }) {
969
+ const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
970
+ return (_jsxs(Badge, { variant: "secondary", size: "sm", className: "max-w-full gap-1 pr-1", children: [_jsx("span", { className: "truncate", children: label }), _jsx("button", { type: "button", onClick: onRemove, "aria-label": `${tI18nComplete.raw('text83b12c2216ef')} ${label}`, className: "text-muted-foreground hover:text-foreground duration-fast rounded-xs transition-colors", children: _jsx(X, { className: "size-3" }) })] }));
839
971
  }