@kortix/ui 0.16.1 → 0.16.3

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 (277) hide show
  1. package/dist/_vendor/kortix-shared.js +133 -26
  2. package/dist/_vendor/shared/index.d.ts +1 -0
  3. package/dist/_vendor/shared/space-icon.d.ts +30 -0
  4. package/dist/_vendor/shared/space-slug.d.ts +12 -0
  5. package/dist/access/access/access-dialog.js +2 -2
  6. package/dist/access/share-dialog.d.ts +77 -0
  7. package/dist/access/share-dialog.js +160 -0
  8. package/dist/access/sharing-picker.d.ts +8 -1
  9. package/dist/access/sharing-picker.js +2 -2
  10. package/dist/changes/change-list.js +3 -3
  11. package/dist/customize/connectors/catalog/catalog-paging.d.ts +1 -1
  12. package/dist/customize/connectors/catalog/catalog-paging.js +1 -1
  13. package/dist/customize/providers/provider-sheet.js +17 -7
  14. package/dist/customize/sections/component/manifest-copy-block.js +1 -1
  15. package/dist/customize/sections/component/section-wrapper.d.ts +1 -8
  16. package/dist/customize/sections/component/section-wrapper.js +3 -3
  17. package/dist/customize/sections/llm-provider/model-capability-icons.js +1 -1
  18. package/dist/customize/sections/view/gateway/generation-controls.js +1 -1
  19. package/dist/customize/sections/view/git-view.js +1 -1
  20. package/dist/customize/settings/settings-tabs.js +0 -5
  21. package/dist/customize/settings/tabs/general-tab.js +2 -2
  22. package/dist/customize/shared/capability-page-shell.d.ts +2 -2
  23. package/dist/customize/shared/capability-page-shell.js +7 -5
  24. package/dist/customize/shared/capability-scroll-root.js +1 -2
  25. package/dist/customize/shared/catalog/catalog-card.js +1 -1
  26. package/dist/files/project/components/change-requests-panel.js +2 -2
  27. package/dist/files/project/components/checkpoint-detail-dialog.js +4 -4
  28. package/dist/files/project/components/checkpoints-panel.js +2 -2
  29. package/dist/files/project/components/drive-explorer.js +2 -2
  30. package/dist/files/project/components/file-breadcrumbs.js +1 -1
  31. package/dist/files/project/components/file-history-popover.js +2 -2
  32. package/dist/files/project/components/file-thumbnail.js +1 -1
  33. package/dist/files/project/components/open-change-request-dialog.js +1 -1
  34. package/dist/files/renderers/mermaid/mermaid-diagram.js +2 -2
  35. package/dist/files/renderers/show-content-renderer.js +6 -6
  36. package/dist/files/renderers/sqlite-renderer.js +8 -8
  37. package/dist/files/renderers/zip/zip-renderer.js +2 -2
  38. package/dist/files/viewer/file-content-renderer.js +5 -5
  39. package/dist/files/viewer/json-tree-view.js +3 -3
  40. package/dist/i18n/en.d.ts +131 -8
  41. package/dist/i18n/en.js +167 -44
  42. package/dist/i18n/ui-catalog/remaining-ui-translation-keys.generated.js +0 -3
  43. package/dist/internal/billing/use-cost-explorer.d.ts +9 -2
  44. package/dist/internal/billing/use-cost-explorer.js +22 -0
  45. package/dist/internal/billing/use-session-costs.d.ts +7 -2
  46. package/dist/internal/billing/use-session-costs.js +6 -0
  47. package/dist/internal/chrome/use-chrome-offered.d.ts +3 -3
  48. package/dist/internal/chrome/use-chrome-offered.js +3 -3
  49. package/dist/internal/components/nav-rail.d.ts +1 -20
  50. package/dist/internal/components/nav-rail.js +1 -15
  51. package/dist/internal/layout/project-page-header.d.ts +13 -9
  52. package/dist/internal/layout/project-page-header.js +14 -10
  53. package/dist/internal/lib/browser-noise/evidence.d.ts +2 -0
  54. package/dist/internal/lib/browser-noise/rules/injected-scripts.js +16 -1
  55. package/dist/internal/lib/error-handler.js +0 -9
  56. package/dist/internal/lib/interface-theme-defaults.js +2 -2
  57. package/dist/internal/lib/project-actions.d.ts +4 -5
  58. package/dist/internal/lib/project-actions.js +3 -5
  59. package/dist/internal/lib/project-preamble.d.ts +42 -4
  60. package/dist/internal/lib/project-preamble.js +49 -5
  61. package/dist/internal/lib/web-notifications.js +17 -29
  62. package/dist/internal/outcomes/outcome-vocabulary.js +1 -1
  63. package/dist/internal/stores/session-filter-store.d.ts +1 -1
  64. package/dist/internal/stores/user-preferences-store.d.ts +2 -2
  65. package/dist/internal/stores/workspace-settings-rail-store.d.ts +0 -8
  66. package/dist/internal/stores/workspace-settings-rail-store.js +0 -2
  67. package/dist/lib/routes.d.ts +7 -0
  68. package/dist/lib/routes.js +6 -1
  69. package/dist/markdown/doc-editor/doc-extensions.js +2 -0
  70. package/dist/markdown/doc-editor/doc-paste.d.ts +13 -0
  71. package/dist/markdown/doc-editor/doc-paste.js +67 -0
  72. package/dist/markdown/markdown-frontmatter.js +3 -3
  73. package/dist/markdown/markdown-policy.d.ts +1 -1
  74. package/dist/markdown/ordered-list.js +1 -1
  75. package/dist/primitives/context-menu.d.ts +1 -0
  76. package/dist/primitives/definition-list.js +1 -1
  77. package/dist/primitives/dropdown-menu.d.ts +1 -0
  78. package/dist/primitives/emoji-picker.js +1 -1
  79. package/dist/primitives/expandable-search.d.ts +57 -0
  80. package/dist/primitives/expandable-search.js +58 -0
  81. package/dist/primitives/favicon-avatar.js +1 -1
  82. package/dist/primitives/file-tree.d.ts +1 -1
  83. package/dist/primitives/file-tree.js +1 -1
  84. package/dist/primitives/glyph-picker.js +2 -2
  85. package/dist/primitives/input-group.js +1 -1
  86. package/dist/primitives/menu-base.d.ts +10 -0
  87. package/dist/primitives/menu-base.js +7 -2
  88. package/dist/primitives/phone-input.js +1 -1
  89. package/dist/primitives/profile-hover-card.d.ts +28 -0
  90. package/dist/primitives/profile-hover-card.js +22 -0
  91. package/dist/primitives/settings-section-header.d.ts +5 -5
  92. package/dist/primitives/settings-section-header.js +5 -5
  93. package/dist/primitives/sort-menu.d.ts +23 -0
  94. package/dist/primitives/sort-menu.js +54 -0
  95. package/dist/primitives/tabs.js +1 -1
  96. package/dist/primitives/toast-clearance.d.ts +12 -28
  97. package/dist/primitives/toast-clearance.js +23 -45
  98. package/dist/primitives/user-avatar.js +2 -3
  99. package/dist/session/agents/subagent-dialog-content.js +28 -70
  100. package/dist/session/composer/ComposerCard.d.ts +4 -1
  101. package/dist/session/composer/ComposerCard.js +51 -7
  102. package/dist/session/composer/composer-chat-input.js +3 -1
  103. package/dist/session/composer/composer-toolbar.d.ts +3 -1
  104. package/dist/session/composer/composer-toolbar.js +6 -2
  105. package/dist/session/composer/composer-underbar.d.ts +3 -1
  106. package/dist/session/composer/composer-underbar.js +2 -2
  107. package/dist/session/composer/composer.d.ts +12 -0
  108. package/dist/session/composer/composer.js +112 -6
  109. package/dist/session/composer/draft/composer-draft.d.ts +1 -0
  110. package/dist/session/composer/draft/composer-draft.js +10 -2
  111. package/dist/session/composer/draft/draft-uploads.js +13 -2
  112. package/dist/session/composer/draft/use-composer-draft.d.ts +2 -0
  113. package/dist/session/composer/draft/use-composer-draft.js +41 -6
  114. package/dist/session/composer/drive-mentions.d.ts +34 -0
  115. package/dist/session/composer/drive-mentions.js +98 -0
  116. package/dist/session/composer/editor/composer-editor.d.ts +3 -0
  117. package/dist/session/composer/editor/composer-editor.js +3 -1
  118. package/dist/session/composer/editor/serialize.js +3 -4
  119. package/dist/session/composer/menus/mention-controller.d.ts +3 -0
  120. package/dist/session/composer/menus/mention-controller.js +5 -0
  121. package/dist/session/composer/menus/mention-menu.d.ts +20 -3
  122. package/dist/session/composer/menus/mention-menu.js +33 -6
  123. package/dist/session/composer/menus/menu-items.d.ts +16 -1
  124. package/dist/session/composer/menus/menu-items.js +21 -1
  125. package/dist/session/composer/submit-latch.d.ts +3 -1
  126. package/dist/session/composer/submit-latch.js +5 -1
  127. package/dist/session/composer/types.d.ts +9 -2
  128. package/dist/session/header/session-changes-indicator.js +1 -1
  129. package/dist/session/header/session-site-header.js +2 -2
  130. package/dist/session/media/sandbox-url-detector.js +3 -3
  131. package/dist/session/models/model-connection-gate.d.ts +5 -0
  132. package/dist/session/models/model-connection-gate.js +12 -3
  133. package/dist/session/models/model-connection-layout.d.ts +7 -0
  134. package/dist/session/models/model-connection-layout.js +7 -0
  135. package/dist/session/models/provider-failure-recovery.js +1 -1
  136. package/dist/session/models/subscription-offer.d.ts +6 -5
  137. package/dist/session/models/subscription-offer.js +6 -6
  138. package/dist/session/panel/advanced/advanced-panel.js +1 -1
  139. package/dist/session/panel/session-detail-panel.js +1 -1
  140. package/dist/session/panel/session-diff-viewer.js +1 -1
  141. package/dist/session/panel/session-files-explorer.js +1 -1
  142. package/dist/session/panel/session-files-panel.js +3 -3
  143. package/dist/session/panel/shared/action-navigator.js +1 -1
  144. package/dist/session/status/provisioning-failure.d.ts +4 -4
  145. package/dist/session/status/provisioning-failure.js +4 -4
  146. package/dist/session/status/session-busy-indicator.js +1 -1
  147. package/dist/session/status/session-error-banner.js +6 -1
  148. package/dist/session/thread/mention-chip.d.ts +1 -1
  149. package/dist/session/thread/mention-segments.d.ts +4 -2
  150. package/dist/session/thread/mention-segments.js +28 -1
  151. package/dist/session/thread/message-parsing.d.ts +11 -0
  152. package/dist/session/thread/message-parsing.js +22 -3
  153. package/dist/session/thread/optimistic-turn.d.ts +4 -2
  154. package/dist/session/thread/optimistic-turn.js +13 -11
  155. package/dist/session/thread/session-chat.js +6 -1
  156. package/dist/session/thread/session-context-message-explorer.js +1 -1
  157. package/dist/session/thread/session-older-autoload.d.ts +2 -3
  158. package/dist/session/thread/session-older-autoload.js +2 -3
  159. package/dist/session/thread/transcript.js +8 -10
  160. package/dist/session/tool/shared/error-and-connector.js +1 -1
  161. package/dist/session/tool/shared/file-list.js +2 -2
  162. package/dist/session/tool/shared/infrastructure-parts.js +1 -1
  163. package/dist/session/tool/shared/infrastructure-preview.js +1 -1
  164. package/dist/session/tool/shared/infrastructure-row-header.js +3 -3
  165. package/dist/session/tool/shared/infrastructure-rows.js +2 -2
  166. package/dist/session/tool/shared/output-block.js +4 -4
  167. package/dist/session/tool/shared/session-helpers.js +3 -3
  168. package/dist/session/tool/shared/structured-output.js +3 -3
  169. package/dist/session/tool/shared/todo-helpers.js +1 -1
  170. package/dist/session/tool/tool-error.js +2 -2
  171. package/dist/session/tool/tools/agent-spawn-tool.js +3 -3
  172. package/dist/session/tool/tools/agent-status-tool.js +1 -1
  173. package/dist/session/tool/tools/apply-patch-tool.js +1 -1
  174. package/dist/session/tool/tools/connector-get-tool.js +1 -1
  175. package/dist/session/tool/tools/connector-list-tool.js +1 -1
  176. package/dist/session/tool/tools/connector-tools.js +1 -1
  177. package/dist/session/tool/tools/edit-tool.js +1 -1
  178. package/dist/session/tool/tools/get-mem-tool.js +1 -1
  179. package/dist/session/tool/tools/glob-tool.js +1 -1
  180. package/dist/session/tool/tools/image-search-tool.js +1 -1
  181. package/dist/session/tool/tools/memory-search-tool.js +1 -1
  182. package/dist/session/tool/tools/memory-tool.js +4 -4
  183. package/dist/session/tool/tools/presentation-gen-tool.js +2 -2
  184. package/dist/session/tool/tools/project-delete-tool.js +1 -1
  185. package/dist/session/tool/tools/project-list-tool.js +1 -1
  186. package/dist/session/tool/tools/pty-read-tool.js +1 -1
  187. package/dist/session/tool/tools/pty-spawn-tool.js +1 -1
  188. package/dist/session/tool/tools/pty-write-tool.js +1 -1
  189. package/dist/session/tool/tools/read-tool.js +1 -1
  190. package/dist/session/tool/tools/removed-connector-tool.js +1 -1
  191. package/dist/session/tool/tools/scrape-webpage-tool.js +1 -1
  192. package/dist/session/tool/tools/session-get-tool.js +3 -3
  193. package/dist/session/tool/tools/session-list-background-tool.js +1 -1
  194. package/dist/session/tool/tools/session-read-tool.js +1 -1
  195. package/dist/session/tool/tools/session-search-tool.js +1 -1
  196. package/dist/session/tool/tools/session-spawn-tool.js +1 -1
  197. package/dist/session/tool/tools/skill-tool.js +1 -1
  198. package/dist/session/tool/tools/todo-write-tool.js +1 -1
  199. package/dist/session/tool/tools/web-fetch-tool.js +1 -1
  200. package/dist/session/tool/tools/write-tool.js +1 -1
  201. package/dist/session/turn/activity-file-chips.js +7 -3
  202. package/dist/session/turn/activity-step.js +1 -1
  203. package/dist/session/turn/burst-summary-trigger.js +3 -3
  204. package/dist/session/turn/chain-step-trigger.js +1 -1
  205. package/dist/session/turn/plan-card.js +1 -1
  206. package/dist/session/turn/thought-chain-step.js +1 -1
  207. package/dist/session/turn/turn-work-accordion.js +1 -1
  208. package/dist/session/turn/user-message.js +13 -6
  209. package/dist/session/voice/use-call-card-position.d.ts +30 -0
  210. package/dist/session/voice/use-call-card-position.js +126 -0
  211. package/dist/session/voice/voice-call-card.js +10 -3
  212. package/dist/styles/theme.css +12 -0
  213. package/dist/styles/tokens.css +12 -6
  214. package/dist/styles.css +1 -1
  215. package/dist/terminal/session-terminal-panel.js +1 -1
  216. package/dist/test-utils/intl.d.ts +131 -8
  217. package/dist/workspace/admin/project-admin-dashboard.js +7 -24
  218. package/dist/workspace/calendar/calendar-page.js +1 -1
  219. package/dist/workspace/home/first-chat.d.ts +4 -3
  220. package/dist/workspace/home/first-chat.js +6 -6
  221. package/dist/workspace/home/welcome-body.js +2 -2
  222. package/dist/workspace/index.d.ts +1 -1
  223. package/dist/workspace/index.js +1 -1
  224. package/dist/workspace/layout/project-home.js +9 -3
  225. package/dist/workspace/layout/use-project-home-send.d.ts +3 -1
  226. package/dist/workspace/layout/use-project-home-send.js +6 -2
  227. package/dist/workspace/memory/company-memory-page.js +2 -4
  228. package/dist/workspace/new/github-source.js +0 -1
  229. package/dist/workspace/new/new-workspace-form.d.ts +0 -1
  230. package/dist/workspace/new/new-workspace-form.js +0 -3
  231. package/dist/workspace/new/use-create-workspace.d.ts +1 -1
  232. package/dist/workspace/new/use-create-workspace.js +1 -2
  233. package/dist/workspace/session-spaces/space-detail-page.d.ts +35 -0
  234. package/dist/workspace/session-spaces/space-detail-page.js +307 -0
  235. package/dist/workspace/session-spaces/space-form-modal.d.ts +16 -0
  236. package/dist/workspace/session-spaces/space-form-modal.js +92 -0
  237. package/dist/workspace/session-spaces/space-icon.d.ts +36 -0
  238. package/dist/workspace/session-spaces/space-icon.js +52 -0
  239. package/dist/workspace/session-spaces/space-people.d.ts +51 -0
  240. package/dist/workspace/session-spaces/space-people.js +91 -0
  241. package/dist/workspace/session-spaces/space-picker.d.ts +11 -0
  242. package/dist/workspace/session-spaces/space-picker.js +42 -0
  243. package/dist/workspace/session-spaces/space-share-modal.d.ts +14 -0
  244. package/dist/workspace/session-spaces/space-share-modal.js +93 -0
  245. package/dist/workspace/session-spaces/spaces-page.d.ts +8 -0
  246. package/dist/workspace/session-spaces/spaces-page.js +125 -0
  247. package/dist/workspace/sessions/session-owner-filters.d.ts +2 -0
  248. package/dist/workspace/sessions/session-owner-filters.js +2 -0
  249. package/dist/workspace/sidebar/footer/project-artifacts-nav.js +1 -1
  250. package/dist/workspace/sidebar/footer/project-promo-cards.d.ts +7 -2
  251. package/dist/workspace/sidebar/footer/project-promo-cards.js +4 -3
  252. package/dist/workspace/sidebar/footer/project-sandbox-alert.js +1 -1
  253. package/dist/workspace/sidebar/footer/promo-card.d.ts +10 -1
  254. package/dist/workspace/sidebar/footer/promo-card.js +31 -2
  255. package/dist/workspace/sidebar/modal/session-people-picker.d.ts +13 -0
  256. package/dist/workspace/sidebar/modal/session-people-picker.js +72 -0
  257. package/dist/workspace/sidebar/modal/share-session-modal.js +2 -1
  258. package/dist/workspace/sidebar/project-nav-items.d.ts +1 -3
  259. package/dist/workspace/sidebar/project-nav-items.js +3 -8
  260. package/dist/workspace/sidebar/project-session-list.js +19 -12
  261. package/dist/workspace/sidebar/project-sidebar.js +13 -13
  262. package/dist/workspace/sidebar/project-spaces-nav.js +1 -2
  263. package/dist/workspace/sidebar/session-filter-menu.js +19 -13
  264. package/dist/workspace/sidebar/session-group-sections.d.ts +12 -12
  265. package/dist/workspace/sidebar/session-group-sections.js +56 -75
  266. package/dist/workspace/sidebar/sidebar-more-group.js +1 -1
  267. package/dist/workspace/sidebar/workspace-settings-sidebar-nav.js +2 -2
  268. package/dist/workspace/spaces/space-tabs.d.ts +26 -6
  269. package/dist/workspace/spaces/space-tabs.js +19 -8
  270. package/package.json +27 -31
  271. package/skills/kortix-ui/references/modules.md +2 -2
  272. package/dist/workspace/new/clone-param.d.ts +0 -11
  273. package/dist/workspace/new/clone-param.js +0 -15
  274. package/dist/workspace/new/provision-new-workspace.d.ts +0 -14
  275. package/dist/workspace/new/provision-new-workspace.js +0 -14
  276. package/dist/workspace/sidebar/footer/project-inbox-nav.d.ts +0 -8
  277. package/dist/workspace/sidebar/footer/project-inbox-nav.js +0 -29
