@kortix/ui 0.16.1 → 0.16.2

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,72 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { listGroups } from '@kortix/sdk';
4
+ import { TrashIcon } from '@phosphor-icons/react';
5
+ import { useQuery } from '@tanstack/react-query';
6
+ import { useMemo } from 'react';
7
+ import { SHARE_GROUP, ShareAddField, ShareRole, ShareRoleMenu, ShareRow, ShareSection, } from '../../../access/share-dialog.js';
8
+ import { useTranslations } from '../../../i18n/index.js';
9
+ import { errorToast } from '../../../primitives/toast.js';
10
+ import { useUiHostConfig } from '../../../providers/ui-provider.js';
11
+ import { useWorkspacePeople } from '../../session-spaces/space-people.js';
12
+ /**
13
+ * "Specific people" in the session access dialog: add people and groups
14
+ * (several at once) and the people with access, owner first. It edits the
15
+ * dialog's selection only; the dialog's Save writes it.
16
+ */
17
+ export function SessionPeoplePicker({ projectId, session, value, onChange, }) {
18
+ const t = useTranslations('sessionShare');
19
+ const { accountApiEnabled } = useUiHostConfig();
20
+ const people = useWorkspacePeople(projectId, true);
21
+ const accountId = session?.account_id ?? null;
22
+ const groupsQuery = useQuery({
23
+ queryKey: ['account-groups', accountId],
24
+ queryFn: () => listGroups(accountId),
25
+ enabled: !!accountId && accountApiEnabled,
26
+ staleTime: 60_000,
27
+ });
28
+ const groupSublabel = (count) => (count === undefined ? null : t('groupMembers', { count }));
29
+ const candidates = useMemo(() => [
30
+ ...[...people].map(([id, person]) => ({
31
+ id,
32
+ kind: 'member',
33
+ label: person.name || person.email || id,
34
+ sublabel: person.name && person.email ? person.email : null,
35
+ email: person.email || null,
36
+ avatarUrl: person.avatarUrl,
37
+ })),
38
+ ...(groupsQuery.data ?? []).map((group) => ({
39
+ id: group.group_id,
40
+ kind: 'group',
41
+ label: group.name,
42
+ sublabel: group.member_count === undefined ? null : t('groupMembers', { count: group.member_count }),
43
+ })),
44
+ ], [people, groupsQuery.data, t]);
45
+ const byId = useMemo(() => new Map(candidates.map((candidate) => [candidate.id, candidate])), [candidates]);
46
+ const ownerId = session?.created_by ?? null;
47
+ const excludeIds = useMemo(() => new Set([ownerId, ...value.memberIds, ...value.groupIds].filter((id) => !!id)), [ownerId, value.memberIds, value.groupIds]);
48
+ const owner = {
49
+ id: ownerId ?? 'owner',
50
+ kind: 'member',
51
+ label: session?.owner_name || session?.owner_email || t('owner'),
52
+ sublabel: session?.owner_name ? session.owner_email : null,
53
+ email: session?.owner_email ?? null,
54
+ avatarUrl: session?.owner_avatar_url ?? null,
55
+ };
56
+ const added = [
57
+ ...value.memberIds.map((id) => byId.get(id) ?? { id, kind: 'member', label: t('member') }),
58
+ ...value.groupIds.map((id) => byId.get(id) ?? { id, kind: 'group', label: t('group'), sublabel: groupSublabel(undefined) }),
59
+ ];
60
+ return (_jsxs("div", { className: "space-y-5", children: [_jsx(ShareAddField, { candidates: candidates, excludeIds: excludeIds, onShare: (picked) => {
61
+ onChange({
62
+ ...value,
63
+ memberIds: [...value.memberIds, ...picked.filter((c) => c.kind === 'member').map((c) => c.id)],
64
+ groupIds: [...value.groupIds, ...picked.filter((c) => c.kind === 'group').map((c) => c.id)],
65
+ });
66
+ return Promise.resolve(true);
67
+ }, pending: false, disabled: false, placeholder: t('addPlaceholder'), shareLabel: t('share'), removeLabel: t('remove'), onUnknownEmails: () => errorToast(t('notMember')) }), _jsx(ShareSection, { label: t('peopleWithAccess'), children: _jsxs("ul", { className: SHARE_GROUP, children: [_jsx(ShareRow, { candidate: owner, trailing: _jsx(ShareRole, { children: t('owner') }) }), added.map((candidate) => (_jsx(ShareRow, { candidate: candidate, trailing: _jsx(ShareRoleMenu, { label: candidate.kind === 'group' ? t('group') : t('member'), removeLabel: t('remove'), removeIcon: _jsx(TrashIcon, {}), onRemove: () => onChange({
68
+ ...value,
69
+ memberIds: value.memberIds.filter((id) => id !== candidate.id),
70
+ groupIds: value.groupIds.filter((id) => id !== candidate.id),
71
+ }) }) }, candidate.id)))] }) })] }));
72
+ }
@@ -15,6 +15,7 @@ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
15
15
  import { useEffect, useState } from 'react';
16
16
  import { sessionAccessSummary, sessionAccessView } from './share-session-access.js';
17
17
  import { refreshAfterShare } from './share-session-cache.js';
