@kortix/ui 0.16.0 → 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.
- package/dist/_vendor/kortix-shared.js +157 -51
- package/dist/_vendor/shared/index.d.ts +1 -0
- package/dist/_vendor/shared/space-icon.d.ts +30 -0
- package/dist/_vendor/shared/space-slug.d.ts +12 -0
- package/dist/access/access/access-dialog.js +2 -2
- package/dist/access/share-dialog.d.ts +77 -0
- package/dist/access/share-dialog.js +160 -0
- package/dist/access/sharing-picker.d.ts +8 -1
- package/dist/access/sharing-picker.js +2 -2
- package/dist/changes/change-list.js +3 -3
- package/dist/customize/connectors/catalog/catalog-paging.d.ts +1 -1
- package/dist/customize/connectors/catalog/catalog-paging.js +1 -1
- package/dist/customize/providers/provider-sheet.js +17 -7
- package/dist/customize/sections/component/manifest-copy-block.js +1 -1
- package/dist/customize/sections/component/section-wrapper.d.ts +1 -8
- package/dist/customize/sections/component/section-wrapper.js +3 -3
- package/dist/customize/sections/llm-provider/model-capability-icons.js +1 -1
- package/dist/customize/sections/view/gateway/generation-controls.js +1 -1
- package/dist/customize/sections/view/git-view.js +1 -1
- package/dist/customize/settings/settings-tabs.js +0 -5
- package/dist/customize/settings/tabs/general-tab.js +2 -2
- package/dist/customize/shared/capability-page-shell.d.ts +2 -2
- package/dist/customize/shared/capability-page-shell.js +7 -5
- package/dist/customize/shared/capability-scroll-root.js +1 -2
- package/dist/customize/shared/catalog/catalog-card.js +1 -1
- package/dist/files/project/components/change-requests-panel.js +2 -2
- package/dist/files/project/components/checkpoint-detail-dialog.js +4 -4
- package/dist/files/project/components/checkpoints-panel.js +2 -2
- package/dist/files/project/components/drive-explorer.js +2 -2
- package/dist/files/project/components/file-breadcrumbs.js +1 -1
- package/dist/files/project/components/file-history-popover.js +2 -2
- package/dist/files/project/components/file-thumbnail.js +1 -1
- package/dist/files/project/components/open-change-request-dialog.js +1 -1
- package/dist/files/renderers/mermaid/mermaid-diagram.js +2 -2
- package/dist/files/renderers/show-content-renderer.js +6 -6
- package/dist/files/renderers/sqlite-renderer.js +8 -8
- package/dist/files/renderers/zip/zip-renderer.js +2 -2
- package/dist/files/viewer/file-content-renderer.js +5 -5
- package/dist/files/viewer/json-tree-view.js +3 -3
- package/dist/i18n/en.d.ts +133 -8
- package/dist/i18n/en.js +170 -45
- package/dist/i18n/ui-catalog/remaining-ui-translation-keys.generated.js +0 -3
- package/dist/internal/billing/use-cost-explorer.d.ts +9 -2
- package/dist/internal/billing/use-cost-explorer.js +22 -0
- package/dist/internal/billing/use-session-costs.d.ts +7 -2
- package/dist/internal/billing/use-session-costs.js +6 -0
- package/dist/internal/chrome/use-chrome-offered.d.ts +3 -3
- package/dist/internal/chrome/use-chrome-offered.js +3 -3
- package/dist/internal/components/nav-rail.d.ts +1 -20
- package/dist/internal/components/nav-rail.js +1 -15
- package/dist/internal/layout/project-page-header.d.ts +13 -9
- package/dist/internal/layout/project-page-header.js +14 -10
- package/dist/internal/lib/browser-noise/evidence.d.ts +2 -0
- package/dist/internal/lib/browser-noise/rules/injected-scripts.js +16 -1
- package/dist/internal/lib/error-handler.js +0 -9
- package/dist/internal/lib/interface-theme-defaults.js +2 -2
- package/dist/internal/lib/project-actions.d.ts +4 -5
- package/dist/internal/lib/project-actions.js +3 -5
- package/dist/internal/lib/project-preamble.d.ts +42 -4
- package/dist/internal/lib/project-preamble.js +49 -5
- package/dist/internal/lib/web-notifications.js +17 -29
- package/dist/internal/outcomes/outcome-vocabulary.js +1 -1
- package/dist/internal/stores/session-filter-store.d.ts +1 -1
- package/dist/internal/stores/user-preferences-store.d.ts +2 -2
- package/dist/internal/stores/workspace-settings-rail-store.d.ts +0 -8
- package/dist/internal/stores/workspace-settings-rail-store.js +0 -2
- package/dist/lib/routes.d.ts +7 -0
- package/dist/lib/routes.js +6 -1
- package/dist/markdown/doc-editor/doc-extensions.js +2 -0
- package/dist/markdown/doc-editor/doc-paste.d.ts +13 -0
- package/dist/markdown/doc-editor/doc-paste.js +67 -0
- package/dist/markdown/markdown-frontmatter.js +3 -3
- package/dist/markdown/markdown-policy.d.ts +1 -1
- package/dist/markdown/ordered-list.js +1 -1
- package/dist/primitives/context-menu.d.ts +1 -0
- package/dist/primitives/definition-list.js +1 -1
- package/dist/primitives/dropdown-menu.d.ts +1 -0
- package/dist/primitives/emoji-picker.js +1 -1
- package/dist/primitives/expandable-search.d.ts +57 -0
- package/dist/primitives/expandable-search.js +58 -0
- package/dist/primitives/favicon-avatar.js +1 -1
- package/dist/primitives/file-tree.d.ts +1 -1
- package/dist/primitives/file-tree.js +1 -1
- package/dist/primitives/glyph-picker.js +2 -2
- package/dist/primitives/input-group.js +1 -1
- package/dist/primitives/menu-base.d.ts +10 -0
- package/dist/primitives/menu-base.js +7 -2
- package/dist/primitives/phone-input.js +1 -1
- package/dist/primitives/profile-hover-card.d.ts +28 -0
- package/dist/primitives/profile-hover-card.js +22 -0
- package/dist/primitives/settings-section-header.d.ts +5 -5
- package/dist/primitives/settings-section-header.js +5 -5
- package/dist/primitives/sort-menu.d.ts +23 -0
- package/dist/primitives/sort-menu.js +54 -0
- package/dist/primitives/tabs.js +1 -1
- package/dist/primitives/toast-clearance.d.ts +12 -28
- package/dist/primitives/toast-clearance.js +23 -45
- package/dist/primitives/user-avatar.js +2 -3
- package/dist/session/agents/subagent-dialog-content.js +28 -70
- package/dist/session/composer/ComposerCard.d.ts +4 -1
- package/dist/session/composer/ComposerCard.js +51 -7
- package/dist/session/composer/composer-chat-input.js +3 -1
- package/dist/session/composer/composer-toolbar.d.ts +3 -1
- package/dist/session/composer/composer-toolbar.js +6 -2
- package/dist/session/composer/composer-underbar.d.ts +3 -1
- package/dist/session/composer/composer-underbar.js +2 -2
- package/dist/session/composer/composer.d.ts +12 -0
- package/dist/session/composer/composer.js +112 -6
- package/dist/session/composer/draft/composer-draft.d.ts +1 -0
- package/dist/session/composer/draft/composer-draft.js +10 -2
- package/dist/session/composer/draft/draft-uploads.js +13 -2
- package/dist/session/composer/draft/use-composer-draft.d.ts +2 -0
- package/dist/session/composer/draft/use-composer-draft.js +41 -6
- package/dist/session/composer/drive-mentions.d.ts +34 -0
- package/dist/session/composer/drive-mentions.js +98 -0
- package/dist/session/composer/editor/composer-editor.d.ts +3 -0
- package/dist/session/composer/editor/composer-editor.js +3 -1
- package/dist/session/composer/editor/serialize.js +3 -4
- package/dist/session/composer/menus/mention-controller.d.ts +3 -0
- package/dist/session/composer/menus/mention-controller.js +5 -0
- package/dist/session/composer/menus/mention-menu.d.ts +20 -3
- package/dist/session/composer/menus/mention-menu.js +33 -6
- package/dist/session/composer/menus/menu-items.d.ts +16 -1
- package/dist/session/composer/menus/menu-items.js +21 -1
- package/dist/session/composer/submit-latch.d.ts +3 -1
- package/dist/session/composer/submit-latch.js +5 -1
- package/dist/session/composer/types.d.ts +9 -2
- package/dist/session/header/session-changes-indicator.js +1 -1
- package/dist/session/header/session-site-header.js +2 -2
- package/dist/session/media/sandbox-url-detector.js +3 -3
- package/dist/session/models/model-connection-gate.d.ts +5 -0
- package/dist/session/models/model-connection-gate.js +12 -3
- package/dist/session/models/model-connection-layout.d.ts +7 -0
- package/dist/session/models/model-connection-layout.js +7 -0
- package/dist/session/models/provider-failure-recovery.js +1 -1
- package/dist/session/models/subscription-offer.d.ts +6 -5
- package/dist/session/models/subscription-offer.js +6 -6
- package/dist/session/panel/advanced/advanced-panel.js +1 -1
- package/dist/session/panel/session-detail-panel.js +1 -1
- package/dist/session/panel/session-diff-viewer.js +1 -1
- package/dist/session/panel/session-files-explorer.js +1 -1
- package/dist/session/panel/session-files-panel.js +3 -3
- package/dist/session/panel/shared/action-navigator.js +1 -1
- package/dist/session/status/provisioning-failure.d.ts +4 -4
- package/dist/session/status/provisioning-failure.js +4 -4
- package/dist/session/status/session-busy-indicator.js +1 -1
- package/dist/session/status/session-error-banner.js +6 -1
- package/dist/session/thread/mention-chip.d.ts +1 -1
- package/dist/session/thread/mention-segments.d.ts +4 -2
- package/dist/session/thread/mention-segments.js +28 -1
- package/dist/session/thread/message-parsing.d.ts +11 -0
- package/dist/session/thread/message-parsing.js +22 -3
- package/dist/session/thread/optimistic-turn.d.ts +4 -2
- package/dist/session/thread/optimistic-turn.js +13 -11
- package/dist/session/thread/session-chat.js +6 -1
- package/dist/session/thread/session-context-message-explorer.js +1 -1
- package/dist/session/thread/session-older-autoload.d.ts +2 -3
- package/dist/session/thread/session-older-autoload.js +2 -3
- package/dist/session/thread/transcript.js +8 -10
- package/dist/session/tool/shared/error-and-connector.js +1 -1
- package/dist/session/tool/shared/file-list.js +2 -2
- package/dist/session/tool/shared/infrastructure-parts.js +1 -1
- package/dist/session/tool/shared/infrastructure-preview.js +1 -1
- package/dist/session/tool/shared/infrastructure-row-header.js +3 -3
- package/dist/session/tool/shared/infrastructure-rows.js +2 -2
- package/dist/session/tool/shared/output-block.js +4 -4
- package/dist/session/tool/shared/session-helpers.js +3 -3
- package/dist/session/tool/shared/structured-output.js +3 -3
- package/dist/session/tool/shared/todo-helpers.js +1 -1
- package/dist/session/tool/tool-error.js +2 -2
- package/dist/session/tool/tools/agent-spawn-tool.js +3 -3
- package/dist/session/tool/tools/agent-status-tool.js +1 -1
- package/dist/session/tool/tools/apply-patch-tool.js +1 -1
- package/dist/session/tool/tools/connector-get-tool.js +1 -1
- package/dist/session/tool/tools/connector-list-tool.js +1 -1
- package/dist/session/tool/tools/connector-tools.js +1 -1
- package/dist/session/tool/tools/edit-tool.js +1 -1
- package/dist/session/tool/tools/get-mem-tool.js +1 -1
- package/dist/session/tool/tools/glob-tool.js +1 -1
- package/dist/session/tool/tools/image-search-tool.js +1 -1
- package/dist/session/tool/tools/memory-search-tool.js +1 -1
- package/dist/session/tool/tools/memory-tool.js +4 -4
- package/dist/session/tool/tools/presentation-gen-tool.js +2 -2
- package/dist/session/tool/tools/project-delete-tool.js +1 -1
- package/dist/session/tool/tools/project-list-tool.js +1 -1
- package/dist/session/tool/tools/pty-read-tool.js +1 -1
- package/dist/session/tool/tools/pty-spawn-tool.js +1 -1
- package/dist/session/tool/tools/pty-write-tool.js +1 -1
- package/dist/session/tool/tools/read-tool.js +1 -1
- package/dist/session/tool/tools/removed-connector-tool.js +1 -1
- package/dist/session/tool/tools/scrape-webpage-tool.js +1 -1
- package/dist/session/tool/tools/session-get-tool.js +3 -3
- package/dist/session/tool/tools/session-list-background-tool.js +1 -1
- package/dist/session/tool/tools/session-read-tool.js +1 -1
- package/dist/session/tool/tools/session-search-tool.js +1 -1
- package/dist/session/tool/tools/session-spawn-tool.js +1 -1
- package/dist/session/tool/tools/skill-tool.js +1 -1
- package/dist/session/tool/tools/todo-write-tool.js +1 -1
- package/dist/session/tool/tools/web-fetch-tool.js +1 -1
- package/dist/session/tool/tools/write-tool.js +1 -1
- package/dist/session/turn/activity-file-chips.js +7 -3
- package/dist/session/turn/activity-step.js +1 -1
- package/dist/session/turn/burst-summary-trigger.js +3 -3
- package/dist/session/turn/chain-step-trigger.js +1 -1
- package/dist/session/turn/plan-card.js +1 -1
- package/dist/session/turn/thought-chain-step.js +1 -1
- package/dist/session/turn/turn-work-accordion.js +1 -1
- package/dist/session/turn/user-message.js +13 -6
- package/dist/session/voice/use-call-card-position.d.ts +30 -0
- package/dist/session/voice/use-call-card-position.js +126 -0
- package/dist/session/voice/voice-call-card.js +10 -3
- package/dist/styles/theme.css +12 -0
- package/dist/styles/tokens.css +12 -6
- package/dist/styles.css +1 -1
- package/dist/terminal/session-terminal-panel.js +1 -1
- package/dist/test-utils/intl.d.ts +133 -8
- package/dist/workspace/admin/project-admin-dashboard.js +7 -24
- package/dist/workspace/calendar/calendar-page.js +1 -1
- package/dist/workspace/home/first-chat.d.ts +4 -3
- package/dist/workspace/home/first-chat.js +6 -6
- package/dist/workspace/home/welcome-body.js +2 -2
- package/dist/workspace/index.d.ts +1 -1
- package/dist/workspace/index.js +1 -1
- package/dist/workspace/layout/project-home.js +11 -4
- package/dist/workspace/layout/use-project-home-send.d.ts +3 -1
- package/dist/workspace/layout/use-project-home-send.js +6 -2
- package/dist/workspace/memory/company-memory-page.js +2 -4
- package/dist/workspace/new/github-source.js +0 -1
- package/dist/workspace/new/new-workspace-form.d.ts +0 -1
- package/dist/workspace/new/new-workspace-form.js +0 -3
- package/dist/workspace/new/use-create-workspace.d.ts +1 -1
- package/dist/workspace/new/use-create-workspace.js +1 -2
- package/dist/workspace/session-spaces/space-detail-page.d.ts +35 -0
- package/dist/workspace/session-spaces/space-detail-page.js +307 -0
- package/dist/workspace/session-spaces/space-form-modal.d.ts +16 -0
- package/dist/workspace/session-spaces/space-form-modal.js +92 -0
- package/dist/workspace/session-spaces/space-icon.d.ts +36 -0
- package/dist/workspace/session-spaces/space-icon.js +52 -0
- package/dist/workspace/session-spaces/space-people.d.ts +51 -0
- package/dist/workspace/session-spaces/space-people.js +91 -0
- package/dist/workspace/session-spaces/space-picker.d.ts +11 -0
- package/dist/workspace/session-spaces/space-picker.js +42 -0
- package/dist/workspace/session-spaces/space-share-modal.d.ts +14 -0
- package/dist/workspace/session-spaces/space-share-modal.js +93 -0
- package/dist/workspace/session-spaces/spaces-page.d.ts +8 -0
- package/dist/workspace/session-spaces/spaces-page.js +125 -0
- package/dist/workspace/sessions/session-owner-filters.d.ts +2 -0
- package/dist/workspace/sessions/session-owner-filters.js +2 -0
- package/dist/workspace/setup/setup-banner.d.ts +4 -0
- package/dist/workspace/setup/setup-banner.js +57 -0
- package/dist/workspace/setup/setup-steps.d.ts +14 -0
- package/dist/workspace/setup/setup-steps.js +15 -0
- package/dist/workspace/setup/use-setup-steps.d.ts +18 -0
- package/dist/workspace/setup/use-setup-steps.js +57 -0
- package/dist/workspace/setup/workspace-setup-page.js +8 -41
- package/dist/workspace/sidebar/footer/project-artifacts-nav.js +1 -1
- package/dist/workspace/sidebar/footer/project-promo-cards.d.ts +7 -2
- package/dist/workspace/sidebar/footer/project-promo-cards.js +4 -3
- package/dist/workspace/sidebar/footer/project-sandbox-alert.js +1 -1
- package/dist/workspace/sidebar/footer/promo-card.d.ts +10 -1
- package/dist/workspace/sidebar/footer/promo-card.js +31 -2
- package/dist/workspace/sidebar/footer/sandbox-health.js +1 -1
- package/dist/workspace/sidebar/modal/session-people-picker.d.ts +13 -0
- package/dist/workspace/sidebar/modal/session-people-picker.js +72 -0
- package/dist/workspace/sidebar/modal/share-session-modal.js +2 -1
- package/dist/workspace/sidebar/project-nav-items.d.ts +1 -3
- package/dist/workspace/sidebar/project-nav-items.js +3 -8
- package/dist/workspace/sidebar/project-session-list.js +19 -12
- package/dist/workspace/sidebar/project-sidebar.js +13 -13
- package/dist/workspace/sidebar/project-spaces-nav.js +1 -2
- package/dist/workspace/sidebar/session-filter-menu.js +19 -13
- package/dist/workspace/sidebar/session-group-sections.d.ts +12 -12
- package/dist/workspace/sidebar/session-group-sections.js +56 -75
- package/dist/workspace/sidebar/sidebar-more-group.js +1 -1
- package/dist/workspace/sidebar/workspace-settings-sidebar-nav.js +2 -2
- package/dist/workspace/spaces/space-tabs.d.ts +26 -6
- package/dist/workspace/spaces/space-tabs.js +19 -8
- package/package.json +27 -31
- package/skills/kortix-ui/references/modules.md +2 -2
- package/dist/workspace/new/clone-param.d.ts +0 -11
- package/dist/workspace/new/clone-param.js +0 -15
- package/dist/workspace/new/provision-new-workspace.d.ts +0 -14
- package/dist/workspace/new/provision-new-workspace.js +0 -14
- package/dist/workspace/sidebar/footer/project-inbox-nav.d.ts +0 -8
- package/dist/workspace/sidebar/footer/project-inbox-nav.js +0 -29
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { CheckCircleIcon, KeyIcon } from '@phosphor-icons/react';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { getSlackMode } from '@kortix/sdk';
|
|
5
|
+
import { useProjectAccountId } from '@kortix/sdk/react';
|
|
6
6
|
import { useQuery } from '@tanstack/react-query';
|
|
7
7
|
import { useState } from 'react';
|
|
8
8
|
import { connectorHref } from '../../customize/connectors/connector-routes.js';
|
|
9
9
|
import { SetCredentialModal } from '../../customize/sections/connectors-view.js';
|
|
10
|
-
import {
|
|
10
|
+
import { ProjectSecretDialog } from '../../customize/sections/view/secrets-view.js';
|
|
11
11
|
import { CapabilityPageShell } from '../../customize/shared/capability-page-shell.js';
|
|
12
12
|
import { useTranslations } from '../../i18n/index.js';
|
|
13
13
|
import { ConnectorLogo } from '../../internal/connector-logo/connector-logo.js';
|
|
@@ -23,7 +23,7 @@ import { EmptyArt } from '../../primitives/empty-art.js';
|
|
|
23
23
|
import { ErrorState } from '../../primitives/error-state.js';
|
|
24
24
|
import { Skeleton } from '../../primitives/skeleton.js';
|
|
25
25
|
import { UiLink as Link, useUiSearchParams } from '../../providers/ui-provider.js';
|
|
26
|
-
import {
|
|
26
|
+
import { useSetupSteps } from './use-setup-steps.js';
|
|
27
27
|
/** While a step is open, read it again this often: the person may finish it in another tab. */
|
|
28
28
|
const OPEN_STEP_POLL_MS = 5_000;
|
|
29
29
|
/**
|
|
@@ -39,51 +39,18 @@ export function WorkspaceSetupPage({ projectId }) {
|
|
|
39
39
|
const accountId = useProjectAccountId(projectId);
|
|
40
40
|
const canConnect = useProjectCan(projectId, PROJECT_ACTIONS.PROJECT_CONNECTOR_WRITE, { accountId }).allowed === true;
|
|
41
41
|
const canSetSecrets = useProjectCan(projectId, PROJECT_ACTIONS.PROJECT_SECRET_WRITE).allowed === true;
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
...contract(FRESHNESS.connectors),
|
|
46
|
-
});
|
|
47
|
-
const secretsQuery = useQuery({
|
|
48
|
-
queryKey: qk.project.secrets(projectId),
|
|
49
|
-
queryFn: () => listProjectSecrets(projectId),
|
|
50
|
-
...contract('config'),
|
|
51
|
-
refetchOnWindowFocus: true,
|
|
52
|
-
refetchInterval: OPEN_STEP_POLL_MS,
|
|
53
|
-
});
|
|
54
|
-
const connectors = connectorsQuery.data?.connectors ?? [];
|
|
55
|
-
const usesSlack = slackNeeded(connectors, params.get('slack') === '1');
|
|
56
|
-
// The same cache entries as the Channels page (`useSlackInstall`, `useSlackMode`).
|
|
57
|
-
const slackInstallQuery = useQuery({
|
|
58
|
-
queryKey: ['channels', 'slack-install', projectId],
|
|
59
|
-
queryFn: () => getSlackInstallation(projectId),
|
|
60
|
-
enabled: usesSlack,
|
|
61
|
-
refetchOnWindowFocus: true,
|
|
62
|
-
refetchInterval: (query) => (query.state.data ? false : OPEN_STEP_POLL_MS),
|
|
42
|
+
const { steps, usesSlack, loading, failed, refresh } = useSetupSteps(projectId, {
|
|
43
|
+
slackRequested: params.get('slack') === '1',
|
|
44
|
+
pollMs: OPEN_STEP_POLL_MS,
|
|
63
45
|
});
|
|
46
|
+
// The same cache entry as the Channels page (`useSlackMode`).
|
|
64
47
|
const slackModeQuery = useQuery({
|
|
65
48
|
queryKey: ['channels', 'slack-mode', projectId],
|
|
66
49
|
queryFn: () => getSlackMode(projectId),
|
|
67
50
|
enabled: usesSlack,
|
|
68
51
|
staleTime: 60_000,
|
|
69
52
|
});
|
|
70
|
-
const loading = connectorsQuery.isLoading || secretsQuery.isLoading || (usesSlack && slackInstallQuery.isLoading);
|
|
71
|
-
const failed = connectorsQuery.isError || secretsQuery.isError;
|
|
72
|
-
const steps = loading || failed
|
|
73
|
-
? []
|
|
74
|
-
: setupSteps({
|
|
75
|
-
connectors,
|
|
76
|
-
secrets: buildRows(secretsQuery.data),
|
|
77
|
-
slack: { needed: usesSlack, installed: Boolean(slackInstallQuery.data) },
|
|
78
|
-
slackName: t('slackName'),
|
|
79
|
-
});
|
|
80
53
|
const done = steps.filter((step) => step.done).length;
|
|
81
|
-
const refresh = () => {
|
|
82
|
-
void connectorsQuery.refetch();
|
|
83
|
-
void secretsQuery.refetch();
|
|
84
|
-
if (usesSlack)
|
|
85
|
-
void slackInstallQuery.refetch();
|
|
86
|
-
};
|
|
87
54
|
const workspaceLink = (_jsx(Button, { asChild: true, variant: "outline", size: "sm", children: _jsx(Link, { href: `/workspaces/${projectId}`, children: t('openWorkspace') }) }));
|
|
88
55
|
return (_jsx(CapabilityPageShell, { title: t('title'), description: loading || failed || steps.length === 0 ? t('descriptionIdle') : t('description', { done, total: steps.length }), children: loading ? (_jsx("ul", { className: "space-y-2", "aria-busy": "true", children: [0, 1, 2].map((index) => (_jsx("li", { children: _jsx(Skeleton, { className: "h-14 rounded-md" }) }, index))) })) : failed ? (_jsx(ErrorState, { size: "sm", title: t('loadFailed'), action: _jsx(Button, { variant: "outline", size: "sm", onClick: refresh, children: t('tryAgain') }) })) : steps.length === 0 ? (_jsx(EmptyState, { media: _jsx(EmptyArt, { icon: CheckCircleIcon }), title: t('emptyTitle'), description: t('emptyDescription'), action: workspaceLink })) : (_jsxs("div", { className: "space-y-4", children: [done === steps.length ? (_jsxs(Alert, { variant: "success", children: [_jsx(AlertTitle, { children: t('completeTitle') }), _jsx(AlertDescription, { children: t('completeDescription') })] })) : null, _jsx("ul", { className: "space-y-2", children: steps.map((step) => (_jsx(StepRow, { projectId: projectId, step: step, canConnect: canConnect, canSetSecrets: canSetSecrets, slackInstallUrl: slackModeQuery.data?.oauth_available ? slackModeQuery.data.install_url : null, onChanged: refresh }, step.id))) }), done === steps.length ? _jsx("div", { children: workspaceLink }) : null] })) }));
|
|
89
56
|
}
|
|
@@ -56,7 +56,7 @@ export function ProjectArtifactsNavItem({ projectId }) {
|
|
|
56
56
|
card.setOpen(next);
|
|
57
57
|
if (!next)
|
|
58
58
|
setQuery('');
|
|
59
|
-
}, children: [_jsx(PopoverAnchor, { virtualRef: card.anchorRef }), _jsxs(ProjectNavRow, { active: pathname?.startsWith(href) === true, label: t('artifacts'), href: href, prefetch: true, ...card.rowProps, children: [_jsx("span", { className: "shrink-0", children: _jsx(CardsThreeIcon, {}) }), t('artifacts')] }), _jsxs(NavHoverCardContent, { ...card.contentProps, children: [showSearch ? (_jsx("div", { className: "border-border border-b p-1", children: _jsxs(InputGroupSearch, { children: [_jsx(InputGroupSearchIcon, { children: _jsx(MagnifyingGlassIcon, {}) }), _jsx(InputGroupSearchInput, { ref: searchRef, variant: "popover", size: "xs", value: query, onChange: (event) => setQuery(event.target.value), placeholder: t('searchArtifacts'), "aria-label": t('searchArtifacts') })] }) })) : null, _jsxs(NavHoverCardList, { className: "max-h-80 overflow-x-hidden overflow-y-auto overscroll-contain", children: [shown.map((artifact) => (_jsx("li", { children: _jsx(ArtifactRow, { artifact: artifact, href: `${href}/${encodeURIComponent(artifact.artifact_id)}`, onOpen: close }) }, artifact.artifact_id))), shown.length === 0 ? (_jsx("li", { className: menuRow('sm', 'default', 'text-muted-foreground pointer-events-none'), children: t('appsNoMatches') })) : null] })] })] }));
|
|
59
|
+
}, children: [_jsx(PopoverAnchor, { virtualRef: card.anchorRef }), _jsxs(ProjectNavRow, { active: pathname?.startsWith(href) === true, label: t('artifacts'), href: href, prefetch: true, ...card.rowProps, children: [_jsx("span", { className: "shrink-0", children: _jsx(CardsThreeIcon, {}) }), t('artifacts')] }), _jsxs(NavHoverCardContent, { ...card.contentProps, className: "w-80", children: [showSearch ? (_jsx("div", { className: "border-border border-b p-1", children: _jsxs(InputGroupSearch, { children: [_jsx(InputGroupSearchIcon, { children: _jsx(MagnifyingGlassIcon, {}) }), _jsx(InputGroupSearchInput, { ref: searchRef, variant: "popover", size: "xs", value: query, onChange: (event) => setQuery(event.target.value), placeholder: t('searchArtifacts'), "aria-label": t('searchArtifacts') })] }) })) : null, _jsxs(NavHoverCardList, { className: "max-h-80 overflow-x-hidden overflow-y-auto overscroll-contain", children: [shown.map((artifact) => (_jsx("li", { children: _jsx(ArtifactRow, { artifact: artifact, href: `${href}/${encodeURIComponent(artifact.artifact_id)}`, onOpen: close }) }, artifact.artifact_id))), shown.length === 0 ? (_jsx("li", { className: menuRow('sm', 'default', 'text-muted-foreground pointer-events-none'), children: t('appsNoMatches') })) : null] })] })] }));
|
|
60
60
|
}
|
|
61
61
|
/** One artifact: its type glyph and its title. */
|
|
62
62
|
/** The desktop tab strip is mounted (apps/web/src/features/desktop-tabs/desktop-tabs-gate.tsx). */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* The
|
|
3
|
+
* The workspace's one promo card: in the sidebar on a phone, floating in the
|
|
4
|
+
* window's bottom-right corner on desktop. Every way to reach Kortix from somewhere else
|
|
4
5
|
* is a slide, in this order: the chat apps people already use (MCP), their
|
|
5
6
|
* own computer, Chrome, the desktop app, the phone app. Each slide is
|
|
6
7
|
* dismissed on its own and leaves once it is done (a paired computer, a
|
|
@@ -10,8 +11,12 @@ import type { ReactNode } from 'react';
|
|
|
10
11
|
* The computer and Chrome slides read a list from the API, so they mount only
|
|
11
12
|
* while they are not dismissed (`ComputerPromoSlide`, `ChromePromoSlide`).
|
|
12
13
|
*/
|
|
13
|
-
export declare function ProjectPromoCards({ projectId, onOpenMcp, onOpenComputer, onOpenChrome, onOpenDownloadApp, }: {
|
|
14
|
+
export declare function ProjectPromoCards({ projectId, onOpenMcp, onOpenComputer, onOpenChrome, onOpenDownloadApp, variant, composer, }: {
|
|
14
15
|
projectId: string;
|
|
16
|
+
/** `floating` pins the card to the window's bottom-right corner (desktop). */
|
|
17
|
+
variant?: 'inline' | 'floating';
|
|
18
|
+
/** Floating only: the page's bottom composer (see `PromoSwitcher`). */
|
|
19
|
+
composer?: 'centered' | 'full';
|
|
15
20
|
onOpenMcp: () => void;
|
|
16
21
|
onOpenComputer: () => void;
|
|
17
22
|
/** Absent when Kortix in Chrome is off for this workspace. */
|
|
@@ -8,7 +8,8 @@ import { usePhoneAppPromo } from './project-phone-app-nav.js';
|
|
|
8
8
|
import { PromoSwitcher } from './promo-card.js';
|
|
9
9
|
import { useTranslations } from '../../../i18n/index.js';
|
|
10
10
|
/**
|
|
11
|
-
* The
|
|
11
|
+
* The workspace's one promo card: in the sidebar on a phone, floating in the
|
|
12
|
+
* window's bottom-right corner on desktop. Every way to reach Kortix from somewhere else
|
|
12
13
|
* is a slide, in this order: the chat apps people already use (MCP), their
|
|
13
14
|
* own computer, Chrome, the desktop app, the phone app. Each slide is
|
|
14
15
|
* dismissed on its own and leaves once it is done (a paired computer, a
|
|
@@ -18,14 +19,14 @@ import { useTranslations } from '../../../i18n/index.js';
|
|
|
18
19
|
* The computer and Chrome slides read a list from the API, so they mount only
|
|
19
20
|
* while they are not dismissed (`ComputerPromoSlide`, `ChromePromoSlide`).
|
|
20
21
|
*/
|
|
21
|
-
export function ProjectPromoCards({ projectId, onOpenMcp, onOpenComputer, onOpenChrome, onOpenDownloadApp, }) {
|
|
22
|
+
export function ProjectPromoCards({ projectId, onOpenMcp, onOpenComputer, onOpenChrome, onOpenDownloadApp, variant = 'inline', composer, }) {
|
|
22
23
|
const t = useTranslations('sidebar');
|
|
23
24
|
const mcp = useMcpPromo(onOpenMcp);
|
|
24
25
|
const desktop = useDesktopAppPromo(onOpenDownloadApp);
|
|
25
26
|
const phone = usePhoneAppPromo(onOpenDownloadApp);
|
|
26
27
|
const [computerDismissed, dismissComputer] = useComputerPromoDismissed();
|
|
27
28
|
const [chromeDismissed, dismissChrome] = useChromePromoDismissed();
|
|
28
|
-
const render = (computer, chrome) => (_jsx(PromoSwitcher, { label: t('promos'), slides: [mcp, computer, chrome, desktop, phone].filter((slide) => slide !== null) }));
|
|
29
|
+
const render = (computer, chrome) => (_jsx(PromoSwitcher, { label: t('promos'), variant: variant, composer: composer, slides: [mcp, computer, chrome, desktop, phone].filter((slide) => slide !== null) }));
|
|
29
30
|
const withChrome = (computer) => !onOpenChrome || chromeDismissed ? (render(computer, null)) : (_jsx(ChromePromoSlide, { onOpenConnect: onOpenChrome, onDismiss: dismissChrome, children: (chrome) => render(computer, chrome) }));
|
|
30
31
|
if (computerDismissed)
|
|
31
32
|
return withChrome(null);
|
|
@@ -93,7 +93,7 @@ function SandboxAlertContent({ projectId, health, severity, }) {
|
|
|
93
93
|
/* Grouped by SPACE, not a hairline — the card already carries two
|
|
94
94
|
(the tray's and the trigger's). `mt-2.5` against the sentence's own
|
|
95
95
|
leading is the 2x gap that reads as a new group on its own. */
|
|
96
|
-
_jsxs("div", { className: "mt-2.5 space-y-1", children: [_jsxs("p", { className: "text-xs leading-5", children: [_jsx("span", { className: cn('font-medium', CATEGORY_TEXT[tone]), children: CATEGORY_LABEL[failure.error_category ?? 'unknown'] ?? failure.error_category }), failedAt ? (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": true, className: "text-muted-foreground
|
|
96
|
+
_jsxs("div", { className: "mt-2.5 space-y-1", children: [_jsxs("p", { className: "text-xs leading-5", children: [_jsx("span", { className: cn('font-medium', CATEGORY_TEXT[tone]), children: CATEGORY_LABEL[failure.error_category ?? 'unknown'] ?? failure.error_category }), failedAt ? (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": true, className: "text-muted-foreground", children: ' · ' }), _jsx("span", { className: "text-muted-foreground tabular-nums", children: failedAt })] })) : null] }), _jsx(SidebarAlertText, { children: CATEGORY_CAUSE[failure.error_category ?? 'unknown'] ?? CATEGORY_CAUSE_FALLBACK })] }))] }), hasTray ? (_jsxs(SidebarAlertActions, { children: [recovery?.fix && (_jsxs(Button, { size: "sm", className: ACTION_BUTTON, disabled: fixWithAgent.isPending, onClick: () => fixWithAgent.mutate(), children: [fixWithAgent.isPending ? (_jsx(Loading, { className: "size-3.5 shrink-0" })) : (_jsx(SparklesSolid, { weight: "fill", className: "size-3.5 shrink-0" })), _jsx("span", { className: "truncate", children: tI18nHardcoded.raw('autoFeaturesCoWorkerProjectSidebarFooterProjectSandboxAlertJsxe7d8ac75') })] })), _jsxs("div", { className: "flex flex-col gap-1.5 @2xs/alert:flex-row", children: [recovery ? (_jsxs(Button, { size: "sm", variant: recovery.retryVariant, className: ACTION_BUTTON, disabled: retry.isPending, onClick: () => retry.mutate(failure?.template_slug), children: [retry.isPending ? (_jsx(Loading, { className: "size-3.5 shrink-0" })) : (_jsx(RefreshCw, { className: "size-3.5 shrink-0" })), _jsx("span", { className: "truncate", children: tI18nHardcoded.raw('autoFeaturesCoWorkerProjectSidebarFooterProjectSandboxAlertJsx8794c0a3') })] })) : null, detailsButton] })] })) : null] }));
|
|
97
97
|
}
|
|
98
98
|
export function ProjectSandboxAlert({ projectId }) {
|
|
99
99
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -27,9 +27,18 @@ export interface PromoSlide {
|
|
|
27
27
|
* In flow, so a border and no shadow (effects.md); hover is color only. On a
|
|
28
28
|
* window under 52rem tall the sentence folds away.
|
|
29
29
|
*/
|
|
30
|
-
export declare function PromoSwitcher({ slides, label }: {
|
|
30
|
+
export declare function PromoSwitcher({ slides, label, variant, composer, }: {
|
|
31
31
|
slides: readonly PromoSlide[];
|
|
32
32
|
label: string;
|
|
33
|
+
/** `floating`: a card pinned to the window's bottom-right corner, over the page. */
|
|
34
|
+
variant?: 'inline' | 'floating';
|
|
35
|
+
/**
|
|
36
|
+
* Floating only: the page's bottom composer. `centered` (home, a session):
|
|
37
|
+
* the card clears it only from a 1700px window, so below that it hides.
|
|
38
|
+
* `full` (chat, DMs, channels, Spaces): the composer runs to the window's
|
|
39
|
+
* right edge, so the card never shows.
|
|
40
|
+
*/
|
|
41
|
+
composer?: 'centered' | 'full';
|
|
33
42
|
}): import("react").JSX.Element | null;
|
|
34
43
|
/**
|
|
35
44
|
* One mark on a card's art, with no tile: white under the art's `dark` scope
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { ArrowRightIcon, XIcon } from '@phosphor-icons/react';
|
|
4
|
-
import { useId, useState } from 'react';
|
|
4
|
+
import { useId, useState, useSyncExternalStore } from 'react';
|
|
5
|
+
import { createPortal } from 'react-dom';
|
|
5
6
|
import Loading from '../../../primitives/loading.js';
|
|
6
7
|
import { BeamsStill } from '../../../primitives/paper-wallpaper-shaders.js';
|
|
7
8
|
import { cn } from '../../../internal/lib/utils.js';
|
|
@@ -19,13 +20,16 @@ import { cn } from '../../../internal/lib/utils.js';
|
|
|
19
20
|
* In flow, so a border and no shadow (effects.md); hover is color only. On a
|
|
20
21
|
* window under 52rem tall the sentence folds away.
|
|
21
22
|
*/
|
|
22
|
-
export function PromoSwitcher({ slides, label }) {
|
|
23
|
+
export function PromoSwitcher({ slides, label, variant = 'inline', composer, }) {
|
|
23
24
|
const id = useId();
|
|
24
25
|
const [activeId, setActiveId] = useState(null);
|
|
25
26
|
if (slides.length === 0)
|
|
26
27
|
return null;
|
|
27
28
|
// The chosen slide, or the first one when it was dismissed or none was chosen.
|
|
28
29
|
const active = slides.find((slide) => slide.id === activeId) ?? slides[0];
|
|
30
|
+
if (variant === 'floating') {
|
|
31
|
+
return (_jsx(FloatingPromo, { id: id, slides: slides, active: active, label: label, composer: composer, onSelect: setActiveId }));
|
|
32
|
+
}
|
|
29
33
|
return (_jsxs("li", { className: "group/promo relative list-none", role: "region", "aria-roledescription": "carousel", "aria-label": label, children: [_jsx("div", { className: "grid", children: slides.map((slide) => {
|
|
30
34
|
const current = slide.id === active.id;
|
|
31
35
|
return (_jsxs("button", { type: "button", disabled: slide.pending, "aria-busy": slide.pending || undefined, "aria-labelledby": `${id}-${slide.id}-title`, "aria-describedby": `${id}-${slide.id}-description`, inert: !current, onClick: slide.onClick, className: cn('bg-background border-border hover:bg-hover focus-visible:ring-ring col-start-1 row-start-1 flex w-full cursor-pointer flex-col overflow-hidden rounded-md border text-left transition-[background-color,opacity] duration-moderate outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-60 motion-reduce:transition-none', !current && 'pointer-events-none opacity-0'), children: [_jsxs("span", { "aria-hidden": "true", className: "dark bg-background relative isolate flex h-16 w-full shrink-0 items-center justify-center gap-4 border-b", children: [_jsx(BeamsStill, {}), _jsx("span", { className: "bg-background/50 absolute inset-0" }), slide.marks] }), _jsxs("span", { className: "flex flex-1 flex-col gap-2 p-3", children: [_jsxs("span", { className: "space-y-1", children: [_jsx("span", { id: `${id}-${slide.id}-title`, className: "text-foreground block text-sm leading-snug font-medium text-balance", children: slide.title }), _jsx("span", { id: `${id}-${slide.id}-description`, className: "text-muted-foreground block text-xs leading-relaxed text-pretty [@media(max-height:52rem)]:hidden", children: slide.description })] }), _jsxs("span", { className: "text-foreground mt-auto inline-flex items-center gap-1 text-xs font-medium", children: [slide.pending ? _jsx(Loading, { className: "size-3.5 shrink-0" }) : null, slide.cta, slide.pending ? null : _jsx(ArrowRightIcon, { className: "size-3 shrink-0" })] })] })] }, slide.id));
|
|
@@ -38,6 +42,31 @@ export function PromoSwitcher({ slides, label }) {
|
|
|
38
42
|
: 'bg-muted-foreground/40 group-hover/dot:bg-muted-foreground w-1.5') }) }, slide.id));
|
|
39
43
|
}) })) : null] }));
|
|
40
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* The promo card floating in the window's bottom-right corner, over the page:
|
|
47
|
+
* a lifted card (`bg-popover`, `smooth-shadow-ring-lg`, the shadow and its
|
|
48
|
+
* hairline in one) with the art inset in a rounded panel, the close button on
|
|
49
|
+
* the art, then the title, one sentence, the call to action and the dots.
|
|
50
|
+
* Floating, so shadow + hairline (effects.md). Portaled to `document.body` so
|
|
51
|
+
* no sidebar transform or overflow clips it.
|
|
52
|
+
*/
|
|
53
|
+
const subscribeNoop = () => () => { };
|
|
54
|
+
function FloatingPromo({ id, slides, active, label, composer, onSelect, }) {
|
|
55
|
+
// `false` on the server and while hydrating, `true` after: the portal mounts
|
|
56
|
+
// only once the page is hydrated, so both passes render the same nothing.
|
|
57
|
+
const hydrated = useSyncExternalStore(subscribeNoop, () => true, () => false);
|
|
58
|
+
if (!hydrated || composer === 'full')
|
|
59
|
+
return null;
|
|
60
|
+
return createPortal(_jsxs("div", { role: "region", "aria-roledescription": "carousel", "aria-label": label, className: cn('bg-popover text-popover-foreground smooth-shadow-ring-lg fixed right-4 bottom-4 z-40 w-80 rounded-xl p-1.5', composer === 'centered' && 'hidden min-[1700px]:block'), children: [_jsx("div", { className: "grid", children: slides.map((slide) => {
|
|
61
|
+
const current = slide.id === active.id;
|
|
62
|
+
return (_jsxs("button", { type: "button", disabled: slide.pending, "aria-busy": slide.pending || undefined, "aria-labelledby": `${id}-${slide.id}-title`, "aria-describedby": `${id}-${slide.id}-description`, inert: !current, onClick: slide.onClick, className: cn('focus-visible:ring-ring col-start-1 row-start-1 flex w-full cursor-pointer flex-col rounded-lg text-left transition-opacity duration-moderate outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-60 motion-reduce:transition-none', !current && 'pointer-events-none opacity-0'), children: [_jsxs("span", { "aria-hidden": "true", className: "dark bg-background relative isolate flex h-28 w-full shrink-0 items-center justify-center gap-5 overflow-hidden rounded-lg", children: [_jsx(BeamsStill, {}), _jsx("span", { className: "bg-background/50 absolute inset-0" }), slide.marks] }), _jsx("span", { className: "flex flex-col px-2 pt-3", children: _jsxs("span", { className: "space-y-1", children: [_jsx("span", { id: `${id}-${slide.id}-title`, className: "text-foreground block text-sm leading-snug font-medium text-balance", children: slide.title }), _jsx("span", { id: `${id}-${slide.id}-description`, className: "text-muted-foreground block text-sm leading-relaxed text-pretty", children: slide.description })] }) })] }, slide.id));
|
|
63
|
+
}) }), _jsx("button", { type: "button", onClick: active.onDismiss, "aria-label": active.dismissLabel, className: "text-foreground hover:bg-active focus-visible:ring-ring dark absolute top-3 right-3 flex size-7 items-center justify-center rounded-md transition-colors duration-fast outline-none focus-visible:ring-2", children: _jsx(XIcon, { className: "size-4" }) }), _jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2 px-2 pt-3 pb-1.5", children: [_jsxs("button", { type: "button", disabled: active.pending, onClick: active.onClick, className: "bg-secondary text-secondary-foreground hover:bg-active focus-visible:ring-ring inline-flex h-8 items-center gap-1.5 rounded-md px-3 text-sm font-medium transition-colors duration-fast outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-60", children: [active.pending ? _jsx(Loading, { className: "size-3.5 shrink-0" }) : null, active.cta, active.pending ? null : _jsx(ArrowRightIcon, { className: "size-3.5 shrink-0" })] }), slides.length > 1 ? (_jsx("div", { className: "flex items-center", children: slides.map((slide) => {
|
|
64
|
+
const current = slide.id === active.id;
|
|
65
|
+
return (_jsx("button", { type: "button", "aria-label": slide.title, "aria-current": current || undefined, onClick: () => onSelect(slide.id), className: "group/dot focus-visible:ring-ring flex size-6 cursor-pointer items-center justify-center rounded-sm outline-none focus-visible:ring-2", children: _jsx("span", { className: cn('h-1.5 rounded-full transition-colors duration-fast', current
|
|
66
|
+
? 'bg-foreground w-4'
|
|
67
|
+
: 'bg-muted-foreground/40 group-hover/dot:bg-muted-foreground w-1.5') }) }, slide.id));
|
|
68
|
+
}) })) : null] })] }), document.body);
|
|
69
|
+
}
|
|
41
70
|
/**
|
|
42
71
|
* One mark on a card's art, with no tile: white under the art's `dark` scope
|
|
43
72
|
* (`text-foreground`) unless it carries its own brand colors.
|
|
@@ -82,7 +82,7 @@ export const CATEGORY_TEXT = {
|
|
|
82
82
|
warning: 'text-kortix-orange',
|
|
83
83
|
};
|
|
84
84
|
export const CATEGORY_CAUSE = {
|
|
85
|
-
quota: '
|
|
85
|
+
quota: 'Kortix’s image storage was full. Kortix frees space on its own. Retry in a few minutes.',
|
|
86
86
|
dockerfile: 'A step in the project’s Dockerfile did not finish.',
|
|
87
87
|
git: 'The build could not read the project’s repository. Its access may have expired.',
|
|
88
88
|
tunnel: 'The sandbox could not reach Kortix while it was being built.',
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ProjectSession } from '@kortix/sdk';
|
|
2
|
+
import type { SharingSelection } from '../../../access/sharing-intent.js';
|
|
3
|
+
/**
|
|
4
|
+
* "Specific people" in the session access dialog: add people and groups
|
|
5
|
+
* (several at once) and the people with access, owner first. It edits the
|
|
6
|
+
* dialog's selection only; the dialog's Save writes it.
|
|
7
|
+
*/
|
|
8
|
+
export declare function SessionPeoplePicker({ projectId, session, value, onChange, }: {
|
|
9
|
+
projectId: string;
|
|
10
|
+
session: ProjectSession | null;
|
|
11
|
+
value: SharingSelection;
|
|
12
|
+
onChange: (next: SharingSelection) => void;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
@@ -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
|
-
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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 {
|
|
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(
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
.
|
|
417
|
-
|
|
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 && (
|
|
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(
|
|
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(
|
|
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,
|
|
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,
|
|
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(
|
|
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
|
}
|