@@ -0,0 +1,160 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { CaretDownIcon, CheckIcon, UsersThreeIcon, XIcon } from '@phosphor-icons/react';
4
+ import { useId, useMemo, useRef, useState } from 'react';
5
+ import { Copy } from '../icons/copy.js';
6
+ import { cn } from '../lib/utils.js';
7
+ import { Button } from '../primitives/button.js';
8
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuTrigger, } from '../primitives/dropdown-menu.js';
9
+ import { inputSurfaceClasses, inputTransitionClasses } from '../primitives/input.js';
10
+ import Loading from '../primitives/loading.js';
11
+ import { menuRow } from '../primitives/menu-recipe.js';
12
+ import { Popover, PopoverAnchor, PopoverContent } from '../primitives/popover.js';
13
+ import { UserAvatar } from '../primitives/user-avatar.js';
14
+ /*
15
+ * The share dialog's parts: a space and a session share through the same
16
+ * layout (design-system skill, "Grouped rows" and "Composition"). One group is
17
+ * ONE bordered container with hairlines between rows; every row has the same
18
+ * inset (px-3), leading slot (size-8), height (min-h-14) and trailing edge.
19
+ */
20
+ export const SHARE_GROUP = 'divide-border border-border divide-y rounded-md border';
21
+ export const SHARE_ROW = 'flex min-h-14 items-center gap-3 px-3 py-2';
22
+ const SECTION_LABEL = 'text-muted-foreground text-xs font-medium';
23
+ /** A text button in the trailing slot: its label, not its padding, ends on the row's edge. */
24
+ const TRAILING_BUTTON = 'text-muted-foreground hover:text-foreground -mr-2.5 gap-1';
25
+ function CandidateAvatar({ candidate, size }) {
26
+ if (candidate.kind === 'group') {
27
+ const box = { xs: 'size-5', sm: 'size-6', md: 'size-8' }[size];
28
+ return (_jsx("span", { className: cn('bg-muted text-muted-foreground flex shrink-0 items-center justify-center rounded-sm', box), children: _jsx(UsersThreeIcon, { className: size === 'md' ? 'size-4' : 'size-3' }) }));
29
+ }
30
+ return (_jsx(UserAvatar, { email: candidate.email || candidate.id, name: candidate.label, avatarUrl: candidate.avatarUrl, colorKey: candidate.id, size: size }));
31
+ }
32
+ /** A labelled section: the label above one group of rows. */
33
+ export function ShareSection({ label, children }) {
34
+ return (_jsxs("section", { className: "space-y-2", children: [_jsx("h3", { className: SECTION_LABEL, children: label }), children] }));
35
+ }
36
+ /** One row with access: picture or group tile, name over meta, and the trailing slot. */
37
+ export function ShareRow({ candidate, trailing }) {
38
+ return (_jsxs("li", { className: SHARE_ROW, children: [_jsx(CandidateAvatar, { candidate: candidate, size: "md" }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: "text-foreground truncate text-sm leading-tight", children: candidate.label }), candidate.sublabel ? _jsx("p", { className: "text-muted-foreground truncate text-xs leading-tight", children: candidate.sublabel }) : null] }), _jsx("div", { className: "flex shrink-0 items-center", children: trailing })] }));
39
+ }
40
+ /** The trailing role word of a row that cannot change ("Owner"). */
41
+ export function ShareRole({ children }) {
42
+ return _jsx("span", { className: "text-muted-foreground text-sm", children: children });
43
+ }
44
+ /** The trailing role menu of a row that can be removed: "Member ▾" → Remove. */
45
+ export function ShareRoleMenu({ label, removeLabel, removeIcon, onRemove, disabled, }) {
46
+ return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { variant: "ghost", size: "sm", className: TRAILING_BUTTON, disabled: disabled, children: [label, _jsx(CaretDownIcon, { className: "size-3 shrink-0" })] }) }), _jsx(DropdownMenuContent, { align: "end", className: "w-44", children: _jsxs(DropdownMenuItem, { variant: "destructive", className: "cursor-pointer", onSelect: onRemove, children: [removeIcon, removeLabel] }) })] }));
47
+ }
48
+ /** General access: one row, the current choice on the left, "Change ▾" on the right. */
49
+ export function ShareGeneralAccess({ value, options, onChange, changeLabel, disabled, }) {
50
+ const current = options.find((option) => option.value === value) ?? options[0];
51
+ return (_jsx("div", { className: SHARE_GROUP, children: _jsxs("div", { className: SHARE_ROW, children: [_jsx("span", { className: "bg-muted text-muted-foreground flex size-8 shrink-0 items-center justify-center rounded-md [&_svg]:size-4", children: current.icon }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: "text-foreground truncate text-sm leading-tight", children: current.label }), _jsx("p", { className: "text-muted-foreground truncate text-xs leading-tight", children: current.hint })] }), disabled ? null : (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { variant: "ghost", size: "sm", className: TRAILING_BUTTON, children: [changeLabel, _jsx(CaretDownIcon, { className: "size-3 shrink-0" })] }) }), _jsx(DropdownMenuContent, { align: "end", className: "w-60", children: _jsx(DropdownMenuRadioGroup, { value: value, onValueChange: (next) => next !== value && onChange(next), children: options.map((option) => (_jsx(DropdownMenuRadioItem, { value: option.value, disabled: option.disabled, className: "cursor-pointer", children: option.label }, option.value))) }) })] }))] }) }));
52
+ }
53
+ /** The thing's link in a muted field, with Copy link one inset from three edges. */
54
+ export function ShareLinkField({ link, copyLabel, onCopy }) {
55
+ return (_jsxs("div", { className: "bg-muted/50 border-border flex h-10 items-center gap-2 rounded-md border p-1 pl-3", children: [_jsx("span", { className: "text-muted-foreground min-w-0 flex-1 truncate text-sm", children: link }), _jsxs(Button, { type: "button", size: "sm", variant: "outline", className: "bg-background h-full shrink-0 gap-1.5", onClick: onCopy, children: [_jsx(Copy, { className: "size-3.5 shrink-0" }), copyLabel] })] }));
56
+ }
57
+ /**
58
+ * Add people (and groups): a multi-select field and a Share button of one
59
+ * height. Focus lists everyone who can still be added; typing narrows it;
60
+ * picking stages a chip; pasting or typing emails (comma, space or newline
61
+ * separated) stages every member they match. Share hands the whole set over.
62
+ */
63
+ export function ShareAddField({ candidates, excludeIds, onShare, pending, disabled, placeholder, shareLabel, removeLabel, onUnknownEmails, }) {
64
+ const inputId = useId();
65
+ const [query, setQuery] = useState('');
66
+ const [staged, setStaged] = useState([]);
67
+ const [focused, setFocused] = useState(false);
68
+ const fieldRef = useRef(null);
69
+ const stagedIds = useMemo(() => new Set(staged.map((candidate) => candidate.id)), [staged]);
70
+ const byEmail = useMemo(() => new Map(candidates.filter((candidate) => candidate.email).map((candidate) => [candidate.email.toLowerCase(), candidate])), [candidates]);
71
+ const needle = query.trim().toLowerCase();
72
+ // Everyone is listed; typing only searches. Who already has access or is
73
+ // picked shows a check and cannot be added twice.
74
+ const suggestions = useMemo(() => needle
75
+ ? candidates.filter((candidate) => candidate.label.toLowerCase().includes(needle) || candidate.email?.toLowerCase().includes(needle))
76
+ : candidates, [candidates, needle]);
77
+ const addable = suggestions.filter((candidate) => !excludeIds.has(candidate.id) && !stagedIds.has(candidate.id));
78
+ const stage = (picked) => {
79
+ setStaged((current) => [...current, ...picked.filter((candidate) => !current.some((other) => other.id === candidate.id))]);
80
+ setQuery('');
81
+ };
82
+ /** Every email in `text` that matches someone who can be added; the rest come back. */
83
+ const resolveEmails = (text) => {
84
+ const found = [];
85
+ const unknown = [];
86
+ for (const raw of text.split(/[\s,;]+/)) {
87
+ const email = raw.trim().toLowerCase();
88
+ if (!email)
89
+ continue;
90
+ const candidate = byEmail.get(email);
91
+ if (!candidate)
92
+ unknown.push(email);
93
+ else if (!excludeIds.has(candidate.id))
94
+ found.push(candidate);
95
+ }
96
+ return { found, unknown };
97
+ };
98
+ const submit = async () => {
99
+ let picked = [...staged];
100
+ if (needle) {
101
+ if (!needle.includes('@') && addable.length === 1)
102
+ picked.push(addable[0]);
103
+ else {
104
+ const { found, unknown } = resolveEmails(needle);
105
+ if (unknown.length) {
106
+ onUnknownEmails(unknown);
107
+ return;
108
+ }
109
+ picked = [...picked, ...found];
110
+ }
111
+ }
112
+ picked = picked.filter((candidate, index) => picked.findIndex((other) => other.id === candidate.id) === index);
113
+ if (picked.length === 0)
114
+ return;
115
+ if (await onShare(picked)) {
116
+ setStaged([]);
117
+ setQuery('');
118
+ }
119
+ };
120
+ const showSuggestions = focused && suggestions.length > 0;
121
+ const off = disabled || pending;
122
+ return (_jsxs("form", { className: "flex gap-2", onSubmit: (event) => {
123
+ event.preventDefault();
124
+ void submit();
125
+ }, children: [_jsx(Popover, { open: showSuggestions, onOpenChange: (next) => !next && setFocused(false), children: _jsxs("div", { className: "relative min-w-0 flex-1", children: [_jsx(PopoverAnchor, { asChild: true, children: _jsxs("div", { ref: fieldRef, className: cn(inputSurfaceClasses, inputTransitionClasses, 'focus-within:border-ring focus-within:ring-ring/15 flex min-h-10 cursor-text flex-wrap items-center gap-1 px-1 py-1 focus-within:ring-3', off && 'pointer-events-none opacity-50'), onClick: () => document.getElementById(inputId)?.focus(), children: [staged.map((candidate) => (_jsxs("span", { className: "bg-muted text-foreground flex h-7 max-w-full items-center gap-1.5 rounded-sm pr-0.5 pl-1 text-sm", children: [_jsx(CandidateAvatar, { candidate: candidate, size: "xs" }), _jsx("span", { className: "min-w-0 truncate", children: candidate.label }), _jsx(Button, { type: "button", variant: "ghost", size: "icon-xs", "aria-label": removeLabel, className: "text-muted-foreground hover:text-foreground size-6 shrink-0", onClick: (event) => {
126
+ event.stopPropagation();
127
+ setStaged((current) => current.filter((other) => other.id !== candidate.id));
128
+ }, children: _jsx(XIcon, { className: "size-3" }) })] }, candidate.id))), _jsx("input", { id: inputId, autoComplete: "off", value: query, disabled: off, placeholder: staged.length ? '' : placeholder, "aria-label": placeholder, role: "combobox", "aria-expanded": showSuggestions, "aria-controls": `${inputId}-list`, className: "text-foreground placeholder:text-muted-foreground h-8 min-w-32 flex-1 bg-transparent px-2 text-sm font-medium outline-none", onFocus: () => setFocused(true), onBlur: () => setFocused(false), onChange: (event) => setQuery(event.target.value), onPaste: (event) => {
129
+ const text = event.clipboardData.getData('text');
130
+ if (!/[\s,;]/.test(text.trim()))
131
+ return;
132
+ event.preventDefault();
133
+ const { found, unknown } = resolveEmails(text);
134
+ if (found.length)
135
+ stage(found);
136
+ if (unknown.length) {
137
+ setQuery(unknown.join(', '));
138
+ onUnknownEmails(unknown);
139
+ }
140
+ }, onKeyDown: (event) => {
141
+ if (event.key === 'Backspace' && !query && staged.length)
142
+ setStaged((current) => current.slice(0, -1));
143
+ if ((event.key === ',' || event.key === ' ') && query.includes('@')) {
144
+ event.preventDefault();
145
+ const { found, unknown } = resolveEmails(query);
146
+ if (found.length)
147
+ stage(found);
148
+ if (unknown.length)
149
+ onUnknownEmails(unknown);
150
+ }
151
+ } })] }) }), _jsx(PopoverContent, { align: "start", sideOffset: 4, className: "w-(--anchor-width) p-1", onOpenAutoFocus: (event) => event.preventDefault(), onCloseAutoFocus: (event) => event.preventDefault(), onInteractOutside: (event) => {
152
+ if (fieldRef.current?.contains(event.target))
153
+ event.preventDefault();
154
+ }, children: _jsx("ul", { id: `${inputId}-list`, role: "listbox", className: "max-h-72 overflow-y-auto overscroll-contain", children: suggestions.map((candidate) => {
155
+ const chosen = excludeIds.has(candidate.id) || stagedIds.has(candidate.id);
156
+ return (_jsx("li", { role: "option", "aria-selected": chosen, children: _jsxs("button", { type: "button", disabled: chosen,
157
+ // Keep focus in the field until the click lands.
158
+ onMouseDown: (event) => event.preventDefault(), onClick: () => stage([candidate]), className: menuRow('lg', 'default', cn('gap-2.5 py-1.5 text-left', chosen ? 'cursor-default' : 'cursor-pointer')), children: [_jsx(CandidateAvatar, { candidate: candidate, size: "sm" }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "text-foreground block truncate text-sm", children: candidate.label }), candidate.sublabel ? (_jsx("span", { className: "text-muted-foreground block truncate text-xs font-normal", children: candidate.sublabel })) : null] }), chosen ? _jsx(CheckIcon, { "aria-hidden": true, className: "text-muted-foreground size-4 shrink-0" }) : null] }) }, candidate.id));
159
+ }) }) })] }) }), _jsxs(Button, { type: "submit", size: "lg", className: "shrink-0", disabled: off || (!needle && staged.length === 0), children: [pending ? _jsx(Loading, { className: "size-4 shrink-0" }) : null, shareLabel] })] }));
160
+ }
@@ -1,3 +1,4 @@
1
+ import type { ReactNode } from 'react';
1
2
  import { type PrincipalKind } from './access/index.js';