18
+ import { SessionPeoplePicker } from './session-people-picker.js';
18
19
  /**
19
20
  * The three options, worded from the EDITOR's seat.
20
21
  *
@@ -100,7 +101,7 @@ export function ShareSessionModal({ projectId, session, open, onOpenChange, onSa
100
101
  ? tI18nHardcoded('autoFeaturesWorkspaceProjectSidebarModalShareSessionModalDelegateDescription', { owner: view.ownerLabel })
101
102
  : tI18nHardcoded('autoFeaturesWorkspaceProjectSidebarModalShareSessionModalViewerDescription', { owner: view.ownerLabel }) })] }), _jsxs(ModalBody, { className: "max-h-[60vh] space-y-5 overflow-y-auto", children: [view.canEdit ? (_jsx(SharingPicker, { projectId: projectId, value: sharing, onChange: setSharing, copy: view.role === 'owner'
102
103
  ? SESSION_SHARING_COPY
103
- : delegateCopy(view.ownerLabel, tI18nComplete), disabledModes: view.disabledModes })) : (
104
+ : delegateCopy(view.ownerLabel, tI18nComplete), disabledModes: view.disabledModes, renderMembers: (selection, change) => (_jsx(SessionPeoplePicker, { projectId: projectId, session: session, value: selection, onChange: change })) })) : (
104
105
  // Read-only, not hidden: a person a session was shared with should
105
106
  // still be able to see who else is in it. Withholding that is what
106
107
  // sent people to the editable dialog in the first place.
@@ -1,5 +1,3 @@
1
- /** `inbox={false}`: the host shows the Inbox row elsewhere (Spaces on: beside Review, `project-spaces-nav`). */
2
- export declare function ProjectNavItems({ projectId, inbox }: {
1
+ export declare function ProjectNavItems({ projectId }: {
3
2
  projectId: string;
4
- inbox?: boolean;
5
3
  }): import("react").JSX.Element;
@@ -3,7 +3,6 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
3
3
  import { ProjectAppsNavItem } from './footer/project-apps-nav.js';
4
4
  import { ProjectCalendarNavItem } from './footer/project-calendar-nav.js';
5
5
  import { ProjectGoalsNavItem } from './footer/project-goals-nav.js';
6
- import { ProjectInboxNavItem } from './footer/project-inbox-nav.js';
7
6
  import { ProjectArtifactsNavItem } from './footer/project-artifacts-nav.js';
8
7
  import { ProjectFilesNavItem } from './footer/project-files-nav.js';
9
8
  import { CustomizeGlyph, useCapabilityAccess, } from '../../internal/layout/project-settings-nav.js';
@@ -24,11 +23,9 @@ import { adminPath } from '../../lib/routes.js';
24
23
  * offer it. Spaces are the channel sidebar under the `chat` flag
25
24
  * (project-spaces-nav.tsx).
26
25
  */
27
- // `inbox` is first: it is the one row that says something waits on you.
28
- const NAV_ROWS = ['inbox', 'customize', 'files', 'apps', 'calendar', 'goals', 'artifacts'];
29
- /** `inbox={false}`: the host shows the Inbox row elsewhere (Spaces on: beside Review, `project-spaces-nav`). */
30
- export function ProjectNavItems({ projectId, inbox = true }) {
31
- return (_jsx(_Fragment, { children: NAV_ROWS.filter((id) => inbox || id !== 'inbox').map((id) => (_jsx(NavItem, { id: id, projectId: projectId }, id))) }));
26
+ const NAV_ROWS = ['customize', 'files', 'apps', 'calendar', 'goals', 'artifacts'];
27
+ export function ProjectNavItems({ projectId }) {
28
+ return (_jsx(_Fragment, { children: NAV_ROWS.map((id) => (_jsx(NavItem, { id: id, projectId: projectId }, id))) }));
32
29
  }
33
30
  /**
34
31
  * Customize, for the people who may configure the project: one link into
@@ -61,8 +58,6 @@ function CustomizeNavEntry({ projectId }) {
61
58
  }
62
59
  function NavItem({ id, projectId }) {
63
60
  switch (id) {
64
- case 'inbox':
65
- return _jsx(ProjectInboxNavItem, {});
66
61
  case 'customize':
67
62
  return _jsx(CustomizeNavEntry, { projectId: projectId });
68
63
  case 'apps':
@@ -30,7 +30,7 @@ import { BACKGROUND_WORK_POLL_MS, getSessionDisplayTitle, groupChangeRequestsByS
30
30
  import { SessionBriefDescription, SessionBriefCardHost, SessionBriefHoverCard, SubagentHoverCard, } from './session-brief-hover-card.js';
31
31
  import { SessionFilterMenu } from './session-filter-menu.js';
32
32
  import { SESSION_MENU_TRIGGER_CLASS, SESSION_ROW_HEIGHT_CLASS, SIDEBAR_PAGE_SIZE, ShowMoreButton, } from '../../session/list/session-list-chrome.js';
33
- import { SessionGroupNameModal, SessionGroupSections, NewSessionGroupRow, keepFocusForNewGroup, markNewGroupFocus, nextSessionGroupName, sessionGroupSectionId, UngroupDropArea, startSessionDrag, useSessionGroupActions, } from './session-group-sections.js';
33
+ import { SessionGroupSections, SpacesHeading, NewSessionGroupRow, keepFocusForNewGroup, markNewGroupFocus, nextSessionGroupName, sessionGroupSectionId, UngroupDropArea, startSessionDrag, useSessionGroupActions, } from './session-group-sections.js';
34
34
  import { groupSessions, } from './session-grouping.js';
35
35
  import { useSessionOpenIntent } from './session-open-intent.js';
36
36
  import { GoalStatusMark, isReviewOverdue, SessionStatusMark } from '../../session/list/session-status-mark.js';
@@ -42,8 +42,9 @@ import { selectExpandedIds, useSessionExpandedStore } from '../../internal/store
42
42
  import { selectCollapsedSections, selectGroupMode, selectHiddenSections, selectLabelFilters, selectOrderMode, selectSourceFilters, selectStatusFilters, useSessionFilterStore, } from '../../internal/stores/session-filter-store.js';
43
43
  import { shouldBeginSessionSwitch, useSessionSwitchStore } from '../../internal/stores/session-switch-store.js';
44
44
  import { directSubsessions, createProjectSession, listChangeRequests, restartProjectSession, sessionParentId, stopProjectSession, } from '@kortix/sdk';
45
+ import { SpaceFormModal } from '../session-spaces/space-form-modal.js';
45
46
  import { qk, useProjectSession, useProjectSessions, useRuntimeSupports, useSessionChildren, useFeatureFlag, useProjectSessionGroups, useSessionGoal, } from '@kortix/sdk/react';
46
- import { ArchiveIcon, ArrowsSplitIcon, CheckIcon, DotsThreeIcon, FolderSimpleIcon, FolderSimpleMinusIcon, PlusIcon, PushPinIcon, PushPinSlashIcon, RobotIcon, GitForkIcon, PencilSimpleIcon, ArrowCounterClockwiseIcon as RotateCcw, ShareIcon as Share, SquareIcon as Square, TagIcon, TrashIcon, } from '@phosphor-icons/react';
47
+ import { ArchiveIcon, ArrowsSplitIcon, CheckIcon, DotsThreeIcon, FunnelSimpleIcon, FolderSimpleIcon, FolderSimpleMinusIcon, PlusIcon, PushPinIcon, PushPinSlashIcon, RobotIcon, GitForkIcon, PencilSimpleIcon, ArrowCounterClockwiseIcon as RotateCcw, ShareIcon as Share, SquareIcon as Square, TagIcon, TrashIcon, } from '@phosphor-icons/react';
47
48
  import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
48
49
  import { formatDistanceToNowStrict } from 'date-fns';
49
50
  import { UiLink, useUiPathname, useUiRouter, useUiSearchParams, useUiViewerId } from '../../providers/ui-provider.js';
@@ -409,12 +410,14 @@ export function ProjectSessionList({ projectId, secondary = false }) {
409
410
  }
410
411
  return (_jsxs("div", { className: cn('flex min-h-0 flex-col space-y-px',
411
412
  // Below the spaces: the header alone while closed, an equal share of the column while open.
412
- secondary ? (listOpen ? 'flex-1' : 'shrink-0') : 'h-full'), children: [listsReady && (pinnedQuery.sessions.length > 0 || pinnedQuery.hasNextPage || groups.length > 0 || groupCreate) && (_jsxs("div", { className: "max-h-[50%] min-h-0 shrink-0 space-y-px overflow-y-auto", children: [_jsx(StarterSection, { title: tPinArchive('section'), query: pinnedQuery, sessions: visiblePinned, open: !collapsedSectionIds.has(PINNED_SECTION_ID), onToggle: () => toggleSectionCollapsed(projectId, PINNED_SECTION_ID), renderNode: (session) => renderSessionNode(session, false), caretOnHover: true }), groups.length > 0 && (_jsx(SessionGroupSections, { projectId: projectId, groups: groups, labels: labels, collapsedSectionIds: collapsedSectionIds, onToggleSection: (sectionId) => toggleSectionCollapsed(projectId, sectionId), passesFacets: passesFacets, renderNode: (session) => renderSessionNode(session, false), actions: groupActions, onRename: setGroupToRename, onNewGroup: () => setGroupCreate({ fileSessionId: null }), onCollapseOthers: (groupId) => collapseAllSections(projectId, [
413
- ...Array.from(collapsedSectionIds).filter((id) => id !== sessionGroupSectionId(groupId)),
414
- ...groups
415
- .filter((group) => group.group_id !== groupId)
416
- .map((group) => sessionGroupSectionId(group.group_id)),
417
- ]) })), groupsEnabled && groupCreate && (
413
+ secondary ? (listOpen ? 'flex-1' : 'shrink-0') : 'h-full'), children: [listsReady && (pinnedQuery.sessions.length > 0 || pinnedQuery.hasNextPage || groupsEnabled || groups.length > 0 || groupCreate) && (_jsxs("div", { className: "max-h-[50%] min-h-0 shrink-0 space-y-px overflow-y-auto", children: [groupsEnabled && _jsx(SpacesHeading, { projectId: projectId, onNew: () => setGroupCreate({ fileSessionId: null }) }), groups.length > 0 && (_jsx(SessionGroupSections, { projectId: projectId, groups: groups, labels: labels, collapsedSectionIds: collapsedSectionIds, onToggleSection: (sectionId) => toggleSectionCollapsed(projectId, sectionId), passesFacets: passesFacets, renderNode: (session) => renderSessionNode(session, false), actions: groupActions, onRename: setGroupToRename, onNewGroup: () => setGroupCreate({ fileSessionId: null }), onCollapseOthers: (groupId) => {
414
+ // A space's id in the set means open: keep every other section's state, and only this space open.
415
+ const spaceIds = new Set(groups.map((group) => sessionGroupSectionId(group.group_id)));
416
+ collapseAllSections(projectId, [
417
+ ...Array.from(collapsedSectionIds).filter((id) => !spaceIds.has(id)),
418
+ sessionGroupSectionId(groupId),
419
+ ]);
420
+ } })), groupsEnabled && groupCreate && (
418
421
  // A new group is named in place, at the end of the groups: no dialog.
419
422
  _jsx(NewSessionGroupRow, { projectId: projectId, defaultName: nextSessionGroupName(groups, tGroups('newGroup')), onDone: (group) => {
420
423
  const fileSessionId = groupCreate.fileSessionId;
@@ -422,7 +425,9 @@ export function ProjectSessionList({ projectId, secondary = false }) {
422
425
  // The row whose "New group…" opened it goes in.
423
426
  if (group && fileSessionId)
424
427
  void groupActions.move(fileSessionId, group.group_id);
425
- } }))] })), _jsxs(Disclosure, { open: listOpen, onOpenChange: toggleListOpen, className: "group/sessions flex min-h-0 flex-1 flex-col space-y-px", transition: { duration: 0.15, ease: 'easeOut' }, children: [_jsx(SessionListHeader, { projectId: projectId, sessions: sessions, reviewCountBySession: needsYouBySession, onMenuOpenChange: holdPeek, onNewGroup: groupsEnabled ? () => setGroupCreate({ fileSessionId: null }) : undefined, secondary: secondary }), _jsx(DisclosureContent, { className: "flex min-h-0 flex-1 flex-col", contentClassName: "flex min-h-0 flex-1 flex-col overflow-hidden", children: renderBody() })] }), _jsx(ShareSessionModal, { projectId: projectId, session: sessionToShare, open: !!sessionToShare, onOpenChange: (open) => !open && setSessionToShare(null), onSaved: () => queryClient.invalidateQueries({ queryKey: qk.project.sessionsScope(projectId) }) }), _jsx(SessionLabelsModal, { projectId: projectId, session: sessionToLabel, open: !!sessionToLabel, onOpenChange: (open) => !open && setSessionToLabel(null) }), _jsx(RenameSessionModal, { projectId: projectId, sessionId: sessionToRename?.id ?? null, currentName: sessionToRename?.name, open: !!sessionToRename, onOpenChange: (open) => !open && setSessionToRename(null) }), groupsEnabled && (_jsx(SessionGroupNameModal, { projectId: projectId, group: groupToRename, open: !!groupToRename, onOpenChange: (open) => {
428
+ } })), _jsx(StarterSection, { title: tPinArchive('section'), query: pinnedQuery, sessions: visiblePinned, open: !collapsedSectionIds.has(PINNED_SECTION_ID), onToggle: () => toggleSectionCollapsed(projectId, PINNED_SECTION_ID), renderNode: (session) => renderSessionNode(session, false), caretOnHover: true })] })), _jsxs(Disclosure, { open: listOpen, onOpenChange: toggleListOpen, className: "group/sessions flex min-h-0 flex-1 flex-col space-y-px", transition: { duration: 0.15, ease: 'easeOut' }, children: [_jsx(SessionListHeader, { projectId: projectId, sessions: sessions, reviewCountBySession: needsYouBySession, onMenuOpenChange: holdPeek, onNewGroup: groupsEnabled ? () => setGroupCreate({ fileSessionId: null }) : undefined, secondary: secondary }), _jsx(DisclosureContent, { className: "flex min-h-0 flex-1 flex-col", contentClassName: "flex min-h-0 flex-1 flex-col overflow-hidden", children: renderBody() })] }), _jsx(ShareSessionModal, { projectId: projectId, session: sessionToShare, open: !!sessionToShare, onOpenChange: (open) => !open && setSessionToShare(null), onSaved: () => queryClient.invalidateQueries({ queryKey: qk.project.sessionsScope(projectId) }) }), _jsx(SessionLabelsModal, { projectId: projectId, session: sessionToLabel, open: !!sessionToLabel, onOpenChange: (open) => !open && setSessionToLabel(null) }), _jsx(RenameSessionModal, { projectId: projectId, sessionId: sessionToRename?.id ?? null, currentName: sessionToRename?.name, open: !!sessionToRename, onOpenChange: (open) => !open && setSessionToRename(null) }), groupsEnabled && (
429
+ // Rename opens the space's own edit dialog: name, icon and what it is for, in one place.
430
+ _jsx(SpaceFormModal, { projectId: projectId, space: groupToRename, open: !!groupToRename, onOpenChange: (open) => {
426
431
  if (!open)
427
432
  setGroupToRename(null);
428
433
  } })), _jsx(SessionDeleteModal, { projectId: projectId, sessionId: sessionToDelete?.id ?? null, sessionLabel: sessionToDelete?.label, open: !!sessionToDelete, onOpenChange: (open) => !open && setSessionToDelete(null) }), canShowSessionHoverCard && _jsx(SessionBriefCardHost, {})] }));
@@ -445,7 +450,7 @@ function SessionListHeader({ projectId, sessions, reviewCountBySession, onMenuOp
445
450
  return (_jsxs("div", { className: cn('group/sessions-header hover:bg-sidebar-row flex w-full shrink-0 flex-row items-center gap-1 rounded-md px-2 transition-colors', SESSION_ROW_HEIGHT_CLASS), children: [_jsx(DisclosureTrigger, { children: _jsxs("div", { className: cn('text-muted-foreground group-hover/sessions-header:text-sidebar-foreground flex min-w-0 flex-1 cursor-pointer flex-row items-center gap-1 self-stretch focus-visible:outline-none', secondary ? 'text-xs' : 'text-sm font-medium'), children: [_jsx("span", { className: "truncate", children: t('sessions') }), _jsx(CaretRightSolidIcon, { "aria-hidden": true, className: "duration-normal size-4 shrink-0 opacity-0 transition-transform ease-out group-hover/sessions-header:opacity-100 group-data-[state=open]/sessions:rotate-90" })] }) }), secondary && (_jsx(Hint, { side: "top", label: t('newSession'), children: _jsx(Button, { asChild: true, variant: "ghost", size: "icon-xs", className: controlClass, children: _jsx(UiLink, { href: newSessionHref(projectId), "aria-label": t('newSession'), onClick: () => {
446
451
  if (isMobile)
447
452
  setOpenMobile(false);
448
- }, children: _jsx(PlusIcon, { className: "size-3.5" }) }) }) })), onNewGroup && (_jsx(Hint, { side: "top", label: tGroups('newGroup'), children: _jsx(Button, { variant: "ghost", size: "icon-xs", type: "button", "aria-label": tGroups('newGroup'), className: controlClass, onClick: onNewGroup, children: _jsx(PlusIcon, { className: "size-3.5" }) }) })), sessions.length > 0 && (_jsxs(DropdownMenu, { onOpenChange: onMenuOpenChange, children: [_jsx(SessionFilterMenu, { projectId: projectId, sessions: sessions, reviewCountBySession: reviewCountBySession, align: "start" }), _jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon-xs", type: "button", "aria-label": t('sessionViewOptions'), className: controlClass, children: _jsx(DotsThreeIcon, { className: "size-4" }) }) })] }))] }));
453
+ }, children: _jsx(PlusIcon, { className: "size-3.5" }) }) }) })), onNewGroup && (_jsx(Hint, { side: "top", label: tGroups('newGroup'), children: _jsx(Button, { variant: "ghost", size: "icon-xs", type: "button", "aria-label": tGroups('newGroup'), className: controlClass, onClick: onNewGroup, children: _jsx(PlusIcon, { className: "size-3.5" }) }) })), sessions.length > 0 && (_jsxs(DropdownMenu, { onOpenChange: onMenuOpenChange, children: [_jsx(SessionFilterMenu, { projectId: projectId, sessions: sessions, reviewCountBySession: reviewCountBySession, align: "start" }), _jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon-xs", type: "button", "aria-label": t('sessionViewOptions'), className: controlClass, children: _jsx(FunnelSimpleIcon, { className: "size-4" }) }) })] }))] }));
449
454
  }
450
455
  /** Non-sticky by design: FadedScrollArea masks its own edges, and a sticky
451
456
  * header fights that mask.
@@ -506,7 +511,7 @@ function SessionSectionMenu({ projectId, sessions, reviewCountBySession, }) {
506
511
  if (event.key === 'Enter' || event.key === ' ') {
507
512
  event.stopPropagation();
508
513
  }
509
- }, children: _jsx(DotsThreeIcon, { className: "size-4" }) }) }), _jsx(SessionFilterMenu, { projectId: projectId, sessions: sessions, reviewCountBySession: reviewCountBySession, align: "start" })] }));
514
+ }, children: _jsx(FunnelSimpleIcon, { className: "size-4" }) }) }), _jsx(SessionFilterMenu, { projectId: projectId, sessions: sessions, reviewCountBySession: reviewCountBySession, align: "start" })] }));
510
515
  }
511
516
  /** Count + caret for everything this session started: its sub-agents and
512
517
  * the sessions it spawned. A `span`, not a button: it lives inside the row's
@@ -538,7 +543,9 @@ function StarterSection({ title, query, sessions, open, onToggle, renderNode, ca
538
543
  // rows the viewer can see may sit past the first pages (KRTX-1727).
539
544
  if (query.sessions.length === 0 && !query.hasNextPage)
540
545
  return null;
541
- return (_jsxs(Disclosure, { open: open, onOpenChange: onToggle, className: "group/section space-y-1", transition: { duration: 0.15, ease: 'easeOut' }, children: [_jsx(DisclosureTrigger, { children: _jsxs("div", { className: cn('group/section-header text-muted-foreground flex items-center gap-1 px-2 text-sm font-medium', SESSION_ROW_HEIGHT_CLASS), children: [_jsx("span", { className: "truncate", children: title }), _jsx(CaretRightSolidIcon, { "aria-hidden": true, className: cn('duration-normal size-4 shrink-0 transition-[transform,opacity] ease-out group-data-[state=open]/section:rotate-90', caretOnHover &&
546
+ return (_jsxs(Disclosure, { open: open, onOpenChange: onToggle,
547
+ // The rows' own 1px rhythm under the header, the same as Spaces and Sessions.
548
+ className: "group/section space-y-px", transition: { duration: 0.15, ease: 'easeOut' }, children: [_jsx(DisclosureTrigger, { children: _jsxs("div", { className: cn('group/section-header text-muted-foreground flex items-center gap-1 px-2 text-sm font-medium', SESSION_ROW_HEIGHT_CLASS), children: [_jsx("span", { className: "truncate", children: title }), _jsx(CaretRightSolidIcon, { "aria-hidden": true, className: cn('duration-normal size-4 shrink-0 transition-[transform,opacity] ease-out group-data-[state=open]/section:rotate-90', caretOnHover &&
542
549
  'opacity-0 group-hover/section-header:opacity-100 group-focus-visible/section-header:opacity-100') })] }) }), _jsxs(DisclosureContent, { contentClassName: "space-y-px", children: [sessions.map(renderNode), query.hasNextPage && (_jsx(ShowMoreButton, { loading: query.isFetchingNextPage, failed: query.isFetchNextPageError, label: t('loadMore'), onClick: () => query.fetchNextPage() }))] })] }));
543
550
  }
544
551
  /**
@@ -27,16 +27,19 @@ import { AppsModal } from '../../internal/apps-and-extensions/apps-modal.js';
27
27
  import { useAppsModalStore } from '../../internal/stores/apps-modal-store.js';
28
28
  import { CHROME_UI_ENABLED } from '../../internal/chrome/use-chrome-offered.js';
29
29
  import { MagnifyingGlassIcon, NavigationArrowIcon, } from '@phosphor-icons/react';
30
- import { UiLink as Link } from '../../providers/ui-provider.js';
31
- import { useWorkspaceSettingsRailStore } from '../../internal/stores/workspace-settings-rail-store.js';
30
+ import { UiLink as Link, useUiPathname } from '../../providers/ui-provider.js';
32
31
  import { SettingsReturnTracker, SidebarDrill } from './sidebar-drill.js';
33
- import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
32
+ import { useCallback, useEffect, useRef, useState } from 'react';
34
33
  import { SidebarBalanceWarning } from './footer/project-balance-warning.js';
35
34
  import { SidebarUpgradeButton } from './footer/project-upgrade-button.js';
36
35
  import { SidebarGlyph as PanelLeft } from '../../icons/sidebar-toggle.js';
37
36
  import { Close } from '../../icons/close.js';
38
37
  const isMac = typeof navigator !== 'undefined' && /Mac|iPod|iPhone|iPad/.test(navigator.platform);
39
38
  const modSymbol = isMac ? '⌘' : 'Ctrl';
39
+ /** Workspace pages with a centered bottom composer: home and one session (not the Sessions list). */
40
+ const CENTERED_COMPOSER_ROUTE = /\/workspaces\/[^/]+(?:\/sessions\/[^/]+(?:\/.*)?)?\/?$/;
41
+ /** Workspace pages whose composer runs to the right edge: chat, DMs, channels, Spaces. */
42
+ const FULL_COMPOSER_ROUTE = /\/workspaces\/[^/]+\/(?:c|chat|dm|spaces)(?:\/.*)?$/;
40
43
  export function ProjectSidebar({ projectId, menu, onOpenSearch, onOpenDownloadApp, }) {
41
44
  const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
42
45
  const t = useTranslations('sidebar');
@@ -44,6 +47,7 @@ export function ProjectSidebar({ projectId, menu, onOpenSearch, onOpenDownloadAp
44
47
  const { state, setOpenMobile, toggleSidebar, peek } = useSidebar();
45
48
  const isExpanded = state === 'expanded';
46
49
  const isMobile = useIsMobile();
50
+ const pathname = useUiPathname();
47
51
  const sessionsGroupRef = useRef(null);
48
52
  // Mounted outside <Sidebar>: the mobile sheet unmounts its content on close.
49
53
  const [computerConnectOpen, setComputerConnectOpen] = useState(false);
@@ -53,14 +57,6 @@ export function ProjectSidebar({ projectId, menu, onOpenSearch, onOpenDownloadAp
53
57
  if (isMobile)
54
58
  setOpenMobile(false);
55
59
  }, [isMobile, setOpenMobile]);
56
- // The page hides its own rail while this panel is docked open on the
57
- // desktop. The value does not depend on the route, so it is already right
58
- // when the settings page renders its first frame: no rail flashes in.
59
- const setSidebarDocked = useWorkspaceSettingsRailStore((s) => s.setSidebarDocked);
60
- useLayoutEffect(() => {
61
- setSidebarDocked(isExpanded && !isMobile);
62
- }, [isExpanded, isMobile, setSidebarDocked]);
63
- useLayoutEffect(() => () => setSidebarDocked(false), [setSidebarDocked]);
64
60
  const accountId = useBillingAccountId();
65
61
  // Chat (`chat`): the spaces list replaces New session, and the session list
66
62
  // moves below it, closed by default (fail-closed: off until the project answers).
@@ -111,7 +107,7 @@ export function ProjectSidebar({ projectId, menu, onOpenSearch, onOpenDownloadAp
111
107
  }, [handleNewSession]);
112
108
  // The connect rows and the upgrade call to action. Spaces on (`chat`), they
113
109
  // live inside "More": the bottom of the sidebar is More and the status alerts.
114
- const connectRows = (_jsxs(_Fragment, { children: [_jsx("li", { className: "not-has-[li]:hidden", children: _jsx("ul", { className: "pb-1", children: _jsx(ProjectPromoCards, { projectId: projectId, onOpenMcp: () => setConnectMcpOpen(true), onOpenComputer: () => setComputerConnectOpen(true), onOpenChrome: chrome ? () => useAppsModalStore.getState().setOpen(true) : undefined, onOpenDownloadApp: onOpenDownloadApp }) }) }), _jsx(SidebarUpgradeButton, { accountId: accountId })] }));
110
+ const connectRows = (_jsxs(_Fragment, { children: [_jsx("li", { className: "not-has-[li]:hidden", children: _jsx("ul", { className: "pb-1", children: isMobile ? (_jsx(ProjectPromoCards, { projectId: projectId, onOpenMcp: () => setConnectMcpOpen(true), onOpenComputer: () => setComputerConnectOpen(true), onOpenChrome: chrome ? () => useAppsModalStore.getState().setOpen(true) : undefined, onOpenDownloadApp: onOpenDownloadApp })) : null }) }), _jsx(SidebarUpgradeButton, { accountId: accountId })] }));
115
111
  return (
116
112
  // The New agent modal mounts beside <Sidebar>, outside the mobile sheet.
117
113
  _jsxs(NewAgentModalProvider, { projectId: projectId, children: [_jsxs(Sidebar, { collapsible: "offcanvas", variant: "inset",
@@ -124,5 +120,9 @@ export function ProjectSidebar({ projectId, menu, onOpenSearch, onOpenDownloadAp
124
120
  // box clears the 44px floor with the vertical-only extension —
125
121
  // vertical-only because this titlebar row packs several
126
122
  // controls side by side (KRTX-2004).
127
- className: "shrink-0 hit-area-y-3", children: _jsx(MagnifyingGlassIcon, { className: "size-4" }) }) })), isMobile && (_jsx(Button, { type: "button", "aria-label": tCommon('close'), variant: "ghost", size: "icon", onClick: () => setOpenMobile(false), className: "shrink-0 hit-area-y-3", children: _jsx(Close, {}) })), !isMobile && !peek && (_jsx(Hint, { side: "bottom", label: _jsxs("span", { className: "flex items-center gap-1.5", children: [isExpanded ? t('collapse') : t('pin'), _jsxs(KbdGroup, { children: [_jsx(Kbd, { className: "font-mono", children: modSymbol }), _jsx(Kbd, { className: "font-mono", children: "B" })] })] }), children: _jsx(Button, { type: "button", "aria-label": isExpanded ? t('collapse') : t('pin'), variant: "ghost", size: "icon", onClick: toggleSidebar, className: "shrink-0", children: _jsx(PanelLeft, { className: "cn-rtl-flip" }) }) }))] })] }) }), _jsx(SidebarContent, { className: "relative min-h-0 flex-1 [scrollbar-width:'none'] overflow-hidden [-ms-overflow-style:'none'] [&::-webkit-scrollbar]:hidden [&_[data-sidebar=menu-button]]:pl-2", children: _jsxs(SidebarDrill, { projectId: projectId, onNavigate: handleDrilledNavigate, children: [_jsx(SidebarGroup, { className: "py-0", children: _jsxs(SidebarMenu, { children: [chat ? null : (_jsx(SidebarMenuItem, { children: creatingSession ? (_jsx(SidebarMenuButton, { disabled: true, "aria-busy": true, className: "group/menu-button text-sidebar-foreground relative", children: newSessionRowBody })) : (_jsx(SidebarMenuButton, { asChild: true, className: "group/menu-button text-sidebar-foreground relative", children: _jsx(Link, { href: uiRoutes().project(projectId), prefetch: true, onClick: handleNewSessionClick, children: newSessionRowBody }) })) })), chat ? null : _jsx(ProjectNavItems, { projectId: projectId })] }) }), _jsx(SidebarGroup, { className: "min-h-0 flex-1 flex-col py-0", ref: sessionsGroupRef, children: chat ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "min-h-0 flex-1", children: _jsx(ProjectSpacesNav, { projectId: projectId }) }), _jsx(SidebarMoreGroup, { projectId: projectId, footer: _jsx(SidebarMenu, { className: "gap-1", children: connectRows }) })] })) : (_jsx(ProjectSessionList, { projectId: projectId })) }), _jsx(SidebarGroup, { className: "mt-auto", children: _jsxs(SidebarMenu, { className: "gap-1", children: [_jsx(ProjectRepositoryDisconnectedAlert, { projectId: projectId }), _jsx(ProjectSandboxAlert, { projectId: projectId }), _jsx(ProjectManifestIssuesAlert, { projectId: projectId }), _jsx(SidebarBalanceWarning, { accountId: accountId }), chat ? null : connectRows] }) })] }) }), _jsx(SidebarRail, { "aria-label": t('resize'), title: t('resizeHelp') })] }), _jsx(SettingsReturnTracker, { projectId: projectId }), _jsx(ComputerConnectModal, { projectId: projectId, open: computerConnectOpen, onOpenChange: setComputerConnectOpen }), _jsx(AppsModal, { chrome: chrome, onOpenComputer: () => setComputerConnectOpen(true), onOpenMcp: () => setConnectMcpOpen(true) }), _jsx(ConnectMcpModal, { open: connectMcpOpen, onOpenChange: setConnectMcpOpen })] }));
123
+ className: "shrink-0 hit-area-y-3", children: _jsx(MagnifyingGlassIcon, { className: "size-4" }) }) })), isMobile && (_jsx(Button, { type: "button", "aria-label": tCommon('close'), variant: "ghost", size: "icon", onClick: () => setOpenMobile(false), className: "shrink-0 hit-area-y-3", children: _jsx(Close, {}) })), !isMobile && !peek && (_jsx(Hint, { side: "bottom", label: _jsxs("span", { className: "flex items-center gap-1.5", children: [isExpanded ? t('collapse') : t('pin'), _jsxs(KbdGroup, { children: [_jsx(Kbd, { className: "font-mono", children: modSymbol }), _jsx(Kbd, { className: "font-mono", children: "B" })] })] }), children: _jsx(Button, { type: "button", "aria-label": isExpanded ? t('collapse') : t('pin'), variant: "ghost", size: "icon", onClick: toggleSidebar, className: "shrink-0", children: _jsx(PanelLeft, { className: "cn-rtl-flip" }) }) }))] })] }) }), _jsx(SidebarContent, { className: "relative min-h-0 flex-1 [scrollbar-width:'none'] overflow-hidden [-ms-overflow-style:'none'] [&::-webkit-scrollbar]:hidden [&_[data-sidebar=menu-button]]:pl-2", children: _jsxs(SidebarDrill, { projectId: projectId, onNavigate: handleDrilledNavigate, children: [_jsx(SidebarGroup, { className: "py-0", children: _jsxs(SidebarMenu, { children: [chat ? null : (_jsx(SidebarMenuItem, { children: creatingSession ? (_jsx(SidebarMenuButton, { disabled: true, "aria-busy": true, className: "group/menu-button text-sidebar-foreground relative", children: newSessionRowBody })) : (_jsx(SidebarMenuButton, { asChild: true, className: "group/menu-button text-sidebar-foreground relative", children: _jsx(Link, { href: uiRoutes().project(projectId), prefetch: true, onClick: handleNewSessionClick, children: newSessionRowBody }) })) })), chat ? null : _jsx(ProjectNavItems, { projectId: projectId })] }) }), _jsx(SidebarGroup, { className: "min-h-0 flex-1 flex-col py-0", ref: sessionsGroupRef, children: chat ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "min-h-0 flex-1", children: _jsx(ProjectSpacesNav, { projectId: projectId }) }), _jsx(SidebarMoreGroup, { projectId: projectId, footer: _jsx(SidebarMenu, { className: "gap-1", children: connectRows }) })] })) : (_jsx(ProjectSessionList, { projectId: projectId })) }), _jsx(SidebarGroup, { className: "mt-auto", children: _jsxs(SidebarMenu, { className: "gap-1", children: [_jsx(ProjectRepositoryDisconnectedAlert, { projectId: projectId }), _jsx(ProjectSandboxAlert, { projectId: projectId }), _jsx(ProjectManifestIssuesAlert, { projectId: projectId }), _jsx(SidebarBalanceWarning, { accountId: accountId }), chat ? null : connectRows] }) })] }) }), _jsx(SidebarRail, { "aria-label": t('resize'), title: t('resizeHelp') })] }), _jsx(SettingsReturnTracker, { projectId: projectId }), isMobile ? null : (_jsx(ProjectPromoCards, { projectId: projectId, onOpenMcp: () => setConnectMcpOpen(true), onOpenComputer: () => setComputerConnectOpen(true), onOpenChrome: chrome ? () => useAppsModalStore.getState().setOpen(true) : undefined, onOpenDownloadApp: onOpenDownloadApp, variant: "floating", composer: FULL_COMPOSER_ROUTE.test(pathname)
124
+ ? 'full'
125
+ : CENTERED_COMPOSER_ROUTE.test(pathname)
126
+ ? 'centered'
127
+ : undefined })), _jsx(ComputerConnectModal, { projectId: projectId, open: computerConnectOpen, onOpenChange: setComputerConnectOpen }), _jsx(AppsModal, { chrome: chrome, onOpenComputer: () => setComputerConnectOpen(true), onOpenMcp: () => setConnectMcpOpen(true) }), _jsx(ConnectMcpModal, { open: connectMcpOpen, onOpenChange: setConnectMcpOpen })] }));
128
128
  }