2
3
  import { type SharingCopy, type SharingMode, type SharingSelection } from './sharing-intent.js';
3
4
  export { PrincipalPicker } from './access/index.js';
@@ -10,7 +11,7 @@ export declare function ShareOption({ value, label, desc, disabled, }: {
10
11
  /** @deprecated Selection state comes from the parent `RadioGroup`. */
11
12
  current?: string;
12
13
  }): import("react").JSX.Element;
13
- export declare function SharingPicker({ projectId, value, onChange, copy, showHeading, hideMembers, disabledModes, }: {
14
+ export declare function SharingPicker({ projectId, value, onChange, copy, showHeading, hideMembers, disabledModes, renderMembers, }: {
14
15
  projectId: string;
15
16
  value: SharingSelection;
16
17
  onChange: (next: SharingSelection) => void;
@@ -29,6 +30,12 @@ export declare function SharingPicker({ projectId, value, onChange, copy, showHe
29
30
  * they inherit it). Keeps one mental model: resources live on agents.
30
31
  */
31
32
  hideMembers?: boolean;
33
+ /**
34
+ * What "specific people" shows under the options. Absent: the search list
35
+ * (`SubjectPicker`). The session share dialog passes its own: the add field
36
+ * and the people with access (`access/share-dialog`).
37
+ */
38
+ renderMembers?: (value: SharingSelection, onChange: (next: SharingSelection) => void) => ReactNode;
32
39
  }): import("react").JSX.Element;
33
40
  /**
34
41
  * Legacy adapter over {@link PrincipalPicker}, kept ONLY for the
@@ -22,7 +22,7 @@ export { intentToSelection, isSharingComplete, selectionToIntent, } from './shar
22
22
  export function ShareOption({ value, label, desc, disabled = false, }) {
23
23
  return (_jsx(RadioGroupItem, { value: value, id: `share-option-${value}`, label: label, description: desc, disabled: disabled, size: "lg", variant: "outline" }));
24
24
  }
25
- export function SharingPicker({ projectId, value, onChange, copy, showHeading = true, hideMembers = false, disabledModes, }) {
25
+ export function SharingPicker({ projectId, value, onChange, copy, showHeading = true, hideMembers = false, disabledModes, renderMembers, }) {
26
26
  const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
27
27
  const c = localizeUiCatalog({
28
28
  heading: copy?.heading ?? DEFAULT_COPY.heading,
@@ -40,7 +40,7 @@ export function SharingPicker({ projectId, value, onChange, copy, showHeading =
40
40
  // account. Offer no "specific people" there, unless the value already is one.
41
41
  const { accountApiEnabled } = useUiHostConfig();
42
42
  const offerMembers = !hideMembers && (accountApiEnabled || value.mode === 'members');
43
- return (_jsxs("div", { className: "space-y-3", children: [showHeading && _jsx(Label, { children: c.heading }), _jsxs(RadioGroup, { value: value.mode, onValueChange: (v) => onChange({ ...value, mode: v }), className: "space-y-2", children: [_jsx(ShareOption, { value: "project", label: c.project.label, desc: c.project.desc, disabled: isDisabled('project') }), _jsx(ShareOption, { value: "private", label: c.private.label, desc: c.private.desc, disabled: isDisabled('private') }), offerMembers && (_jsx(ShareOption, { value: "members", label: c.members.label, desc: c.members.desc, disabled: isDisabled('members') }))] }), offerMembers && value.mode === 'members' && (_jsx(SubjectPicker, { projectId: projectId, memberIds: value.memberIds, groupIds: value.groupIds, onChange: (memberIds, groupIds) => onChange({ ...value, memberIds, groupIds }) })), hideMembers && !legacyMembers && (_jsxs("p", { className: "text-muted-foreground text-xs leading-relaxed", children: [tI18nComplete.raw('text558b36e065df'), ' ', _jsx("span", { className: "text-foreground/80 font-medium", children: tI18nComplete.raw('textd4f0bc5a29de') }), ' ', tI18nComplete.raw('text3a71ebb2d593')] })), legacyMembers && (_jsx("p", { className: "text-xs leading-relaxed text-amber-600 dark:text-amber-400", children: tI18nComplete.raw('text64f4c4bd39c9') }))] }));
43
+ return (_jsxs("div", { className: "space-y-3", children: [showHeading && _jsx(Label, { children: c.heading }), _jsxs(RadioGroup, { value: value.mode, onValueChange: (v) => onChange({ ...value, mode: v }), className: "space-y-2", children: [_jsx(ShareOption, { value: "project", label: c.project.label, desc: c.project.desc, disabled: isDisabled('project') }), _jsx(ShareOption, { value: "private", label: c.private.label, desc: c.private.desc, disabled: isDisabled('private') }), offerMembers && (_jsx(ShareOption, { value: "members", label: c.members.label, desc: c.members.desc, disabled: isDisabled('members') }))] }), offerMembers && value.mode === 'members' && renderMembers ? renderMembers(value, onChange) : null, offerMembers && value.mode === 'members' && !renderMembers && (_jsx(SubjectPicker, { projectId: projectId, memberIds: value.memberIds, groupIds: value.groupIds, onChange: (memberIds, groupIds) => onChange({ ...value, memberIds, groupIds }) })), hideMembers && !legacyMembers && (_jsxs("p", { className: "text-muted-foreground text-xs leading-relaxed", children: [tI18nComplete.raw('text558b36e065df'), ' ', _jsx("span", { className: "text-foreground/80 font-medium", children: tI18nComplete.raw('textd4f0bc5a29de') }), ' ', tI18nComplete.raw('text3a71ebb2d593')] })), legacyMembers && (_jsx("p", { className: "text-xs leading-relaxed text-amber-600 dark:text-amber-400", children: tI18nComplete.raw('text64f4c4bd39c9') }))] }));
44
44
  }
45
45
  const NO_INVITE_EMAILS = [];
46
46
  /**
@@ -43,7 +43,7 @@ const ROW_TRANSITION = { duration: 0.18, ease: [0.23, 1, 0.32, 1] };
43
43
  export function ChangeSummary({ entries, className, }) {
44
44
  const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
45
45
  const totals = useMemo(() => totalChanges(entries), [entries]);
46
- return (_jsxs("span", { className: cn('text-muted-foreground flex min-w-0 items-center gap-1.5 text-xs tabular-nums', className), children: [_jsx("span", { className: "shrink-0", children: fileCount(totals.files) }), (totals.additions > 0 || totals.deletions > 0) && (_jsxs(_Fragment, { children: [_jsx("span", { className: "text-muted-foreground/40", "aria-hidden": true, children: tI18nComplete.raw('text3b9453dad42b') }), _jsx(DiffStat, { additions: totals.additions, deletions: totals.deletions })] }))] }));
46
+ return (_jsxs("span", { className: cn('text-muted-foreground flex min-w-0 items-center gap-1.5 text-xs tabular-nums', className), children: [_jsx("span", { className: "shrink-0", children: fileCount(totals.files) }), (totals.additions > 0 || totals.deletions > 0) && (_jsxs(_Fragment, { children: [_jsx("span", { className: "text-muted-foreground", "aria-hidden": true, children: tI18nComplete.raw('text3b9453dad42b') }), _jsx(DiffStat, { additions: totals.additions, deletions: totals.deletions })] }))] }));
47
47
  }
48
48
  // ---------------------------------------------------------------------------
49
49
  // layout toggle
@@ -60,7 +60,7 @@ export function DiffLayoutToggle({ layout, onChange, className, }) {
60
60
  const active = layout === value;
61
61
  return (_jsx(Hint, { label: translateUiCatalogText(DIFF_LAYOUT_LABEL[value], tI18nComplete, REMAINING_UI_TRANSLATION_KEYS), side: "bottom", children: _jsx(Button, { type: "button", variant: "outline", size: "icon-sm", "aria-label": translateUiCatalogText(DIFF_LAYOUT_LABEL[value], tI18nComplete, REMAINING_UI_TRANSLATION_KEYS), "aria-pressed": active, onClick: () => onChange(value), className: cn('active:scale-[0.96]', active
62
62
  ? 'bg-secondary text-foreground'
63
- : 'text-muted-foreground/70 hover:text-foreground'), children: _jsx(Icon, { className: "size-3.5" }) }) }, value));
63
+ : 'text-muted-foreground hover:text-foreground'), children: _jsx(Icon, { className: "size-3.5" }) }) }, value));
64
64
  }) }));
65
65
  }
66
66
  // ---------------------------------------------------------------------------
@@ -75,7 +75,7 @@ function ChangeRow({ entry, layout, open, onOpenChange, }) {
75
75
  };
76
76
  const { name, dir } = splitPath(entry.path);
77
77
  const from = entry.fromPath && entry.fromPath !== entry.path ? splitPath(entry.fromPath) : null;
78
- return (_jsx("li", { children: _jsxs(Disclosure, { open: open, onOpenChange: onOpenChange, transition: ROW_TRANSITION, className: "group/row", children: [_jsx(DisclosureTrigger, { children: _jsxs("div", { title: `${kind.label} — ${entry.path}`, className: cn('group/trigger hover:bg-muted/40 flex min-h-10 w-full cursor-pointer items-center gap-2.5 px-3 py-2 text-left transition-colors', 'focus-visible:ring-kortix-base outline-none focus-visible:ring-[0.6px]'), children: [_jsxs("span", { className: "relative inline-flex size-3.5 shrink-0 items-center justify-center", children: [_jsx("span", { "aria-hidden": true, className: cn('absolute inset-0 m-auto size-1.5 rounded-full transition-opacity duration-150 ease-out', 'group-hover/trigger:opacity-0 group-focus-visible/trigger:opacity-0', STATUS_DOT[kind.tone]) }), _jsx(CaretRightIcon, { "aria-hidden": true, className: cn('text-muted-foreground absolute inset-0 size-3.5 opacity-0', 'transition-[opacity,rotate] duration-150 ease-out', 'group-hover/trigger:opacity-100 group-focus-visible/trigger:opacity-100', 'group-data-[state=open]/row:rotate-90') })] }), _jsxs("span", { className: "sr-only", children: [kind.label, ":"] }), _jsx("span", { className: "text-foreground min-w-0 shrink truncate text-sm", children: name }), dir && (_jsx("span", { className: "text-muted-foreground/50 hidden min-w-0 shrink truncate text-xs sm:inline", children: dir })), from && (_jsxs("span", { className: "text-muted-foreground/50 hidden shrink-0 truncate text-xs md:inline", children: [tI18nComplete.raw('text75857a458999'), " ", from.name] })), _jsx(DiffStat, { additions: entry.additions, deletions: entry.deletions, className: "ml-auto shrink-0 text-xs" })] }) }), _jsx(DisclosureContent, { className: "max-w-full overflow-hidden", children: _jsx("div", { className: "border-border/60 border-t", children: entry.patch ? (_jsx("div", { className: "max-w-full overflow-x-auto", children: _jsx(DiffView, { patch: entry.patch, layout: layout, hideFileHeader: true, className: cn('bg-background', diffViewportClass(layout)) }) })) : (_jsx("p", { className: "text-muted-foreground px-3 py-6 text-center text-xs", children: tI18nComplete.raw('text903237107ab6') })) }) })] }) }));
78
+ return (_jsx("li", { children: _jsxs(Disclosure, { open: open, onOpenChange: onOpenChange, transition: ROW_TRANSITION, className: "group/row", children: [_jsx(DisclosureTrigger, { children: _jsxs("div", { title: `${kind.label} — ${entry.path}`, className: cn('group/trigger hover:bg-muted/40 flex min-h-10 w-full cursor-pointer items-center gap-2.5 px-3 py-2 text-left transition-colors', 'focus-visible:ring-kortix-base outline-none focus-visible:ring-[0.6px]'), children: [_jsxs("span", { className: "relative inline-flex size-3.5 shrink-0 items-center justify-center", children: [_jsx("span", { "aria-hidden": true, className: cn('absolute inset-0 m-auto size-1.5 rounded-full transition-opacity duration-150 ease-out', 'group-hover/trigger:opacity-0 group-focus-visible/trigger:opacity-0', STATUS_DOT[kind.tone]) }), _jsx(CaretRightIcon, { "aria-hidden": true, className: cn('text-muted-foreground absolute inset-0 size-3.5 opacity-0', 'transition-[opacity,rotate] duration-150 ease-out', 'group-hover/trigger:opacity-100 group-focus-visible/trigger:opacity-100', 'group-data-[state=open]/row:rotate-90') })] }), _jsxs("span", { className: "sr-only", children: [kind.label, ":"] }), _jsx("span", { className: "text-foreground min-w-0 shrink truncate text-sm", children: name }), dir && (_jsx("span", { className: "text-muted-foreground hidden min-w-0 shrink truncate text-xs sm:inline", children: dir })), from && (_jsxs("span", { className: "text-muted-foreground hidden shrink-0 truncate text-xs md:inline", children: [tI18nComplete.raw('text75857a458999'), " ", from.name] })), _jsx(DiffStat, { additions: entry.additions, deletions: entry.deletions, className: "ml-auto shrink-0 text-xs" })] }) }), _jsx(DisclosureContent, { className: "max-w-full overflow-hidden", children: _jsx("div", { className: "border-border/60 border-t", children: entry.patch ? (_jsx("div", { className: "max-w-full overflow-x-auto", children: _jsx(DiffView, { patch: entry.patch, layout: layout, hideFileHeader: true, className: cn('bg-background', diffViewportClass(layout)) }) })) : (_jsx("p", { className: "text-muted-foreground px-3 py-6 text-center text-xs", children: tI18nComplete.raw('text903237107ab6') })) }) })] }) }));
79
79
  }
80
80
  // ---------------------------------------------------------------------------
81
81
  // the list
@@ -21,7 +21,7 @@
21
21
  *
22
22
  * `shouldLoadOnScroll` is a pure predicate so the paging decision is testable
23
23
  * without a real `IntersectionObserver`, react-query, or a DOM. Same split as
24
- * `marketplace-grid.ts:shouldFetchNextMarketplacePage`.
24
+ * `session-older-autoload.ts:shouldLoadOlderHistory`.
25
25
  */
26
26
  /**
27
27
  * Whether the bottom sentinel coming into view should fetch the next page.
@@ -21,7 +21,7 @@
21
21
  *
22
22
  * `shouldLoadOnScroll` is a pure predicate so the paging decision is testable
23
23
  * without a real `IntersectionObserver`, react-query, or a DOM. Same split as
24
- * `marketplace-grid.ts:shouldFetchNextMarketplacePage`.
24
+ * `session-older-autoload.ts:shouldLoadOlderHistory`.
25
25
  */
26
26
  /**
27
27
  * Whether the bottom sentinel coming into view should fetch the next page.
@@ -135,6 +135,7 @@ function ConnectionRow({ title, detail, action }) {
135
135
  /** Save and remove for one provider's key. */
136
136
  export function useProviderKey(projectId, entry) {
137
137
  const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
138
+ const tKeys = useTranslations('pooledSecrets');
138
139
  const queryClient = useQueryClient();
139
140
  const [values, setValues] = useState({});
140
141
  const [error, setError] = useState(null);
@@ -143,18 +144,27 @@ export function useProviderKey(projectId, entry) {
143
144
  // LLM provider credentials are ALWAYS project-wide — a per-user key is
144
145
  // invisible to the gateway's shared-row resolution and every model turn
145
146
  // dies with "No upstream configured" (2026-07-07 prod incident).
146
- await Promise.all(target.envVars.map((envVar) => upsertProjectSecret(projectId, {
147
+ const saved = await Promise.all(target.envVars.map((envVar) => upsertProjectSecret(projectId, {
147
148
  name: envVar,
148
149
  value: (values[envVar] ?? '').trim(),
149
150
  strategy: 'broker',
150
151
  consumer: 'llm_gateway',
151
152
  })));
152
- return target;
153
+ // The save answers with the provider's check of the key (`verification`).
154
+ const refused = saved.find((secret) => secret.verification?.status === 'invalid')?.verification;
155
+ return { target, refused: refused ? tKeys('savedInvalid', { provider: target.label, message: refused.message }) : null };
153
156
  },
154
- onSuccess: (target) => {
155
- successToast(tI18nComplete('textbc8686cf8d63', { value0: target.label }));
156
- setValues({});
157
- setError(null);
157
+ onSuccess: ({ target, refused }) => {
158
+ // A refused key is saved, but every turn on it fails: the field stays open with the provider's words.
159
+ if (refused) {
160
+ errorToast(refused);
161
+ setError(refused);
162
+ }
163
+ else {
164
+ successToast(tI18nComplete('textbc8686cf8d63', { value0: target.label }));
165
+ setValues({});
166
+ setError(null);
167
+ }
158
168
  queryClient.invalidateQueries({ queryKey: qk.project.secrets(projectId) });
159
169
  refreshProjectProviderState(queryClient, projectId, { expectProviderId: target.id });
160
170
  },
@@ -192,7 +202,7 @@ export function useProviderKey(projectId, entry) {
192
202
  setValues({});
193
203
  setError(null);
194
204
  },
195
- save: () => entry && save.mutateAsync(entry).then(() => true, () => false),
205
+ save: () => entry && save.mutateAsync(entry).then(({ refused }) => !refused, () => false),
196
206
  saving: save.isPending,
197
207
  remove: () => entry && remove.mutateAsync(entry).then(() => true, () => false),
198
208
  removing: remove.isPending,
@@ -62,7 +62,7 @@ language = 'json', loading = false, error = null, className, }) {
62
62
  return (_jsxs("div", { className: cn(
63
63
  // bg-secondary is the code surface; the hairline keeps its edge legible
64
64
  // in light mode, where --secondary sits close to the panel behind it.
65
- 'bg-secondary overflow-hidden rounded-md border', className), children: [_jsxs("div", { className: "border-border/40 flex items-center justify-between gap-2 border-b px-2 py-1", children: [_jsx("span", { className: "text-muted-foreground/70 truncate font-mono text-xs", children: filename }), ready ? (
65
+ 'bg-secondary overflow-hidden rounded-md border', className), children: [_jsxs("div", { className: "border-border/40 flex items-center justify-between gap-2 border-b px-2 py-1", children: [_jsx("span", { className: "text-muted-foreground truncate font-mono text-xs", children: filename }), ready ? (
66
66
  // No `Hint` here on purpose. It renders `TooltipTrigger asChild`,
67
67
  // which clones its child to attach a ref and the hover/focus
68
68
  // handlers — and `CopyButton` neither forwards a ref nor spreads rest
@@ -13,13 +13,6 @@ type Props = {
13
13
  * content pane scrolls. Default is the single scrolling column.
14
14
  */
15
15
  fill?: boolean;
16
- /**
17
- * Exposes the scrollable ancestor div (the one carrying `overflow-y-auto`)
18
- * to callers that need to virtualize a list against it — e.g.
19
- * `MarketplaceBrowser`'s `@tanstack/react-virtual` grid — without coupling
20
- * to this component's internal class names.
21
- */
22
- scrollContainerRef?: React.Ref<HTMLDivElement>;
23
16
  /**
24
17
  * Floating open/collapse control at the top-left of this section. Opt-in —
25
18
  * the project shell no longer mounts a mobile sheet opener, so pages that
@@ -28,5 +21,5 @@ type Props = {
28
21
  */
29
22
  showSidebarToggleButton?: boolean;
30
23
  };
31
- declare const CustomizeSectionWrapper: ({ title, description, children, action, docs, className, fill, scrollContainerRef, showSidebarToggleButton, }: Props) => React.JSX.Element;
24
+ declare const CustomizeSectionWrapper: ({ title, description, children, action, docs, className, fill, showSidebarToggleButton, }: Props) => React.JSX.Element;
32
25
  export default CustomizeSectionWrapper;
@@ -32,7 +32,7 @@ function useShowSectionSidebarToggle(enabled) {
32
32
  return false;
33
33
  return sidebar.isMobile || sidebar.state !== 'expanded';
34
34
  }
35
- const CustomizeSectionWrapper = ({ title, description, children, action, docs, className, fill, scrollContainerRef, showSidebarToggleButton = false, }) => {
35
+ const CustomizeSectionWrapper = ({ title, description, children, action, docs, className, fill, showSidebarToggleButton = false, }) => {
36
36
  const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
37
37
  const showToggle = useShowSectionSidebarToggle(showSidebarToggleButton);
38
38
  // `docs` has no slot on `SettingsSectionHeader` (title/description/action/className
@@ -43,9 +43,9 @@ const CustomizeSectionWrapper = ({ title, description, children, action, docs, c
43
43
  if (fill) {
44
44
  return (_jsxs("div", { className: "relative flex h-full min-h-0 flex-col", children: [showSidebarToggleButton ? _jsx(SectionSidebarToggle, {}) : null, _jsx("header", { className: cn('border-border/60 shrink-0 border-b px-4 py-2',
45
45
  // Clear the absolute toggle so the title does not sit under it.
46
- showToggle && 'pl-12'), children: heading }), _jsx("div", { ref: scrollContainerRef, className: "min-h-0 flex-1 overflow-y-auto lg:overflow-hidden", children: children })] }));
46
+ showToggle && 'pl-12'), children: heading }), _jsx("div", { className: "min-h-0 flex-1 overflow-y-auto lg:overflow-hidden", children: children })] }));
47
47
  }
48
- return (_jsxs("div", { className: "relative flex h-full min-h-0 flex-col", children: [showSidebarToggleButton ? _jsx(SectionSidebarToggle, {}) : null, _jsx("div", { ref: scrollContainerRef, className: "min-h-0 flex-1 overflow-y-auto", children: _jsxs("div", { className: cn('mx-auto w-full max-w-2xl space-y-8',
48
+ return (_jsxs("div", { className: "relative flex h-full min-h-0 flex-col", children: [showSidebarToggleButton ? _jsx(SectionSidebarToggle, {}) : null, _jsx("div", { className: "min-h-0 flex-1 overflow-y-auto", children: _jsxs("div", { className: cn('mx-auto w-full max-w-2xl space-y-8',
49
49
  // showToggle && 'pl-12',
50
50
  className), children: [_jsx("header", { children: heading }), children] }) })] }));
51
51
  };
@@ -3,7 +3,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import Hint from '../../../primitives/hint.js';
4
4
  import { BrainIcon as Brain, EyeIcon as Eye, WrenchIcon as Wrench } from '@phosphor-icons/react';
5
5
  import { useTranslations } from '../../../i18n/index.js';
6
- const ICON_CLASS = 'text-muted-foreground/50 size-3.5 shrink-0';
6
+ const ICON_CLASS = 'text-muted-foreground size-3.5 shrink-0';
7
7
  /**
8
8
  * Compact capability chips — reasoning / tool-calling / vision — mirrored
9
9
  * verbatim from models.dev. Takes the three flags rather than a model object
@@ -49,7 +49,7 @@ export function GenerationControlsPanel({ model, catalogModel, value, onChange,
49
49
  delete updated[key];
50
50
  onChange(updated);
51
51
  };
52
- return (_jsxs("div", { className: "space-y-4", children: [caps.reasoningEffort ? (_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx(Label, { className: "text-muted-foreground text-xs font-normal", children: tI18nComplete.raw('text3236aeec43e5') }), _jsxs(Select, { value: config.reasoningEffort ?? '__default', onValueChange: (next) => set('reasoningEffort', next === '__default' ? undefined : next), disabled: disabled, children: [_jsx(SelectTrigger, { className: "w-36", size: "sm", "aria-label": tI18nComplete.raw('text3236aeec43e5'), children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "__default", children: tI18nComplete.raw('text09a77587d0c7') }), caps.reasoningEffort.values.map((effort) => (_jsx(SelectItem, { value: effort, className: "capitalize", children: effort }, effort)))] })] })] })) : null, caps.temperature ? (_jsxs("div", { className: "space-y-1.5", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsxs(Label, { className: "text-muted-foreground text-xs font-normal", children: [tI18nComplete.raw('textb958ce8b871a'), config.temperature !== undefined ? (_jsxs("span", { className: "tabular-nums", children: [" \u2014 ", config.temperature.toFixed(2)] })) : (_jsxs("span", { className: "text-muted-foreground/70", children: [' ', tI18nComplete.raw('text5a5735e88fae')] }))] }), config.temperature !== undefined ? (_jsx("button", { type: "button", className: "text-muted-foreground hover:text-foreground text-xs transition-colors", onClick: () => set('temperature', undefined), disabled: disabled, children: tI18nComplete.raw('textdaee7606b339') })) : null] }), _jsx(Slider, { value: [config.temperature ?? 1], min: 0, max: 2, step: 0.05, disabled: disabled, thumbLabel: tI18nComplete.raw('textb958ce8b871a'), formatValue: (next) => next.toFixed(2), onValueChange: ([next]) => set('temperature', next) })] })) : null, caps.topP ? (_jsxs("div", { className: "space-y-1.5", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsxs(Label, { className: "text-muted-foreground text-xs font-normal", children: [tI18nComplete.raw('text714db3dbb0b7'), config.topP !== undefined ? (_jsxs("span", { className: "tabular-nums", children: [" \u2014 ", config.topP.toFixed(2)] })) : (_jsxs("span", { className: "text-muted-foreground/70", children: [' ', tI18nComplete.raw('text5a5735e88fae')] }))] }), config.topP !== undefined ? (_jsx("button", { type: "button", className: "text-muted-foreground hover:text-foreground text-xs transition-colors", onClick: () => set('topP', undefined), disabled: disabled, children: tI18nComplete.raw('textdaee7606b339') })) : null] }), _jsx(Slider, { value: [config.topP ?? 1], min: 0, max: 1, step: 0.01, disabled: disabled, thumbLabel: tI18nComplete.raw('text714db3dbb0b7'), formatValue: (next) => next.toFixed(2), onValueChange: ([next]) => set('topP', next) })] })) : null, caps.maxOutputTokens ? (_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsxs(Label, { className: "text-muted-foreground text-xs font-normal", children: [tI18nComplete.raw('text397dda0799ba'), _jsxs("span", { className: "text-muted-foreground/70 tabular-nums", children: [' ', tI18nComplete.raw('text6f3f7befce1e'), ' ', caps.maxOutputTokens.ceiling.toLocaleString()] })] }), _jsx(Input, { type: "number", min: 1, max: caps.maxOutputTokens.ceiling, value: config.maxOutputTokens ?? '', placeholder: tI18nComplete.raw('text37a8eec1ce19'), variant: "popover", className: "h-8 w-28 text-xs", disabled: disabled, onChange: (e) => {
52
+ return (_jsxs("div", { className: "space-y-4", children: [caps.reasoningEffort ? (_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx(Label, { className: "text-muted-foreground text-xs font-normal", children: tI18nComplete.raw('text3236aeec43e5') }), _jsxs(Select, { value: config.reasoningEffort ?? '__default', onValueChange: (next) => set('reasoningEffort', next === '__default' ? undefined : next), disabled: disabled, children: [_jsx(SelectTrigger, { className: "w-36", size: "sm", "aria-label": tI18nComplete.raw('text3236aeec43e5'), children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "__default", children: tI18nComplete.raw('text09a77587d0c7') }), caps.reasoningEffort.values.map((effort) => (_jsx(SelectItem, { value: effort, className: "capitalize", children: effort }, effort)))] })] })] })) : null, caps.temperature ? (_jsxs("div", { className: "space-y-1.5", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsxs(Label, { className: "text-muted-foreground text-xs font-normal", children: [tI18nComplete.raw('textb958ce8b871a'), config.temperature !== undefined ? (_jsxs("span", { className: "tabular-nums", children: [" \u2014 ", config.temperature.toFixed(2)] })) : (_jsxs("span", { className: "text-muted-foreground", children: [' ', tI18nComplete.raw('text5a5735e88fae')] }))] }), config.temperature !== undefined ? (_jsx("button", { type: "button", className: "text-muted-foreground hover:text-foreground text-xs transition-colors", onClick: () => set('temperature', undefined), disabled: disabled, children: tI18nComplete.raw('textdaee7606b339') })) : null] }), _jsx(Slider, { value: [config.temperature ?? 1], min: 0, max: 2, step: 0.05, disabled: disabled, thumbLabel: tI18nComplete.raw('textb958ce8b871a'), formatValue: (next) => next.toFixed(2), onValueChange: ([next]) => set('temperature', next) })] })) : null, caps.topP ? (_jsxs("div", { className: "space-y-1.5", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsxs(Label, { className: "text-muted-foreground text-xs font-normal", children: [tI18nComplete.raw('text714db3dbb0b7'), config.topP !== undefined ? (_jsxs("span", { className: "tabular-nums", children: [" \u2014 ", config.topP.toFixed(2)] })) : (_jsxs("span", { className: "text-muted-foreground", children: [' ', tI18nComplete.raw('text5a5735e88fae')] }))] }), config.topP !== undefined ? (_jsx("button", { type: "button", className: "text-muted-foreground hover:text-foreground text-xs transition-colors", onClick: () => set('topP', undefined), disabled: disabled, children: tI18nComplete.raw('textdaee7606b339') })) : null] }), _jsx(Slider, { value: [config.topP ?? 1], min: 0, max: 1, step: 0.01, disabled: disabled, thumbLabel: tI18nComplete.raw('text714db3dbb0b7'), formatValue: (next) => next.toFixed(2), onValueChange: ([next]) => set('topP', next) })] })) : null, caps.maxOutputTokens ? (_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsxs(Label, { className: "text-muted-foreground text-xs font-normal", children: [tI18nComplete.raw('text397dda0799ba'), _jsxs("span", { className: "text-muted-foreground tabular-nums", children: [' ', tI18nComplete.raw('text6f3f7befce1e'), ' ', caps.maxOutputTokens.ceiling.toLocaleString()] })] }), _jsx(Input, { type: "number", min: 1, max: caps.maxOutputTokens.ceiling, value: config.maxOutputTokens ?? '', placeholder: tI18nComplete.raw('text37a8eec1ce19'), variant: "popover", className: "h-8 w-28 text-xs", disabled: disabled, onChange: (e) => {
53
53
  const ceiling = caps.maxOutputTokens?.ceiling;
54
54
  const raw = e.target.value;
55
55
  if (!raw || ceiling === undefined)
@@ -257,7 +257,7 @@ function RepositoryGroup({ project, connection, canManage, }) {
257
257
  queryClient.setQueryData(qk.project.summary(project.project_id), updated);
258
258
  queryClient.setQueryData(qk.project.detail(project.project_id), (current) => (current ? { ...current, project: updated } : current));
259
259
  // qk.projects.scope(): reaches every account's list (and the
260
- // accountless slot the marketplace picker reads), restoring the reach
260
+ // accountless slot), restoring the reach
261
261
  // the old bare projects-literal prefix match had. Repo-settings edits
262
262
  // are rare — over-invalidating costs nothing.
263
263
  queryClient.invalidateQueries({ queryKey: qk.projects.scope() });
@@ -148,11 +148,6 @@ export const GRADUATED = {
148
148
  'llm-budgets': (p) => capabilityTabHref(p, 'models'),
149
149
  'llm-keys': (p) => capabilityTabHref(p, 'models'),
150
150
  'llm-api': (p) => capabilityTabHref(p, 'models'),
151
- // Marketplace was removed from the product outright, not relocated. The
152
- // closest honest destination for a stale bookmark is the Customize index —
153
- // it lists every surface that replaced it, rather than a 404 or a pane that
154
- // no longer exists.
155
- marketplace: (p) => `/workspaces/${p}/customize`,
156
151
  };
157
152
  /**
158
153
  * Sections that graduated out of the settings overlay onto the ACCOUNT
@@ -357,8 +357,8 @@ export function GeneralTab({ projectId, slot, part = 'all', }) {
357
357
  successToast(tWorkspaces('deletedToast'));
358
358
  // qk.projects.scope(): for a single-account user the archived
359
359
  // project's account IS the primary account qk.projects.list() (no
360
- // args) resolves to, so a precise invalidation would leave the
361
- // marketplace picker showing the archived project until gcTime
360
+ // args) resolves to, so a precise invalidation would leave a project
361
+ // picker showing the archived project until gcTime
362
362
  // evicts it. Archiving is rare — over-invalidating costs nothing.
363
363
  queryClient.invalidateQueries({ queryKey: qk.projects.scope() });
364
364
  setArchiveOpen(false);
@@ -1,8 +1,8 @@
1
1
  import { type ReactNode } from 'react';
2
2
  interface CapabilityPageShellProps {
3
3
  title: string;
4
- /** One line. Longer explanations go in `titleAddon` (an info hover card). */
5
- description: string;
4
+ /** One line, or none. Longer explanations go in `titleAddon` (an info hover card). */
5
+ description?: string;
6
6
  /** Rendered inline after the title, e.g. an info button. */
7
7
  titleAddon?: ReactNode;
8
8
  /** Page-level action(s) — a single button, or a cluster of them. Rendered
@@ -39,16 +39,18 @@ export function CapabilityPageShell({ title, description, titleAddon, action, se
39
39
  return (_jsx("div", { ref: scrollRef, className: "min-h-0 flex-1 overflow-y-auto", "data-capability-embed": "", children: _jsxs("div", { className: cn('w-full space-y-5 px-4 pt-5 pb-24 md:px-8', embed.className), children: [embed.lead, _jsxs("header", { className: "flex flex-col gap-3 md:flex-row md:items-end md:justify-between", children: [_jsx(SettingsSectionHeader, { title: title, className: "min-w-0" }), filters ? _jsx("div", { className: "shrink-0", children: filters }) : null] }), search || action ? (_jsxs("div", { className: "flex items-center gap-2", children: [search ? _jsx("div", { className: "min-w-0 flex-1", children: search }) : null, action] })) : null, _jsx(CapabilityScrollRootProvider, { scrollRef: scrollRef, children: children })] }) }));
40
40
  }
41
41
  if (embed) {
42
- return (_jsx("div", { ref: scrollRef, className: "min-h-0 flex-1 overflow-y-auto", "data-capability-embed": "", children: _jsxs("div", { className: cn('w-full space-y-5 px-4 pt-5 pb-24 md:px-8', embed.className), children: [embed.lead, _jsxs("header", { className: cn('flex flex-col gap-3', !stacked && 'md:flex-row md:items-center md:justify-between'), children: [_jsx("h2", { className: "sr-only", children: title }), _jsx("p", { className: "text-muted-foreground min-w-0 text-sm text-pretty md:max-w-xl", children: description }), search || action ? (_jsxs("div", { className: cn('flex w-full shrink-0 items-center gap-2', !stacked && 'md:w-auto'), children: [search ? _jsx("div", { className: cn('min-w-0 flex-1', !stacked && 'md:w-64 md:flex-none'), children: search }) : null, action] })) : null] }), filters ? _jsx("div", { className: "flex flex-wrap items-center justify-between gap-2", children: filters }) : null, _jsx(CapabilityScrollRootProvider, { scrollRef: scrollRef, children: children })] }) }));
42
+ return (_jsx("div", { ref: scrollRef, className: "min-h-0 flex-1 overflow-y-auto", "data-capability-embed": "", children: _jsxs("div", { className: cn('w-full space-y-5 px-4 pt-5 pb-24 md:px-8', embed.className), children: [embed.lead, _jsxs("header", { className: cn('flex flex-col gap-3', !stacked && 'md:flex-row md:items-center md:justify-between'), children: [_jsx("h2", { className: "sr-only", children: title }), description ? _jsx("p", { className: "text-muted-foreground min-w-0 text-sm text-pretty md:max-w-xl", children: description }) : null, search || action ? (_jsxs("div", { className: cn('flex w-full shrink-0 items-center gap-2', !stacked && 'md:w-auto'), children: [search ? _jsx("div", { className: cn('min-w-0 flex-1', !stacked && 'md:w-64 md:flex-none'), children: search }) : null, action] })) : null] }), filters ? _jsx("div", { className: "flex flex-wrap items-center justify-between gap-2", children: filters }) : null, _jsx(CapabilityScrollRootProvider, { scrollRef: scrollRef, children: children })] }) }));
43
43
  }
44
44
  if (settingsTitle !== null) {
45
- // A Workspace settings section: the settings page header and column, so
46
- // the title has the rung, the left edge and the name of every other
47
- // section. The frame's title bar holds the sidebar opener.
45
+ // A Workspace settings section: the settings page header and the centered
46
+ // column, so the title has the rung and the name of every other section.
47
+ // The frame's title bar holds the sidebar opener.
48
48
  const controls = search || action ? (_jsxs("div", { className: cn('flex w-full items-center gap-2', !stacked && 'sm:w-auto'), children: [search ? _jsx("div", { className: cn('min-w-0 flex-1', !stacked && 'sm:w-64 sm:flex-none'), children: search }) : null, action] })) : null;
49
49
  return (_jsx("div", { ref: scrollRef, className: "min-h-0 flex-1 overflow-y-auto", children: _jsx("div", { className: SETTINGS_PAGE_COLUMN_CLASS, children: _jsxs("div", { className: cn('w-full space-y-5', wide ? 'max-w-7xl' : 'max-w-5xl'), children: [_jsx(SettingsPageHeader, { title: title, titleAccessory: titleAddon, description: description, action: stacked ? undefined : controls }), stacked ? controls : null, filters ? _jsx("div", { className: "flex flex-wrap items-center justify-between gap-2", children: filters }) : null, _jsx(CapabilityScrollRootProvider, { scrollRef: scrollRef, children: children })] }) }) }));
50
50
  }
51
51
  return (_jsx("div", { ref: scrollRef, className: "min-h-0 flex-1 overflow-y-auto", children: _jsxs("div", { className: wide
52
52
  ? 'mx-auto w-full max-w-7xl space-y-5 px-4 py-10 pb-20 md:px-8 lg:py-14'
53
- : 'mx-auto w-full max-w-5xl space-y-5 px-4 py-10 pb-20 lg:py-14', children: [_jsxs("header", { className: cn('flex flex-col gap-3', !stacked && 'sm:flex-row sm:items-start sm:justify-between'), children: [_jsxs("div", { className: "space-y-1 sm:max-w-md", children: [_jsxs("div", { className: "flex items-center gap-1", children: [framed ? null : _jsx(SidebarToggle, { className: "-ml-2" }), _jsx("h1", { className: "text-foreground text-xl font-medium text-balance", children: title }), titleAddon] }), _jsx("p", { className: "text-muted-foreground text-sm text-balance", children: description })] }), search || action ? (_jsxs("div", { className: cn('flex w-full shrink-0 items-center gap-2', !stacked && 'sm:w-auto'), children: [search ? (_jsx("div", { className: cn('min-w-0 flex-1', !stacked && 'sm:w-64 sm:flex-none'), children: search })) : null, action] })) : null] }), filters ? (_jsx("div", { className: "flex flex-wrap items-center justify-between gap-2", children: filters })) : null, _jsx(CapabilityScrollRootProvider, { scrollRef: scrollRef, children: children })] }) }));
53
+ : 'mx-auto w-full max-w-5xl space-y-5 px-4 py-10 pb-20 lg:py-14', children: [_jsxs("header", { className: cn('flex flex-col gap-3', !stacked && 'sm:flex-row sm:items-start sm:justify-between'), children: [_jsxs("div", { className: "space-y-1 sm:max-w-md", children: [_jsxs("div", { className: "flex items-center gap-1", children: [framed ? null : _jsx(SidebarToggle, { className: "-ml-2" }), _jsx("h1", { className: "text-foreground text-xl font-medium text-balance", children: title }), titleAddon] }), description ? _jsx("p", { className: "text-muted-foreground text-sm text-balance", children: description }) : null] }), search || action ? (_jsxs("div", { className: cn('flex w-full shrink-0 items-center gap-2', !stacked && 'sm:w-auto'), children: [search ? (
54
+ // Content ends on the right: a collapsed search icon sits beside the action.
55
+ _jsx("div", { className: cn('flex min-w-0 flex-1 justify-end', !stacked && 'sm:w-64 sm:flex-none'), children: search })) : null, action] })) : null] }), filters ? (_jsx("div", { className: "flex flex-wrap items-center justify-between gap-2", children: filters })) : null, _jsx(CapabilityScrollRootProvider, { scrollRef: scrollRef, children: children })] }) }));
54
56
  }
@@ -16,8 +16,7 @@ import { createContext, useContext, useRef } from 'react';
16
16
  * shell. Putting the element in `useState` means every one of them re-renders
17
17
  * once on mount to publish a value that only one descendant reads. A ref is
18
18
  * stable across renders, so the provider re-renders nothing; consumers resolve
19
- * `.current` in a layout effect after the ref has attached — the same handoff
20
- * `AncestorVirtualGrid` uses in `marketplace-paged-grid.tsx:326-331`.
19
+ * `.current` in a layout effect after the ref has attached.
21
20
  *
22
21
  * The context defaults to a ref holding `null`, which is exactly what an
23
22
  * observer wants when there is no shell: `root: null` means the viewport, so a
@@ -21,7 +21,7 @@ export function CatalogCard({ leading, title, description, badges, meta, subtitl
21
21
  const descriptionId = `${id}-description`;
22
22
  const summary = description ? plainTextFromMarkdown(description) : '';
23
23
  const a11y = { 'aria-labelledby': titleId, 'aria-describedby': summary ? descriptionId : undefined };
24
- const content = (_jsxs(_Fragment, { children: [leading ? _jsx("span", { className: "shrink-0", children: leading }) : null, _jsxs("span", { className: cn('min-w-0 flex-1', variant === 'plain' ? 'space-y-0' : 'space-y-1'), children: [_jsxs("span", { className: "flex items-center gap-1.5", children: [_jsx("span", { id: titleId, className: "text-foreground truncate text-sm font-medium", children: title }), badges] }), subtitle ? _jsx("span", { className: "flex flex-wrap items-center gap-1.5", children: subtitle }) : null, summary ? (_jsxs(_Fragment, { children: [_jsx("span", { className: "text-muted-foreground line-clamp-2 text-xs text-pretty", children: summary }), _jsx("span", { id: descriptionId, className: "sr-only", "aria-hidden": true, children: shortSummary(description ?? '') })] })) : null, meta ? (_jsx("span", { className: "text-muted-foreground/80 flex flex-wrap items-center gap-x-2 gap-y-0.5 pt-1 text-xs", children: meta })) : null] })] }));
24
+ const content = (_jsxs(_Fragment, { children: [leading ? _jsx("span", { className: "shrink-0", children: leading }) : null, _jsxs("span", { className: cn('min-w-0 flex-1', variant === 'plain' ? 'space-y-0' : 'space-y-1'), children: [_jsxs("span", { className: "flex items-center gap-1.5", children: [_jsx("span", { id: titleId, className: "text-foreground truncate text-sm font-medium", children: title }), badges] }), subtitle ? _jsx("span", { className: "flex flex-wrap items-center gap-1.5", children: subtitle }) : null, summary ? (_jsxs(_Fragment, { children: [_jsx("span", { className: "text-muted-foreground line-clamp-2 text-xs text-pretty", children: summary }), _jsx("span", { id: descriptionId, className: "sr-only", "aria-hidden": true, children: shortSummary(description ?? '') })] })) : null, meta ? (_jsx("span", { className: "text-muted-foreground flex flex-wrap items-center gap-x-2 gap-y-0.5 pt-1 text-xs", children: meta })) : null] })] }));
25
25
  const body = (_jsxs(_Fragment, { children: [content, trailingSlot] }));
26
26
  if (select) {
27
27
  return (_jsxs("div", { style: style, "data-selected": select.checked || undefined, className: cn(classes, select.checked && 'border-border bg-accent'), children: [_jsx(Checkbox, { "aria-label": select.label, checked: select.checked, disabled: disabled || select.disabled, onCheckedChange: () => select.onCheckedChange(), className: "mt-0.5" }), _jsx("button", { type: "button", onClick: onClick, disabled: disabled, ...a11y, className: "flex min-w-0 flex-1 items-start gap-3 text-left focus-visible:outline-none", children: content }), trailingSlot] }));
@@ -51,7 +51,7 @@ function CrIcon({ status }) {
51
51
  return _jsx(CheckCircleIcon, { weight: "fill", className: "text-kortix-purple size-4" });
52
52
  }
53
53
  if (status === 'closed')
54
- return _jsx(XCircleIcon, { className: "text-muted-foreground/60 size-4" });
54
+ return _jsx(XCircleIcon, { className: "text-muted-foreground size-4" });
55
55
  return _jsx(GitDiffIcon, { className: "text-kortix-green size-4" });
56
56
  }
57
57
  /**
@@ -86,7 +86,7 @@ export function ChangeRequestsPanel({ open = false, onClose }) {
86
86
  // happens on its own.
87
87
  actions: _jsx(Hint, { label: tI18nComplete.raw('texte16e6a752599'), side: "bottom", children: _jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": tI18nComplete.raw('texte16e6a752599'), onClick: () => setOpenDialogShown(true), className: "text-muted-foreground hover:text-foreground active:scale-[0.96]", children: _jsx(PlusIcon, { className: "size-4" }) }) }), filters: _jsx(Tabs, { value: status, onValueChange: (v) => setStatus(v), className: "gap-0", children: _jsxs(TabsList, { size: "xs", className: "w-fit", children: [_jsx(TabsTrigger, { value: "open", children: tI18nComplete.raw('texted077f3d8125') }), _jsx(TabsTrigger, { value: "merged", children: tI18nComplete.raw('text0c79a9c22284') }), _jsx(TabsTrigger, { value: "closed", children: tI18nComplete.raw('text9d74727714db') }), _jsx(TabsTrigger, { value: "all", children: tI18nComplete.raw('texta52ace420f21') })] }) }), children: [isLoading && _jsx(ReviewRowSkeleton, { count: 5 }), error && !isLoading && (_jsx(ReviewError, { title: tI18nComplete.raw('text769fe61dab43'), error: error })), !isLoading && !error && total === 0 && (_jsx(ReviewEmpty, { size: "sm", className: "py-10", icon: GitDiffIcon, title: status === 'open'
88
88
  ? tI18nComplete.raw('text4b51686b2606')
89
- : tI18nComplete.raw('text49abaf804ab3'), description: status === 'open' ? tI18nComplete.raw('textfbd90a3ab227') : undefined, action: status === 'open' ? (_jsxs(Button, { size: "sm", variant: "outline", className: "gap-1.5", onClick: () => setOpenDialogShown(true), children: [_jsx(PlusIcon, { className: "size-3.5 shrink-0" }), tI18nComplete.raw('texte16e6a752599')] })) : undefined })), !isLoading && !error && total > 0 && (_jsxs("div", { className: "pb-3", children: [groups.map((group, gi) => (_jsxs("div", { children: [_jsx(ReviewGroupLabel, { first: gi === 0, children: group.label }), group.items.map((cr) => (_jsxs(ReviewRow, { isActive: selectedCrId === cr.cr_id, onSelect: () => setSelectedCrId(cr.cr_id), onPrefetch: () => prefetch(cr.cr_id), children: [_jsx("span", { className: "mt-0.5 shrink-0", children: _jsx(CrIcon, { status: cr.status }) }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsxs("span", { className: "flex items-baseline gap-1.5", children: [_jsxs("span", { className: "text-muted-foreground/70 shrink-0 text-xs tabular-nums", children: ["#", cr.number] }), _jsx("span", { className: cn('text-foreground min-w-0 flex-1 truncate text-sm font-medium', cr.status === 'closed' && 'text-muted-foreground'), children: cr.title })] }), _jsxs("span", { className: "text-muted-foreground mt-0.5 flex items-center gap-1.5 text-xs", title: fullTimestampFormat.format(tsFromCr(cr)), children: [_jsx("span", { className: "truncate", children: crTimeLabel(cr) }), _jsx("span", { className: "text-muted-foreground/30", "aria-hidden": true, children: "\u00B7" }), _jsxs("span", { className: "truncate", children: [tI18nComplete.raw('text6b847a0ed0b2'), " ", cr.base_ref] })] })] })] }, cr.cr_id)))] }, group.label))), hasNextPage && (_jsx("div", { className: "flex justify-center pt-2", children: _jsx(Button, { variant: "outline", size: "sm", disabled: isFetchingNextPage, onClick: () => void fetchNextPage(), children: isFetchingNextPage
89
+ : tI18nComplete.raw('text49abaf804ab3'), description: status === 'open' ? tI18nComplete.raw('textfbd90a3ab227') : undefined, action: status === 'open' ? (_jsxs(Button, { size: "sm", variant: "outline", className: "gap-1.5", onClick: () => setOpenDialogShown(true), children: [_jsx(PlusIcon, { className: "size-3.5 shrink-0" }), tI18nComplete.raw('texte16e6a752599')] })) : undefined })), !isLoading && !error && total > 0 && (_jsxs("div", { className: "pb-3", children: [groups.map((group, gi) => (_jsxs("div", { children: [_jsx(ReviewGroupLabel, { first: gi === 0, children: group.label }), group.items.map((cr) => (_jsxs(ReviewRow, { isActive: selectedCrId === cr.cr_id, onSelect: () => setSelectedCrId(cr.cr_id), onPrefetch: () => prefetch(cr.cr_id), children: [_jsx("span", { className: "mt-0.5 shrink-0", children: _jsx(CrIcon, { status: cr.status }) }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsxs("span", { className: "flex items-baseline gap-1.5", children: [_jsxs("span", { className: "text-muted-foreground shrink-0 text-xs tabular-nums", children: ["#", cr.number] }), _jsx("span", { className: cn('text-foreground min-w-0 flex-1 truncate text-sm font-medium', cr.status === 'closed' && 'text-muted-foreground'), children: cr.title })] }), _jsxs("span", { className: "text-muted-foreground mt-0.5 flex items-center gap-1.5 text-xs", title: fullTimestampFormat.format(tsFromCr(cr)), children: [_jsx("span", { className: "truncate", children: crTimeLabel(cr) }), _jsx("span", { className: "text-muted-foreground", "aria-hidden": true, children: "\u00B7" }), _jsxs("span", { className: "truncate", children: [tI18nComplete.raw('text6b847a0ed0b2'), " ", cr.base_ref] })] })] })] }, cr.cr_id)))] }, group.label))), hasNextPage && (_jsx("div", { className: "flex justify-center pt-2", children: _jsx(Button, { variant: "outline", size: "sm", disabled: isFetchingNextPage, onClick: () => void fetchNextPage(), children: isFetchingNextPage
90
90
  ? tSidebar('loadingMore')
91
91
  : isFetchNextPageError
92
92
  ? tSidebar('retry')