@@ -9,7 +9,6 @@ import { useTranslations } from '../../i18n/index.js';
9
9
  import { HoverPrefetchLink } from '../../internal/components/hover-prefetch-link.js';
10
10
  import { useIsMobile } from '../../internal/hooks/index.js';
11
11
  import { reviewHref } from '../../internal/lib/capability-tab-routes.js';
12
- import { ProjectInboxNavItem } from './footer/project-inbox-nav.js';
13
12
  import { uiRoutes } from '../../lib/routes.js';
14
13
  import { Button } from '../../primitives/button.js';
15
14
  import { CountBadge } from '../../primitives/count-badge.js';
@@ -61,7 +60,7 @@ export function ProjectSpacesNav({ projectId }) {
61
60
  const review = reviewHref(projectId);
62
61
  const openAsks = useReviewNeedsYouCount(projectId);
63
62
  const hrefOf = (space) => space.kind === 'dm' ? uiRoutes().dm(projectId, space.dm_agent_name ?? '') : uiRoutes().channel(projectId, space.slug ?? '');
64
- return (_jsxs(FadedScrollArea, { fadeColor: "from-background", className: "h-full min-h-0", children: [_jsxs(SidebarMenu, { className: "gap-px", onKeyDown: moveFocus, children: [_jsx(ProjectInboxNavItem, {}), review ? (
63
+ return (_jsxs(FadedScrollArea, { fadeColor: "from-background", className: "h-full min-h-0", children: [_jsxs(SidebarMenu, { className: "gap-px", onKeyDown: moveFocus, children: [review ? (
65
64
  // Spacing, not a rule, sets Review apart from the spaces.
66
65
  _jsx(SidebarMenuItem, { className: "mb-2", children: _jsx(SidebarMenuButton, { asChild: true, isActive: isAt(pathname, review), className: "text-sidebar-foreground", children: _jsxs(HoverPrefetchLink, { href: review, children: [_jsx(CheckIcon, {}), _jsx("span", { className: "min-w-0 flex-1 truncate", children: t('spaces.review') }), openAsks > 0 ? _jsx(CountBadge, { count: openAsks, tone: "waiting" }) : null] }) }) })) : null, _jsx(SpaceRow, { projectId: projectId, space: personal, href: chatHref, active: isAt(pathname, chatHref) || isAt(pathname, uiRoutes().dm(projectId, MY_KORTIX_AGENT_NAME)), name: personalName, personal: true, isPrivate: true, names: names }), spaces.isError && !spaces.data ? (_jsxs("li", { className: "space-y-1.5 px-2 py-2", children: [_jsx("p", { className: "text-destructive/80 text-xs", children: t('spaces.loadError') }), _jsx(Button, { variant: "outline", size: "xs", onClick: () => spaces.refetch(), children: t('retry') })] })) : null, others.map((space) => {
67
66
  const href = hrefOf(space);
@@ -13,7 +13,8 @@ import { SOURCE_ICONS } from './session-source-icons.js';
13
13
  import { localizeUiCatalog } from '../../i18n/ui-catalog/localize-ui-catalog.js';
14
14
  import { REMAINING_UI_TRANSLATION_KEYS } from '../../i18n/ui-catalog/remaining-ui-translation-keys.generated.js';
15
15
  import { selectAccessFilters, selectGroupMode, selectHiddenSections, selectLabelFilters, selectOrderMode, selectOwnerFilters, selectSourceFilters, selectStatusFilters, useSessionFilterStore, } from '../../internal/stores/session-filter-store.js';
16
- import { GlobeIcon, LockSimpleIcon, TagIcon, UsersIcon as UsersSolid } from '@phosphor-icons/react';
16
+ import { ArchiveIcon, ArrowSquareInIcon, ArrowsDownUpIcon, ArrowsInLineVerticalIcon, CircleDashedIcon, EyeIcon, GlobeIcon, ListBulletsIcon, LockSimpleIcon, SquaresFourIcon, TagIcon, TrashIcon, UserCircleIcon, UsersIcon as UsersSolid, } from '@phosphor-icons/react';
17
+ import { SessionStatusMark } from '../../session/list/session-status-mark.js';
17
18
  import { CountBadge } from '../../primitives/count-badge.js';
18
19
  import { groupSessions, localizedSessionGroupModes, localizedSessionOrderModes, } from './session-grouping.js';
19
20
  /**
@@ -132,7 +133,9 @@ export function SessionFilterMenu({ projectId, sessions, align = 'start', side =
132
133
  // Owner and Access are the page's facets: the page lists every session the
133
134
  // viewer may open (for an account admin with session oversight, everyone's),
134
135
  // while the sidebar is the viewer's own working set.
135
- const pageFacets = surface === 'page';
136
+ const pageFacets = surface !== 'sidebar';
137
+ // A space's list is one flat history: it is ordered and filtered, never grouped.
138
+ const grouped = surface !== 'space';
136
139
  const ownerLabels = { you: t('ownerValue.you'), unknown: t('ownerValue.unknown') };
137
140
  const setGroupMode = useSessionFilterStore((s) => s.setGroupMode);
138
141
  const setOrderMode = useSessionFilterStore((s) => s.setOrderMode);
@@ -197,7 +200,8 @@ export function SessionFilterMenu({ projectId, sessions, align = 'start', side =
197
200
  const pageFacetVisibility = pageFacets
198
201
  ? resolvePageFacetVisibility(sessions, activeOwners, activeAccess)
199
202
  : { owner: false, access: false };
200
- const showOwnerFacet = pageFacetVisibility.owner;
203
+ // A space always offers its members, even when one person started every session.
204
+ const showOwnerFacet = surface === 'space' ? ownerOptions.length > 0 : pageFacetVisibility.owner;
201
205
  const showAccessFacet = pageFacetVisibility.access;
202
206
  // Server-side facet: `sessions` already carry every selected label, so the
203
207
  // options are the labels that co-occur with the current selection.
@@ -223,33 +227,35 @@ export function SessionFilterMenu({ projectId, sessions, align = 'start', side =
223
227
  const hiddenSectionSet = new Set(hiddenSections);
224
228
  const statusFilterSet = new Set(statusFilters);
225
229
  const sourceFilterSet = new Set(sourceFilters);
226
- return (_jsxs(DropdownMenuContent, { align: align, side: side, className: "w-56 p-1", children: [_jsx(FilterSubmenu, { trigger: _jsxs(_Fragment, { children: [_jsx("span", { className: "min-w-0 flex-1 truncate", children: t('grouping') }), _jsx("span", { className: "text-muted-foreground truncate text-xs", children: groupLabel })] }), className: "w-40 p-1", children: _jsx(DropdownMenuRadioGroup, { value: groupMode, onValueChange: (value) => setGroupMode(projectId, value, surface), children: localizedGroupModes.map((mode) => (_jsx(FilterRadioItem, { value: mode.value, children: groupLabels[mode.value] }, mode.value))) }) }), _jsx(FilterSubmenu, { trigger: _jsxs(_Fragment, { children: [_jsx("span", { className: "min-w-0 flex-1 truncate", children: t('ordering') }), _jsx("span", { className: "text-muted-foreground truncate text-xs", children: orderLabel })] }), className: "w-40 p-1", children: _jsx(DropdownMenuRadioGroup, { value: orderMode, onValueChange: (value) => setOrderMode(projectId, value, surface), children: localizedOrderModes.map((mode) => (_jsx(FilterRadioItem, { value: mode.value, children: orderLabels[mode.value] }, mode.value))) }) }), showOptions.length > 0 && (_jsx(FilterSubmenu, { trigger: _jsx(_Fragment, { children: _jsx("span", { className: "min-w-0 flex-1 truncate", children: t('show') }) }), className: "w-48 p-1", children: showOptions.map((option) => (_jsx(FilterCheckboxItem, { checked: !hiddenSectionSet.has(option.id), onCheckedChange: () => toggleSectionHidden(projectId, option.id, surface), children: sectionLabels[option.id] ?? option.label }, option.id))) })), showFiltersSection && (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, {}), _jsxs("div", { className: "flex items-center justify-between gap-2 pr-1", children: [_jsx(DropdownMenuLabel, { className: "flex-1", children: t('filters') }), _jsx(DropdownMenuItem, { disabled: !hasActiveFacets, className: "text-muted-foreground w-auto shrink-0 cursor-pointer justify-end px-2 text-xs font-medium", onSelect: (event) => {
230
+ return (_jsxs(DropdownMenuContent, { align: align, side: side, className: "w-56 p-1", children: [grouped && (_jsx(FilterSubmenu, { icon: _jsx(SquaresFourIcon, {}), trigger: _jsxs(_Fragment, { children: [_jsx("span", { className: "min-w-0 flex-1 truncate", children: t('grouping') }), _jsx("span", { className: "text-muted-foreground truncate text-xs", children: groupLabel })] }), className: "w-40 p-1", children: _jsx(DropdownMenuRadioGroup, { value: groupMode, onValueChange: (value) => setGroupMode(projectId, value, surface), children: localizedGroupModes.map((mode) => (_jsx(FilterRadioItem, { value: mode.value, children: groupLabels[mode.value] }, mode.value))) }) })), _jsx(FilterSubmenu, { icon: _jsx(ArrowsDownUpIcon, {}), trigger: _jsxs(_Fragment, { children: [_jsx("span", { className: "min-w-0 flex-1 truncate", children: t('ordering') }), _jsx("span", { className: "text-muted-foreground truncate text-xs", children: orderLabel })] }), className: "w-40 p-1", children: _jsx(DropdownMenuRadioGroup, { value: orderMode, onValueChange: (value) => setOrderMode(projectId, value, surface), children: localizedOrderModes.map((mode) => (_jsx(FilterRadioItem, { value: mode.value, children: orderLabels[mode.value] }, mode.value))) }) }), grouped && showOptions.length > 0 && (_jsx(FilterSubmenu, { icon: _jsx(EyeIcon, {}), trigger: _jsx(_Fragment, { children: _jsx("span", { className: "min-w-0 flex-1 truncate", children: t('show') }) }), className: "w-48 p-1", children: showOptions.map((option) => (_jsx(FilterCheckboxItem, { checked: !hiddenSectionSet.has(option.id), onCheckedChange: () => toggleSectionHidden(projectId, option.id, surface), children: sectionLabels[option.id] ?? option.label }, option.id))) })), showFiltersSection && (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, {}), _jsxs("div", { className: "flex items-center justify-between gap-2 pr-1", children: [_jsx(DropdownMenuLabel, { className: "flex-1", children: t('filters') }), _jsx(DropdownMenuItem, { disabled: !hasActiveFacets, className: "text-muted-foreground w-auto shrink-0 cursor-pointer justify-end px-2 text-xs font-medium", onSelect: (event) => {
227
231
  // Reset stays legible without collapsing the menu the user is
228
232
  // mid-adjustment in — same "stay open" contract as every
229
233
  // checkbox row below.
230
234
  event.preventDefault();
231
235
  resetFilters(projectId, surface);
232
- }, children: t('reset') })] }), statusOptions.length > 0 && (_jsx(FilterSubmenu, { trigger: _jsxs(_Fragment, { children: [_jsx("span", { className: "min-w-0 flex-1 truncate", children: t('status') }), statusFilters.length > 0 && _jsx(FacetActiveDot, {})] }), className: "w-48 p-1", children: statusOptions.map((option) => (_jsxs(FilterCheckboxItem, { checked: statusFilterSet.has(option.value), onCheckedChange: () => toggleStatusFilter(projectId, option.value, surface), children: [_jsx("span", { className: "min-w-0 flex-1 truncate", children: statusLabels[option.value] }), _jsx(CountBadge, { count: option.count, className: "ml-auto" })] }, option.value))) })), sourceOptions.length > 0 && (_jsx(FilterSubmenu, { trigger: _jsxs(_Fragment, { children: [_jsx("span", { className: "min-w-0 flex-1 truncate", children: t('source') }), sourceFilters.length > 0 && _jsx(FacetActiveDot, {})] }), className: "w-48 p-1", children: sourceOptions.map((option) => {
236
+ }, children: t('reset') })] }), statusOptions.length > 0 && (_jsx(FilterSubmenu, { icon: _jsx(CircleDashedIcon, {}), trigger: _jsxs(_Fragment, { children: [_jsx("span", { className: "min-w-0 flex-1 truncate", children: t('status') }), statusFilters.length > 0 && _jsx(FacetActiveDot, {})] }), className: "w-48 p-1", children: statusOptions.map((option) => (_jsxs(FilterCheckboxItem, { checked: statusFilterSet.has(option.value), onCheckedChange: () => toggleStatusFilter(projectId, option.value, surface), children: [_jsx("span", { className: "flex size-4 shrink-0 items-center justify-center", children: _jsx(SessionStatusMark, { status: option.value }) }), _jsx("span", { className: "min-w-0 flex-1 truncate", children: statusLabels[option.value] }), _jsx(CountBadge, { count: option.count, className: "ml-auto" })] }, option.value))) })), sourceOptions.length > 0 && (_jsx(FilterSubmenu, { icon: _jsx(ArrowSquareInIcon, {}), trigger: _jsxs(_Fragment, { children: [_jsx("span", { className: "min-w-0 flex-1 truncate", children: t('source') }), sourceFilters.length > 0 && _jsx(FacetActiveDot, {})] }), className: "w-48 p-1", children: sourceOptions.map((option) => {
233
237
  const OptionIcon = SOURCE_FILTER_ICONS[option.value];
234
238
  return (_jsxs(FilterCheckboxItem, { checked: sourceFilterSet.has(option.value), onCheckedChange: () => toggleSourceFilter(projectId, option.value, surface), children: [_jsx(OptionIcon, { className: "size-4" }), _jsx("span", { className: "min-w-0 flex-1 truncate", children: sourceLabels[option.value] }), _jsx(CountBadge, { count: option.count, className: "ml-auto" })] }, option.value));
235
- }) })), labelOptions.length > 0 && (_jsx(FilterSubmenu, { trigger: _jsxs(_Fragment, { children: [_jsx("span", { className: "min-w-0 flex-1 truncate", children: t('labels') }), labelFilters.length > 0 && _jsx(FacetActiveDot, {})] }), className: "max-h-80 w-56 overflow-y-auto p-1", children: labelOptions.map((option) => (_jsxs(FilterCheckboxItem, { checked: labelFilterSet.has(option.value), onCheckedChange: () => toggleLabelFilter(projectId, option.value, surface), children: [_jsx(TagIcon, { className: "size-4" }), _jsx("span", { className: "min-w-0 flex-1 truncate", children: option.value }), _jsx(CountBadge, { count: option.count, className: "ml-auto" })] }, option.value))) })), showOwnerFacet && (_jsx(FilterSubmenu, { trigger: _jsxs(_Fragment, { children: [_jsx("span", { className: "min-w-0 flex-1 truncate", children: t('owner') }), activeOwners.length > 0 && _jsx(FacetActiveDot, {})] }), className: "max-h-80 w-56 overflow-y-auto p-1", children: ownerOptions.map((option) => {
236
- const label = option.isViewer
239
+ }) })), labelOptions.length > 0 && (_jsx(FilterSubmenu, { icon: _jsx(TagIcon, {}), trigger: _jsxs(_Fragment, { children: [_jsx("span", { className: "min-w-0 flex-1 truncate", children: t('labels') }), labelFilters.length > 0 && _jsx(FacetActiveDot, {})] }), className: "max-h-80 w-56 overflow-y-auto p-1", children: labelOptions.map((option) => (_jsxs(FilterCheckboxItem, { checked: labelFilterSet.has(option.value), onCheckedChange: () => toggleLabelFilter(projectId, option.value, surface), children: [_jsx(TagIcon, { className: "size-4" }), _jsx("span", { className: "min-w-0 flex-1 truncate", children: option.value }), _jsx(CountBadge, { count: option.count, className: "ml-auto" })] }, option.value))) })), showOwnerFacet && (_jsx(FilterSubmenu, { icon: _jsx(UserCircleIcon, {}), trigger: _jsxs(_Fragment, { children: [_jsx("span", { className: "min-w-0 flex-1 truncate", children: surface === 'space' ? t('members') : t('owner') }), activeOwners.length > 0 && _jsx(FacetActiveDot, {})] }), className: "max-h-80 w-56 overflow-y-auto p-1", children: ownerOptions.map((option) => {
240
+ // A space names everyone, the viewer included: its menu reads as a list of members.
241
+ const label = option.isViewer && surface !== 'space'
237
242
  ? t('ownerValue.you')
238
243
  : option.value === UNKNOWN_OWNER_KEY
239
244
  ? t('ownerValue.unknown')
240
245
  : (option.name ?? option.email ?? option.value);
241
- return (_jsxs(FilterCheckboxItem, { checked: ownerFilterSet.has(option.value), onCheckedChange: () => toggleOwnerFilter(projectId, option.value, surface), children: [_jsx(UserAvatar, { size: "xs", name: option.name ?? undefined, email: option.email ?? '' }), _jsx("span", { className: "min-w-0 flex-1 truncate", children: label }), _jsx(CountBadge, { count: option.count, className: "ml-auto" })] }, option.value));
242
- }) })), showAccessFacet && (_jsx(FilterSubmenu, { trigger: _jsxs(_Fragment, { children: [_jsx("span", { className: "min-w-0 flex-1 truncate", children: t('access') }), activeAccess.length > 0 && _jsx(FacetActiveDot, {})] }), className: "w-52 p-1", children: accessOptions.map((option) => {
246
+ return (_jsxs(FilterCheckboxItem, { checked: ownerFilterSet.has(option.value), onCheckedChange: () => toggleOwnerFilter(projectId, option.value, surface), children: [_jsx(UserAvatar, { size: "xs", name: option.name ?? undefined, email: option.email ?? '', avatarUrl: option.avatarUrl, colorKey: option.value }), _jsx("span", { className: "min-w-0 flex-1 truncate", children: label }), _jsx(CountBadge, { count: option.count, className: "ml-auto" })] }, option.value));
247
+ }) })), showAccessFacet && (_jsx(FilterSubmenu, { icon: _jsx(LockSimpleIcon, {}), trigger: _jsxs(_Fragment, { children: [_jsx("span", { className: "min-w-0 flex-1 truncate", children: t('access') }), activeAccess.length > 0 && _jsx(FacetActiveDot, {})] }), className: "w-52 p-1", children: accessOptions.map((option) => {
243
248
  const OptionIcon = SESSION_ACCESS_ICONS[option.value];
244
249
  return (_jsxs(FilterCheckboxItem, { checked: accessFilterSet.has(option.value), onCheckedChange: () => toggleAccessFilter(projectId, option.value, surface), children: [_jsx(OptionIcon, { className: "size-4" }), _jsx("span", { className: "min-w-0 flex-1 truncate", children: accessLabels[option.value] }), _jsx(CountBadge, { count: option.count, className: "ml-auto" })] }, option.value));
245
- }) })), ' '] })), _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuItem, { className: "cursor-pointer", onSelect: () => collapseAllSections(projectId, resolveRenderedSectionIds(sessions, groupMode, orderMode, hiddenSections, tI18nComplete, reviewCountBySession, ownerLabels), surface), children: t('collapseAll') }), !pageFacets && sessionsHref && archivedHref && deletedHref && (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuItem, { asChild: true, className: "cursor-pointer", children: _jsx(Link, { href: sessionsHref, children: tI18nComplete.raw('text78648d4d6649') }) }), _jsx(DropdownMenuItem, { asChild: true, className: "cursor-pointer", children: _jsx(Link, { href: archivedHref, children: tPinArchive('showArchived') }) }), _jsx(DropdownMenuItem, { asChild: true, className: "cursor-pointer", children: _jsx(Link, { href: deletedHref, children: tDeleted('view') }) })] }))] }));
250
+ }) }))] })), grouped && _jsx(DropdownMenuSeparator, {}), grouped && (_jsxs(DropdownMenuItem, { className: "cursor-pointer", onSelect: () => collapseAllSections(projectId, resolveRenderedSectionIds(sessions, groupMode, orderMode, hiddenSections, tI18nComplete, reviewCountBySession, ownerLabels), surface), children: [_jsx(ArrowsInLineVerticalIcon, {}), t('collapseAll')] })), !pageFacets && sessionsHref && archivedHref && deletedHref && (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuItem, { asChild: true, className: "cursor-pointer", children: _jsxs(Link, { href: sessionsHref, children: [_jsx(ListBulletsIcon, {}), tI18nComplete.raw('text78648d4d6649')] }) }), _jsx(DropdownMenuItem, { asChild: true, className: "cursor-pointer", children: _jsxs(Link, { href: archivedHref, children: [_jsx(ArchiveIcon, {}), tPinArchive('showArchived')] }) }), _jsx(DropdownMenuItem, { asChild: true, className: "cursor-pointer", children: _jsxs(Link, { href: deletedHref, children: [_jsx(TrashIcon, {}), tDeleted('view')] }) })] }))] }));
246
251
  }
247
- function FilterSubmenu({ trigger, className, children, }) {
248
- return (_jsxs(DropdownMenuSub, { children: [_jsx(DropdownMenuSubTrigger, { children: trigger }), _jsx(DropdownMenuSubContent, { className: className, children: children })] }));
252
+ function FilterSubmenu({ icon, trigger, className, children, }) {
253
+ return (_jsxs(DropdownMenuSub, { children: [_jsxs(DropdownMenuSubTrigger, { children: [icon, trigger] }), _jsx(DropdownMenuSubContent, { className: className, children: children })] }));
249
254
  }
250
255
  function FilterRadioItem(props) {
251
256
  return _jsx(DropdownMenuRadioItem, { ...props, onSelect: (event) => event.preventDefault() });
252
257
  }
258
+ /** A multi-select row: a checkbox, since several can be on at once. */
253
259
  function FilterCheckboxItem(props) {
254
- return _jsx(DropdownMenuCheckboxItem, { ...props, onSelect: (event) => event.preventDefault() });
260
+ return _jsx(DropdownMenuCheckboxItem, { indicator: "checkbox", ...props, onSelect: (event) => event.preventDefault() });
255
261
  }
@@ -15,7 +15,10 @@ import { type DragEvent, type ReactNode } from 'react';
15
15
  export declare function markNewGroupFocus(): void;
16
16
  /** `onCloseAutoFocus` of a menu with a "New group" item. */
17
17
  export declare function keepFocusForNewGroup(event: Event): void;
18
- /** The collapsed-sections id of one group. */
18
+ /**
19
+ * The sections-state id of one space. Spaces start collapsed: the id in the
20
+ * set means the space is open (unlike Pinned and Sessions, where it means closed).
21
+ */
19
22
  export declare function sessionGroupSectionId(groupId: string): string;
20
23
  /** `onDragStart` of a session row: the row's link drag also carries the session id. */
21
24
  export declare function startSessionDrag(event: DragEvent, sessionId: string): void;
@@ -27,17 +30,6 @@ export declare function useSessionGroupActions(projectId: string, groups: readon
27
30
  }) => Promise<void>;
28
31
  reorder: (groupIds: string[] | null) => Promise<void>;
29
32
  };
30
- /**
31
- * Rename a group (a new group is named in place, `NewSessionGroupRow`). A
32
- * taken name shows in the dialog; the dialog closes with a toast once the
33
- * list holds the change.
34
- */
35
- export declare function SessionGroupNameModal({ projectId, group, open, onOpenChange, }: {
36
- projectId: string;
37
- group: ProjectSessionGroup | null;
38
- open: boolean;
39
- onOpenChange: (open: boolean) => void;
40
- }): import("react").JSX.Element;
41
33
  /** `base`, or `base 2`, `base 3`…: the first name no group of the project has (names are unique per project). */
42
34
  export declare function nextSessionGroupName(groups: readonly ProjectSessionGroup[], base: string): string;
43
35
  /**
@@ -51,6 +43,14 @@ export declare function NewSessionGroupRow({ projectId, defaultName, onDone, }:
51
43
  defaultName: string;
52
44
  onDone: (group: ProjectSessionGroup | null) => void;
53
45
  }): import("react").JSX.Element;
46
+ /**
47
+ * The Spaces heading over the spaces: its label opens the Spaces page, its "+"
48
+ * (on hover) names a new space in place, like the Sessions header's controls.
49
+ */
50
+ export declare function SpacesHeading({ projectId, onNew }: {
51
+ projectId: string;
52
+ onNew: () => void;
53
+ }): import("react").JSX.Element;
54
54
  interface SessionGroupSectionsProps {
55
55
  projectId: string;
56
56
  groups: readonly ProjectSessionGroup[];