@kortix/ui 0.16.3 → 0.16.5
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 +1 -4
- package/dist/customize/sections/view/review-center-connected.js +64 -71
- package/dist/customize/sections/view/secret-delivery.d.ts +11 -20
- package/dist/customize/sections/view/secret-delivery.js +20 -29
- package/dist/customize/sections/view/secrets-view.js +9 -24
- package/dist/customize/settings/rail-copy-context.d.ts +2 -0
- package/dist/customize/settings/rail-copy-context.js +2 -0
- package/dist/customize/settings/tabs/chrome-connections-tab.js +1 -1
- package/dist/files/renderers/show-content-renderer.js +3 -1
- package/dist/i18n/en.d.ts +130 -22
- package/dist/i18n/en.js +142 -34
- package/dist/i18n/ui-catalog/product-catalog-translation-keys.generated.js +2 -0
- package/dist/internal/auth/auth-card-shell.d.ts +24 -3
- package/dist/internal/auth/auth-card-shell.js +15 -8
- package/dist/internal/auth/auth-primitives.d.ts +15 -2
- package/dist/internal/auth/auth-primitives.js +22 -5
- package/dist/internal/chrome/chrome-connect.d.ts +3 -5
- package/dist/internal/chrome/chrome-connect.js +7 -10
- package/dist/internal/chrome/extension.d.ts +1 -8
- package/dist/internal/chrome/extension.js +1 -8
- package/dist/internal/chrome/use-chrome-offered.d.ts +6 -12
- package/dist/internal/chrome/use-chrome-offered.js +13 -15
- package/dist/internal/components/agent-mark.d.ts +2 -1
- package/dist/internal/components/agent-mark.js +14 -3
- package/dist/internal/hooks/use-review-session-summary.d.ts +1 -1
- package/dist/internal/hooks/use-review-session-summary.js +1 -1
- package/dist/internal/layout/project-nav-row.d.ts +3 -1
- package/dist/internal/layout/project-nav-row.js +2 -2
- package/dist/internal/layout/project-page-header.js +5 -4
- package/dist/internal/stores/user-preferences-store.d.ts +17 -0
- package/dist/internal/stores/user-preferences-store.js +5 -0
- package/dist/markdown/setup-links/secret-intake-form.d.ts +4 -1
- package/dist/markdown/setup-links/secret-intake-form.js +60 -16
- package/dist/markdown/setup-links/setup-link-button.js +6 -1
- package/dist/primitives/color-picker.d.ts +19 -0
- package/dist/primitives/color-picker.js +27 -0
- package/dist/primitives/faded-scroll-area.js +4 -0
- package/dist/primitives/glyph-picker.d.ts +11 -0
- package/dist/primitives/glyph-picker.js +10 -6
- package/dist/primitives/gradient-wallpaper-gl.d.ts +61 -0
- package/dist/primitives/gradient-wallpaper-gl.js +446 -0
- package/dist/primitives/gradient-wallpaper.d.ts +20 -0
- package/dist/primitives/gradient-wallpaper.js +242 -0
- package/dist/primitives/resizable.d.ts +1 -1
- package/dist/session/agents/agent-hover-card.d.ts +26 -0
- package/dist/session/agents/agent-hover-card.js +70 -0
- package/dist/session/agents/agent-strip.js +33 -7
- package/dist/session/agents/agent-surface.d.ts +26 -1
- package/dist/session/agents/agent-surface.js +57 -6
- package/dist/session/agents/held-messages.js +2 -2
- package/dist/session/agents/subagent-dialog-content.js +2 -2
- package/dist/session/composer/ComposerCard.js +4 -4
- package/dist/session/composer/composer-toolbar.d.ts +8 -1
- package/dist/session/composer/composer-toolbar.js +2 -2
- package/dist/session/composer/dictation/dictation-control.d.ts +10 -0
- package/dist/session/composer/dictation/dictation-control.js +28 -0
- package/dist/session/composer/dictation/dictation-state.d.ts +26 -0
- package/dist/session/composer/dictation/dictation-state.js +71 -0
- package/dist/session/composer/dictation/recorder.d.ts +30 -0
- package/dist/session/composer/dictation/recorder.js +129 -0
- package/dist/session/composer/dictation/use-composer-dictation.d.ts +25 -0
- package/dist/session/composer/dictation/use-composer-dictation.js +218 -0
- package/dist/session/composer/queued-prompt-list.js +5 -1
- package/dist/session/panel/easy/apps-card.js +3 -10
- package/dist/session/panel/easy/background-tasks-card.d.ts +23 -0
- package/dist/session/panel/easy/background-tasks-card.js +119 -0
- package/dist/session/panel/easy/change-requests-card.js +1 -1
- package/dist/session/panel/easy/changes-card.js +4 -6
- package/dist/session/panel/easy/context-card.js +8 -9
- package/dist/session/panel/easy/context-meter.d.ts +2 -0
- package/dist/session/panel/easy/context-meter.js +18 -4
- package/dist/session/panel/easy/detail-view.js +7 -4
- package/dist/session/panel/easy/easy-panel-logic.d.ts +4 -15
- package/dist/session/panel/easy/easy-panel-logic.js +4 -17
- package/dist/session/panel/easy/easy-panel.js +5 -4
- package/dist/session/panel/easy/outputs-card.d.ts +1 -13
- package/dist/session/panel/easy/outputs-card.js +14 -40
- package/dist/session/panel/easy/panel-card.d.ts +13 -40
- package/dist/session/panel/easy/panel-card.js +17 -55
- package/dist/session/panel/easy/plan-card.js +4 -7
- package/dist/session/panel/model-switch-event.d.ts +2 -2
- package/dist/session/panel/model-switch-event.js +13 -9
- package/dist/session/panel/session-panel-provider.d.ts +2 -1
- package/dist/session/panel/session-panel-provider.js +3 -3
- package/dist/session/panel/shared/collect-tool-parts.js +2 -2
- package/dist/session/panel/shared/derive-panels.js +14 -1
- package/dist/session/panel/shared/use-panel-handoffs.d.ts +0 -1
- package/dist/session/panel/shared/use-panel-handoffs.js +26 -17
- package/dist/session/thread/chat-minimap.js +7 -1
- package/dist/session/thread/session-body.js +1 -1
- package/dist/session/thread/session-chat.js +59 -15
- package/dist/session/tool/shared/infrastructure-contexts.d.ts +7 -0
- package/dist/session/tool/shared/infrastructure-contexts.js +9 -0
- package/dist/session/tool/shared/infrastructure-row-header.js +4 -1
- package/dist/session/tool/shared/infrastructure-rows.js +19 -19
- package/dist/session/tool/show-group-renderer.d.ts +5 -5
- package/dist/session/tool/show-group-renderer.js +7 -4
- package/dist/session/tool/tool-part-renderer.js +25 -9
- package/dist/session/tool/tool-renderers.d.ts +1 -1
- package/dist/session/tool/tool-renderers.js +1 -1
- package/dist/session/tool/tools/bash-tool.js +3 -2
- package/dist/session/tool/tools/codemode-tool.d.ts +15 -0
- package/dist/session/tool/tools/codemode-tool.js +54 -2
- package/dist/session/tool/tools/kortix-action-tool.d.ts +1 -0
- package/dist/session/tool/tools/kortix-action-tool.js +19 -8
- package/dist/session/tool/tools/multi-agent-tool-bodies.d.ts +8 -1
- package/dist/session/tool/tools/multi-agent-tool-bodies.js +76 -10
- package/dist/session/tool/tools/task-tool.js +17 -5
- package/dist/session/turn/peer-message-row.d.ts +3 -0
- package/dist/session/turn/peer-message-row.js +8 -2
- package/dist/session/turn/subagent-notice-row.js +5 -3
- package/dist/styles.css +1 -1
- package/dist/test-utils/intl.d.ts +130 -22
- package/dist/theme/index.d.ts +2 -1
- package/dist/theme/index.js +2 -1
- package/dist/theme/wallpaper-gradients.d.ts +106 -0
- package/dist/theme/wallpaper-gradients.js +347 -0
- package/dist/theme/wallpapers.d.ts +23 -3
- package/dist/theme/wallpapers.js +53 -29
- package/dist/workspace/admin/project-admin-dashboard.js +1 -1
- package/dist/workspace/layout/project-home.js +1 -1
- package/dist/workspace/new/use-create-workspace.d.ts +5 -3
- package/dist/workspace/new/use-create-workspace.js +1 -1
- package/dist/workspace/projects/modal/project-icon-field.d.ts +3 -1
- package/dist/workspace/projects/modal/project-icon-field.js +3 -3
- package/dist/workspace/review/review-center.d.ts +9 -1
- package/dist/workspace/review/review-center.js +107 -14
- package/dist/workspace/review/review-detail.d.ts +19 -0
- package/dist/workspace/review/review-detail.js +18 -3
- package/dist/workspace/review/review-swipe-deck.d.ts +27 -0
- package/dist/workspace/review/review-swipe-deck.js +304 -0
- package/dist/workspace/review/review-swipe.d.ts +17 -0
- package/dist/workspace/review/review-swipe.js +10 -0
- package/dist/workspace/session-spaces/space-picker.js +3 -3
- package/dist/workspace/setup/setup-banner-snooze.d.ts +10 -0
- package/dist/workspace/setup/setup-banner-snooze.js +44 -0
- package/dist/workspace/setup/setup-banner.js +19 -36
- package/dist/workspace/setup/setup-steps.d.ts +0 -5
- package/dist/workspace/setup/setup-steps.js +0 -7
- package/dist/workspace/setup/workspace-setup-modal.d.ts +39 -0
- package/dist/workspace/setup/workspace-setup-modal.js +202 -0
- package/dist/workspace/sidebar/footer/project-review-nav.d.ts +13 -0
- package/dist/workspace/sidebar/footer/project-review-nav.js +29 -0
- package/dist/workspace/sidebar/project-nav-items.d.ts +3 -1
- package/dist/workspace/sidebar/project-nav-items.js +24 -5
- package/dist/workspace/sidebar/project-session-list.js +2 -1
- package/dist/workspace/sidebar/project-sidebar.js +6 -5
- package/dist/workspace/sidebar/project-spaces-nav.js +3 -10
- package/dist/workspace/sidebar/sidebar-more-group.js +1 -1
- package/package.json +14 -10
- package/skills/kortix-ui/SKILL.md +1 -1
- package/skills/kortix-ui/references/modules.md +3 -1
- package/dist/primitives/toast-clearance.d.ts +0 -36
- package/dist/primitives/toast-clearance.js +0 -94
- package/dist/workspace/setup/workspace-setup-page.d.ts +0 -10
- package/dist/workspace/setup/workspace-setup-page.js +0 -91
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { CheckCircleIcon, KeyIcon } from '@phosphor-icons/react';
|
|
4
|
+
import { getSlackMode } from '@kortix/sdk';
|
|
5
|
+
import { useProjectAccountId } from '@kortix/sdk/react';
|
|
6
|
+
import { useQuery } from '@tanstack/react-query';
|
|
7
|
+
import { useState } from 'react';
|
|
8
|
+
import { connectorHref } from '../../customize/connectors/connector-routes.js';
|
|
9
|
+
import { SetCredentialModal } from '../../customize/sections/connectors-view.js';
|
|
10
|
+
import { ProjectSecretDialog } from '../../customize/sections/view/secrets-view.js';
|
|
11
|
+
import { useTranslations } from '../../i18n/index.js';
|
|
12
|
+
import { ConnectorLogo } from '../../internal/connector-logo/connector-logo.js';
|
|
13
|
+
import { installedConnectorLogoSource, resolveConnectorLogo } from '../../internal/connector-logo/connector-logo-source.js';
|
|
14
|
+
import { useAddAccount } from '../../internal/hooks/connectors/use-add-account.js';
|
|
15
|
+
import { SolidCheckIcon } from '../../internal/icons/solid-check-icon.js';
|
|
16
|
+
import { PROJECT_ACTIONS } from '../../internal/lib/project-actions.js';
|
|
17
|
+
import { useProjectCan } from '../../internal/lib/use-project-can.js';
|
|
18
|
+
import { cn } from '../../lib/utils.js';
|
|
19
|
+
import { AvatarGroup, AvatarGroupCount } from '../../primitives/avatar.js';
|
|
20
|
+
import { Button } from '../../primitives/button.js';
|
|
21
|
+
import { EmptyState } from '../../primitives/empty-state.js';
|
|
22
|
+
import { EmptyArt } from '../../primitives/empty-art.js';
|
|
23
|
+
import { ErrorState } from '../../primitives/error-state.js';
|
|
24
|
+
import { Modal, ModalContent, ModalDescription, ModalHeader, ModalTitle } from '../../primitives/modal.js';
|
|
25
|
+
import { Progress } from '../../primitives/progress.js';
|
|
26
|
+
import { Skeleton } from '../../primitives/skeleton.js';
|
|
27
|
+
import { UiLink as Link, useUiSearchParams } from '../../providers/ui-provider.js';
|
|
28
|
+
import { snoozeSetupBanner } from './setup-banner-snooze.js';
|
|
29
|
+
import { useSetupSteps } from './use-setup-steps.js';
|
|
30
|
+
/** While a step is open, read it again this often: the person may finish it in another tab. */
|
|
31
|
+
const OPEN_STEP_POLL_MS = 5_000;
|
|
32
|
+
/**
|
|
33
|
+
* `/workspaces/<id>/setup`: every step of a workspace's setup that only a
|
|
34
|
+
* person can do, in one modal over the workspace. The route keeps its URL:
|
|
35
|
+
* the web app intercepts it (`@modal/(.)setup`) over the page it was opened
|
|
36
|
+
* from, and a direct load draws it over the workspace home. `kortix onboard`
|
|
37
|
+
* opens that URL instead of printing a link per step, and `kortix onboard
|
|
38
|
+
* --wait` continues when every row is done. A missing model never reaches
|
|
39
|
+
* this modal: the workspace shell shows "Connect a model" first (`ProjectShell`).
|
|
40
|
+
*/
|
|
41
|
+
export function WorkspaceSetupModal({ projectId, onClose }) {
|
|
42
|
+
const t = useTranslations('workspaceSetup');
|
|
43
|
+
const params = useUiSearchParams();
|
|
44
|
+
const accountId = useProjectAccountId(projectId);
|
|
45
|
+
const canConnect = useProjectCan(projectId, PROJECT_ACTIONS.PROJECT_CONNECTOR_WRITE, { accountId }).allowed === true;
|
|
46
|
+
const canSetSecrets = useProjectCan(projectId, PROJECT_ACTIONS.PROJECT_SECRET_WRITE).allowed === true;
|
|
47
|
+
const { steps, usesSlack, loading, failed, refresh } = useSetupSteps(projectId, {
|
|
48
|
+
slackRequested: params.get('slack') === '1',
|
|
49
|
+
pollMs: OPEN_STEP_POLL_MS,
|
|
50
|
+
});
|
|
51
|
+
// The same cache entry as the Channels page (`useSlackMode`).
|
|
52
|
+
const slackModeQuery = useQuery({
|
|
53
|
+
queryKey: ['channels', 'slack-mode', projectId],
|
|
54
|
+
queryFn: () => getSlackMode(projectId),
|
|
55
|
+
enabled: usesSlack,
|
|
56
|
+
staleTime: 60_000,
|
|
57
|
+
});
|
|
58
|
+
const open = steps.filter((step) => !step.done);
|
|
59
|
+
const finished = steps.filter((step) => step.done);
|
|
60
|
+
const ready = !loading && !failed && steps.length > 0;
|
|
61
|
+
const complete = ready && open.length === 0;
|
|
62
|
+
const view = {
|
|
63
|
+
projectId,
|
|
64
|
+
canConnect,
|
|
65
|
+
canSetSecrets,
|
|
66
|
+
slackInstallUrl: slackModeQuery.data?.oauth_available ? slackModeQuery.data.install_url : null,
|
|
67
|
+
refresh,
|
|
68
|
+
};
|
|
69
|
+
// "Later" is the banner's one dismiss: it snoozes it for a day. "Done",
|
|
70
|
+
// Escape and a click outside only close.
|
|
71
|
+
const finishedOrEmpty = complete || (!loading && steps.length === 0);
|
|
72
|
+
const later = () => {
|
|
73
|
+
if (!finishedOrEmpty)
|
|
74
|
+
snoozeSetupBanner(projectId);
|
|
75
|
+
onClose();
|
|
76
|
+
};
|
|
77
|
+
return (_jsx(Modal, { open: true, onOpenChange: (isOpen) => {
|
|
78
|
+
if (!isOpen)
|
|
79
|
+
onClose();
|
|
80
|
+
}, children: _jsxs(ModalContent, { variant: "base", className: "space-y-0 overflow-hidden lg:grid lg:h-[min(34rem,85vh)] lg:max-w-4xl lg:grid-cols-[17rem_1fr]", "data-testid": "workspace-setup", children: [_jsxs("aside", { className: "bg-sidebar flex flex-col gap-6 border-b px-6 pt-6 pb-5 lg:border-r lg:border-b-0", children: [_jsxs(ModalHeader, { className: "space-y-1.5 p-0 pr-10 lg:pr-0", children: [_jsx(ModalTitle, { className: "text-xl font-medium text-balance", children: complete ? t('completeTitle') : t('title') }), _jsx(ModalDescription, { className: "text-sm text-pretty", children: complete ? t('completeDescription') : t('subtitle') })] }), ready ? (_jsxs("div", { className: "space-y-2", children: [_jsx("p", { className: "text-foreground text-sm font-medium tabular-nums", children: t('progress', { done: finished.length, total: steps.length }) }), _jsx(Progress, { value: (finished.length / steps.length) * 100, getValueLabel: () => t('progress', { done: finished.length, total: steps.length }), className: "bg-muted h-1", indicatorClassName: "bg-kortix-green" })] })) : null, _jsxs("div", { className: "mt-auto hidden items-center justify-between gap-3 lg:flex", children: [_jsx("p", { className: "text-muted-foreground min-w-0 text-sm text-pretty", children: ready && !complete ? t('liveNote') : null }), _jsx(Button, { size: "sm", onClick: later, children: finishedOrEmpty ? t('done') : t('later') })] })] }), _jsx("div", { className: "min-h-0 overflow-y-auto px-6 pt-6 pb-6 lg:pt-14", children: loading ? (_jsx("ul", { className: "grid gap-2 sm:grid-cols-2", "aria-busy": "true", children: [0, 1, 2, 3].map((index) => (_jsx("li", { children: _jsx(Skeleton, { className: "h-14 rounded-lg" }) }, 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') })) : (_jsxs("div", { className: "space-y-6", children: [open.length > 0 ? (_jsx(StepSection, { title: t('sectionOpen'), count: open.length, children: _jsx("ul", { className: "grid gap-2 sm:grid-cols-2", children: open.map((step) => (_jsx(OpenStepTile, { view: view, step: step }, step.id))) }) })) : null, finished.length > 0 ? (
|
|
81
|
+
// What is already done is one quiet line, not a second list:
|
|
82
|
+
// the stack shows which, the count says how many.
|
|
83
|
+
_jsxs("div", { className: cn('flex items-center gap-3', open.length > 0 && 'border-t pt-5'), title: finished.map((step) => step.name).join(', '), children: [_jsx(StepLogoStack, { steps: finished, max: 5, ringClassName: "ring-background" }), _jsxs("p", { className: "text-muted-foreground flex min-w-0 items-center gap-1.5 text-xs", children: [_jsx(SolidCheckIcon, { className: "text-kortix-green size-3.5 shrink-0" }), t('doneSummary', { count: finished.length })] })] })) : null] })) }), _jsx("footer", { className: "flex justify-end border-t px-6 py-3 lg:hidden", children: _jsx(Button, { size: "sm", onClick: later, children: finishedOrEmpty ? t('done') : t('later') }) })] }) }));
|
|
84
|
+
}
|
|
85
|
+
function StepSection({ title, count, children }) {
|
|
86
|
+
return (_jsxs("section", { className: "space-y-2.5", children: [_jsxs("h3", { className: "text-muted-foreground flex items-baseline gap-1.5 text-xs", children: [title, _jsx("span", { className: "tabular-nums", children: count })] }), children] }));
|
|
87
|
+
}
|
|
88
|
+
/** An open step: its logo, its name, and the one control that finishes it. */
|
|
89
|
+
function OpenStepTile({ view, step }) {
|
|
90
|
+
return (_jsxs("li", { className: "flex min-w-0 items-center gap-3 rounded-lg border py-2.5 pr-2.5 pl-3", children: [_jsx(StepLogo, { step: step, size: "md" }), _jsx("p", { className: cn('text-foreground min-w-0 flex-1 truncate text-sm font-medium', step.kind === 'secret' && 'font-mono text-xs'), children: step.name }), _jsx(StepAction, { view: view, step: step })] }));
|
|
91
|
+
}
|
|
92
|
+
export function StepLogo({ step, size = 'lg', className, }) {
|
|
93
|
+
if (step.kind === 'connector') {
|
|
94
|
+
return _jsx(ConnectorLogo, { source: installedConnectorLogoSource(step.connector), size: size, className: className });
|
|
95
|
+
}
|
|
96
|
+
if (step.kind === 'slack')
|
|
97
|
+
return _jsx(ConnectorLogo, { source: { nativeApp: 'slack' }, size: size, className: className });
|
|
98
|
+
const tile = { xs: 'size-5 rounded-sm', sm: 'size-6 rounded-sm', md: 'size-8 rounded-md', lg: 'size-9 rounded-md', xl: 'size-14 rounded-xl' }[size];
|
|
99
|
+
const glyph = { xs: 'size-3', sm: 'size-3.5', md: 'size-4', lg: 'size-4', xl: 'size-6' }[size];
|
|
100
|
+
return (_jsx("span", { className: cn('bg-muted flex shrink-0 items-center justify-center', tile, className), children: _jsx(KeyIcon, { className: cn('text-muted-foreground', glyph) }) }));
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Steps' logos as an overlapping stack, the rest as "+N". Every logo sits on
|
|
104
|
+
* the same 28px tile, washed with its own colour: a blurred, scaled copy of
|
|
105
|
+
* the logo at low opacity behind the mark. The logo hosts send no CORS
|
|
106
|
+
* headers, so a canvas cannot read the colour; the browser blends it instead.
|
|
107
|
+
* Each tile overlaps the one before it and is cut out of it by a ring in the
|
|
108
|
+
* surface's own fill (`ringClassName`); the "+N" tile, last, is never hidden.
|
|
109
|
+
*/
|
|
110
|
+
export function StepLogoStack({ steps, max = 3, ringClassName, }) {
|
|
111
|
+
const shown = steps.slice(0, max);
|
|
112
|
+
const more = steps.length - shown.length;
|
|
113
|
+
// 7px corners on the 28px tile, 4px on the 18px mark inside it: between the
|
|
114
|
+
// `rounded-sm` (6px) and `rounded-md` (8px) rungs by design (Jay, 2026-11-21),
|
|
115
|
+
// the same curve at both sizes.
|
|
116
|
+
const tile = cn('relative flex size-7 shrink-0 items-center justify-center rounded-[7px] ring-2', ringClassName); // audit:allow 7px logo tile, between rungs by request
|
|
117
|
+
return (_jsxs(AvatarGroup, { "aria-hidden": true, className: "shrink-0 -space-x-1.5", children: [shown.map((step) => (_jsxs("span", { className: cn(tile, 'bg-background isolate overflow-hidden'), children: [_jsx(LogoWash, { src: stepLogoImage(step) }), _jsx(StepLogo, { step: step, size: "xs", className: "rounded-[4px] border-0 bg-transparent [&_img]:rounded-[4px]" }), " "] }, step.id))), more > 0 ? (_jsxs(AvatarGroupCount, { className: cn(tile, 'bg-muted text-muted-foreground w-auto min-w-7 px-1.5 text-xs font-medium tabular-nums'), children: ["+", more] })) : null] }));
|
|
118
|
+
}
|
|
119
|
+
/** The step's logo image URL, or null for a drawn mark (Slack, a secret's key) that has no image to wash with. */
|
|
120
|
+
function stepLogoImage(step) {
|
|
121
|
+
if (step.kind !== 'connector')
|
|
122
|
+
return null;
|
|
123
|
+
const logo = resolveConnectorLogo(installedConnectorLogoSource(step.connector));
|
|
124
|
+
return logo.kind === 'image' ? logo.src : null;
|
|
125
|
+
}
|
|
126
|
+
/** The logo's colour as a faint fill: the image itself, blurred past recognition. A drawn mark gets the muted fill. */
|
|
127
|
+
function LogoWash({ src }) {
|
|
128
|
+
const [failed, setFailed] = useState(false);
|
|
129
|
+
if (!src || failed)
|
|
130
|
+
return _jsx("span", { "aria-hidden": true, className: "bg-muted absolute inset-0 -z-10" });
|
|
131
|
+
return (
|
|
132
|
+
// eslint-disable-next-line @next/next/no-img-element -- third-party logos on arbitrary hosts; the Next loader adds nothing
|
|
133
|
+
_jsx("img", { src: src, alt: "", "aria-hidden": true, loading: "lazy", decoding: "async", referrerPolicy: "no-referrer", draggable: false, onError: () => setFailed(true), className: "pointer-events-none absolute inset-0 -z-10 size-full scale-150 object-cover opacity-40 blur-sm select-none" }));
|
|
134
|
+
}
|
|
135
|
+
/** The words for one step: the verb that finishes it, whole or short. */
|
|
136
|
+
export function useStepCopy() {
|
|
137
|
+
const t = useTranslations('workspaceSetup');
|
|
138
|
+
return {
|
|
139
|
+
action: (step) => step.kind === 'connector'
|
|
140
|
+
? step.broken
|
|
141
|
+
? t('reconnect', { name: step.name })
|
|
142
|
+
: t('connect', { name: step.name })
|
|
143
|
+
: step.kind === 'secret'
|
|
144
|
+
? t('setSecret', { name: step.name })
|
|
145
|
+
: t('addSlack'),
|
|
146
|
+
/** The verb alone, for a row that already names the step. Slack keeps its own label. */
|
|
147
|
+
short: (step) => step.kind === 'connector'
|
|
148
|
+
? step.broken
|
|
149
|
+
? t('reconnectShort')
|
|
150
|
+
: t('connectShort')
|
|
151
|
+
: step.kind === 'secret'
|
|
152
|
+
? t('setShort')
|
|
153
|
+
: undefined,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* The control that finishes one step, or "Done". Hidden (not disabled) when
|
|
158
|
+
* the viewer may not do it.
|
|
159
|
+
*/
|
|
160
|
+
function StepAction({ view, step }) {
|
|
161
|
+
const t = useTranslations('workspaceSetup');
|
|
162
|
+
const copy = useStepCopy();
|
|
163
|
+
if (step.done) {
|
|
164
|
+
return (_jsxs("span", { className: "text-muted-foreground flex shrink-0 items-center gap-1.5 text-xs", children: [_jsx(SolidCheckIcon, { className: "text-kortix-green size-4 shrink-0" }), t('done')] }));
|
|
165
|
+
}
|
|
166
|
+
const label = copy.short(step);
|
|
167
|
+
if (step.kind === 'connector') {
|
|
168
|
+
return view.canConnect ? (_jsx(ConnectorAction, { projectId: view.projectId, connector: step.connector, name: step.name, broken: step.broken, onChanged: view.refresh, label: label ?? t('connect', { name: step.name }) })) : null;
|
|
169
|
+
}
|
|
170
|
+
if (step.kind === 'secret') {
|
|
171
|
+
return view.canSetSecrets ? (_jsx(SecretAction, { projectId: view.projectId, step: step, onChanged: view.refresh, label: label ?? t('setSecret', { name: step.name }) })) : null;
|
|
172
|
+
}
|
|
173
|
+
return _jsx(SlackAction, { projectId: view.projectId, installUrl: view.slackInstallUrl });
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Connect: the shared account every agent of the workspace uses, signed in at
|
|
177
|
+
* once, the same as the connector page's Add account with "Everyone". A
|
|
178
|
+
* connector whose account broke opens its own page, where the account is.
|
|
179
|
+
*/
|
|
180
|
+
function ConnectorAction({ projectId, connector, name, broken, onChanged, label, }) {
|
|
181
|
+
const [credential, setCredential] = useState(null);
|
|
182
|
+
const add = useAddAccount({ projectId, connector, displayName: name, onAdded: onChanged, onCredential: setCredential });
|
|
183
|
+
if (broken) {
|
|
184
|
+
return (_jsx(Button, { asChild: true, size: "sm", variant: "outline", "aria-label": label, children: _jsx(Link, { href: connectorHref(projectId, connector.slug), children: label }) }));
|
|
185
|
+
}
|
|
186
|
+
return (_jsxs(_Fragment, { children: [_jsx(Button, { size: "sm", variant: "outline", disabled: add.pending, "aria-busy": add.pending, onClick: () => add.submit({ label: add.proposedLabel(), audience: 'project', picked: { memberIds: [], groupIds: [] } }), children: label }), credential ? (_jsx(SetCredentialModal, { projectId: projectId, connector: connector, connectionId: credential.connectionId, owner: credential.owner, open: true, onOpenChange: (open) => {
|
|
187
|
+
if (!open)
|
|
188
|
+
setCredential(null);
|
|
189
|
+
}, onSaved: () => {
|
|
190
|
+
setCredential(null);
|
|
191
|
+
onChanged();
|
|
192
|
+
} }, credential.connectionId)) : null] }));
|
|
193
|
+
}
|
|
194
|
+
function SecretAction({ projectId, step, onChanged, label, }) {
|
|
195
|
+
const [open, setOpen] = useState(false);
|
|
196
|
+
return (_jsxs(_Fragment, { children: [_jsx(Button, { size: "sm", variant: "outline", onClick: () => setOpen(true), children: label }), _jsx(ProjectSecretDialog, { projectId: projectId, row: step.row, open: open, onOpenChange: setOpen, onSaved: onChanged })] }));
|
|
197
|
+
}
|
|
198
|
+
/** One-click "Add to Slack" in a new tab when the host has the Slack app; else the Channels page, which takes a bot token. */
|
|
199
|
+
function SlackAction({ projectId, installUrl }) {
|
|
200
|
+
const t = useTranslations('workspaceSetup');
|
|
201
|
+
return installUrl ? (_jsx(Button, { asChild: true, size: "sm", variant: "outline", children: _jsx("a", { href: installUrl, target: "_blank", rel: "noopener noreferrer", children: t('addSlack') }) })) : (_jsx(Button, { asChild: true, size: "sm", variant: "outline", children: _jsx(Link, { href: `/workspaces/${projectId}/admin/connectors?scope=channels`, children: t('connectSlack') }) }));
|
|
202
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Review row: this workspace's Review page (`reviewHref`,
|
|
3
|
+
* `/workspaces/<id>/review`: change requests, agent questions, approvals)
|
|
4
|
+
* with the count of what waits on the person (`useReviewNeedsYouCount`).
|
|
5
|
+
* One row for both sidebars: the default nav rows (`ProjectNavItems`, first
|
|
6
|
+
* row) and the Spaces list (`ProjectSpacesNav`, `chat` on). Nothing when the
|
|
7
|
+
* host serves no Review page.
|
|
8
|
+
*/
|
|
9
|
+
export declare function ProjectReviewNavItem({ projectId, itemClassName, }: {
|
|
10
|
+
projectId: string;
|
|
11
|
+
/** Added to the list item's classes (the Spaces list sets Review apart with spacing). */
|
|
12
|
+
itemClassName?: string;
|
|
13
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { CheckIcon } from '@phosphor-icons/react';
|
|
4
|
+
import { useTranslations } from '../../../i18n/index.js';
|
|
5
|
+
import { useReviewNeedsYouCount } from '../../../internal/hooks/use-review-session-summary.js';
|
|
6
|
+
import { ProjectNavRow } from '../../../internal/layout/project-nav-row.js';
|
|
7
|
+
import { reviewHref } from '../../../internal/lib/capability-tab-routes.js';
|
|
8
|
+
import { CountBadge } from '../../../primitives/count-badge.js';
|
|
9
|
+
import { useUiPathname } from '../../../providers/ui-provider.js';
|
|
10
|
+
/**
|
|
11
|
+
* The Review row: this workspace's Review page (`reviewHref`,
|
|
12
|
+
* `/workspaces/<id>/review`: change requests, agent questions, approvals)
|
|
13
|
+
* with the count of what waits on the person (`useReviewNeedsYouCount`).
|
|
14
|
+
* One row for both sidebars: the default nav rows (`ProjectNavItems`, first
|
|
15
|
+
* row) and the Spaces list (`ProjectSpacesNav`, `chat` on). Nothing when the
|
|
16
|
+
* host serves no Review page.
|
|
17
|
+
*/
|
|
18
|
+
export function ProjectReviewNavItem({ projectId, itemClassName, }) {
|
|
19
|
+
const t = useTranslations('sidebar');
|
|
20
|
+
const pathname = useUiPathname();
|
|
21
|
+
const href = reviewHref(projectId);
|
|
22
|
+
const needsYou = useReviewNeedsYouCount(projectId);
|
|
23
|
+
if (!href)
|
|
24
|
+
return null;
|
|
25
|
+
// The page or an item under it; a query (`?id=`) is not part of the match.
|
|
26
|
+
const path = href.split('?')[0];
|
|
27
|
+
const active = !!pathname && (pathname === path || pathname.startsWith(`${path}/`));
|
|
28
|
+
return (_jsxs(ProjectNavRow, { active: active, label: t('spaces.review'), href: href, itemClassName: itemClassName, children: [_jsx(CheckIcon, {}), _jsx("span", { className: "min-w-0 flex-1 truncate", children: t('spaces.review') }), needsYou > 0 ? _jsx(CountBadge, { count: needsYou, tone: "waiting" }) : null] }));
|
|
29
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/** `review={false}`: the host shows the Review row elsewhere (`chat` on: first in `ProjectSpacesNav`). */
|
|
2
|
+
export declare function ProjectNavItems({ projectId, review }: {
|
|
2
3
|
projectId: string;
|
|
4
|
+
review?: boolean;
|
|
3
5
|
}): import("react").JSX.Element;
|
|
@@ -5,6 +5,7 @@ import { ProjectCalendarNavItem } from './footer/project-calendar-nav.js';
|
|
|
5
5
|
import { ProjectGoalsNavItem } from './footer/project-goals-nav.js';
|
|
6
6
|
import { ProjectArtifactsNavItem } from './footer/project-artifacts-nav.js';
|
|
7
7
|
import { ProjectFilesNavItem } from './footer/project-files-nav.js';
|
|
8
|
+
import { ProjectReviewNavItem } from './footer/project-review-nav.js';
|
|
8
9
|
import { CustomizeGlyph, useCapabilityAccess, } from '../../internal/layout/project-settings-nav.js';
|
|
9
10
|
import { isProjectAdminPath, useOpenNewAgent } from '../../internal/layout/project-capability-nav.js';
|
|
10
11
|
import { PROJECT_ACTIONS } from '../../internal/lib/project-actions.js';
|
|
@@ -22,18 +23,34 @@ import { adminPath } from '../../lib/routes.js';
|
|
|
22
23
|
* own flag and permission gate and renders nothing when the project does not
|
|
23
24
|
* offer it. Spaces are the channel sidebar under the `chat` flag
|
|
24
25
|
* (project-spaces-nav.tsx).
|
|
26
|
+
*
|
|
27
|
+
* `review` is first: it is the one row that counts what waits on you (change
|
|
28
|
+
* requests, agent questions, approvals), as Review is first in the Spaces
|
|
29
|
+
* list and a top row of the mobile drawer.
|
|
25
30
|
*/
|
|
26
|
-
const NAV_ROWS = ['customize', 'files', 'apps', 'calendar', 'goals', 'artifacts'];
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
const NAV_ROWS = ['review', 'customize', 'files', 'apps', 'calendar', 'goals', 'artifacts'];
|
|
32
|
+
/** `review={false}`: the host shows the Review row elsewhere (`chat` on: first in `ProjectSpacesNav`). */
|
|
33
|
+
export function ProjectNavItems({ projectId, review = true }) {
|
|
34
|
+
return (_jsx(_Fragment, { children: NAV_ROWS.filter((id) => review || id !== 'review').map((id) => (_jsx(NavItem, { id: id, projectId: projectId }, id))) }));
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Review, for the people who decide: the caller may read Review and act on
|
|
38
|
+
* it (approve a change request, answer an agent). The Customize access rule's
|
|
39
|
+
* `review` tab, the rule the mobile drawer's Review row applies too.
|
|
40
|
+
*/
|
|
41
|
+
function ReviewNavEntry({ projectId }) {
|
|
42
|
+
const access = useCapabilityAccess(projectId);
|
|
43
|
+
if (!access.settled || !access.tabs.includes('review'))
|
|
44
|
+
return null;
|
|
45
|
+
return _jsx(ProjectReviewNavItem, { projectId: projectId });
|
|
29
46
|
}
|
|
30
47
|
/**
|
|
31
48
|
* Customize, for the people who may configure the project: one link into
|
|
32
49
|
* Workspace settings, on Agents when the caller may read them (Customize is
|
|
33
50
|
* agent-centric). Since 2026-11-08 Customize IS that panel, so there is no
|
|
34
51
|
* disclosure here: the panel's rail lists Agents, Models, Skills and the
|
|
35
|
-
* rest
|
|
36
|
-
* holds + (New agent). Absent when the caller may open no capability page.
|
|
52
|
+
* rest. Review is its own row (`ReviewNavEntry`). On hover, the row's right
|
|
53
|
+
* edge holds + (New agent). Absent when the caller may open no capability page.
|
|
37
54
|
*/
|
|
38
55
|
function CustomizeNavEntry({ projectId }) {
|
|
39
56
|
const t = useTranslations('sidebar');
|
|
@@ -58,6 +75,8 @@ function CustomizeNavEntry({ projectId }) {
|
|
|
58
75
|
}
|
|
59
76
|
function NavItem({ id, projectId }) {
|
|
60
77
|
switch (id) {
|
|
78
|
+
case 'review':
|
|
79
|
+
return _jsx(ReviewNavEntry, { projectId: projectId });
|
|
61
80
|
case 'customize':
|
|
62
81
|
return _jsx(CustomizeNavEntry, { projectId: projectId });
|
|
63
82
|
case 'apps':
|
|
@@ -43,6 +43,7 @@ import { selectCollapsedSections, selectGroupMode, selectHiddenSections, selectL
|
|
|
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
45
|
import { SpaceFormModal } from '../session-spaces/space-form-modal.js';
|
|
46
|
+
import { SpaceIconBare } from '../session-spaces/space-icon.js';
|
|
46
47
|
import { qk, useProjectSession, useProjectSessions, useRuntimeSupports, useSessionChildren, useFeatureFlag, useProjectSessionGroups, useSessionGoal, } from '@kortix/sdk/react';
|
|
47
48
|
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';
|
|
48
49
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
@@ -637,7 +638,7 @@ function ProjectSessionRow({ session, href, isActive, isSwitching, onNavigate, d
|
|
|
637
638
|
e.stopPropagation();
|
|
638
639
|
}, children: _jsx(DotsThreeIcon, { className: "size-4" }) }) }), _jsxs(DropdownMenuContent, { align: "start", side: "right", className: "w-44", onCloseAutoFocus: keepFocusForNewGroup, children: [_jsxs(DropdownMenuItem, { className: "cursor-pointer", onSelect: () => deferAfterClose(() => onRename(session.session_id, displayTitle)), children: [_jsx(PencilSimpleIcon, {}), tI18nComplete.raw('text3064d79a295c')] }), _jsxs(DropdownMenuItem, { className: "cursor-pointer", onSelect: () => deferAfterClose(() => onEditLabels(session)), children: [_jsx(TagIcon, {}), t('labels.menu')] }), groups && onMoveToGroup && (_jsxs(DropdownMenuSub, { children: [_jsxs(DropdownMenuSubTrigger, { className: "cursor-pointer", children: [_jsx(FolderSimpleIcon, {}), tGroups('moveTo')] }), _jsxs(DropdownMenuSubContent, { className: "w-48", children: [groups.map((group) => {
|
|
639
640
|
const current = session.group_id === group.group_id;
|
|
640
|
-
return (_jsxs(DropdownMenuItem, { className: "cursor-pointer", disabled: current, onSelect: () => deferAfterClose(() => onMoveToGroup(session.session_id, group.group_id)), children: [
|
|
641
|
+
return (_jsxs(DropdownMenuItem, { className: "cursor-pointer", disabled: current, onSelect: () => deferAfterClose(() => onMoveToGroup(session.session_id, group.group_id)), children: [_jsx(SpaceIconBare, { space: group }), _jsx("span", { className: "min-w-0 flex-1 truncate first-letter:uppercase", children: group.name }), current ? _jsx(CheckIcon, { className: "text-muted-foreground ml-auto" }) : null] }, group.group_id));
|
|
641
642
|
}), groups.length > 0 && _jsx(DropdownMenuSeparator, {}), onNewGroupFor && (_jsxs(DropdownMenuItem, { className: "cursor-pointer", onSelect: () => {
|
|
642
643
|
markNewGroupFocus();
|
|
643
644
|
deferAfterClose(() => onNewGroupFor(session.session_id));
|
|
@@ -25,7 +25,6 @@ import { useBillingAccountId } from '../../internal/stores/billing-account-conte
|
|
|
25
25
|
import { useFeatureFlag } from '@kortix/sdk/react';
|
|
26
26
|
import { AppsModal } from '../../internal/apps-and-extensions/apps-modal.js';
|
|
27
27
|
import { useAppsModalStore } from '../../internal/stores/apps-modal-store.js';
|
|
28
|
-
import { CHROME_UI_ENABLED } from '../../internal/chrome/use-chrome-offered.js';
|
|
29
28
|
import { MagnifyingGlassIcon, NavigationArrowIcon, } from '@phosphor-icons/react';
|
|
30
29
|
import { UiLink as Link, useUiPathname } from '../../providers/ui-provider.js';
|
|
31
30
|
import { SettingsReturnTracker, SidebarDrill } from './sidebar-drill.js';
|
|
@@ -36,8 +35,11 @@ import { SidebarGlyph as PanelLeft } from '../../icons/sidebar-toggle.js';
|
|
|
36
35
|
import { Close } from '../../icons/close.js';
|
|
37
36
|
const isMac = typeof navigator !== 'undefined' && /Mac|iPod|iPhone|iPad/.test(navigator.platform);
|
|
38
37
|
const modSymbol = isMac ? '⌘' : 'Ctrl';
|
|
39
|
-
/**
|
|
40
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Workspace pages with a centered bottom composer: home, one session (not the
|
|
40
|
+
* Sessions list), and `/setup`, whose modal opens over home with its banner.
|
|
41
|
+
*/
|
|
42
|
+
const CENTERED_COMPOSER_ROUTE = /\/workspaces\/[^/]+(?:\/setup|\/sessions\/[^/]+(?:\/.*)?)?\/?$/;
|
|
41
43
|
/** Workspace pages whose composer runs to the right edge: chat, DMs, channels, Spaces. */
|
|
42
44
|
const FULL_COMPOSER_ROUTE = /\/workspaces\/[^/]+\/(?:c|chat|dm|spaces)(?:\/.*)?$/;
|
|
43
45
|
export function ProjectSidebar({ projectId, menu, onOpenSearch, onOpenDownloadApp, }) {
|
|
@@ -61,8 +63,7 @@ export function ProjectSidebar({ projectId, menu, onOpenSearch, onOpenDownloadAp
|
|
|
61
63
|
// Chat (`chat`): the spaces list replaces New session, and the session list
|
|
62
64
|
// moves below it, closed by default (fail-closed: off until the project answers).
|
|
63
65
|
const chat = useFeatureFlag(projectId, 'chat').enabled;
|
|
64
|
-
|
|
65
|
-
const chrome = useFeatureFlag(projectId, 'chrome').enabled && CHROME_UI_ENABLED;
|
|
66
|
+
const chrome = useFeatureFlag(projectId, 'chrome').enabled;
|
|
66
67
|
// Open the project composer without creating a durable session.
|
|
67
68
|
const newSession = useNewProjectSession(projectId);
|
|
68
69
|
const creatingSession = useIsCreatingProjectSession(projectId);
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useProjectSessions, useProjectSpaces } from '@kortix/sdk/react';
|
|
4
|
-
import { useReviewNeedsYouCount } from '../../internal/hooks/use-review-session-summary.js';
|
|
5
4
|
import { MY_KORTIX_AGENT_NAME } from '../../_vendor/kortix-shared.js';
|
|
6
|
-
import {
|
|
5
|
+
import { LockSimpleIcon, PlusIcon } from '@phosphor-icons/react';
|
|
7
6
|
import { useMemo, useState } from 'react';
|
|
8
7
|
import { useTranslations } from '../../i18n/index.js';
|
|
9
8
|
import { HoverPrefetchLink } from '../../internal/components/hover-prefetch-link.js';
|
|
10
9
|
import { useIsMobile } from '../../internal/hooks/index.js';
|
|
11
|
-
import { reviewHref } from '../../internal/lib/capability-tab-routes.js';
|
|
12
10
|
import { uiRoutes } from '../../lib/routes.js';
|
|
13
11
|
import { Button } from '../../primitives/button.js';
|
|
14
|
-
import { CountBadge } from '../../primitives/count-badge.js';
|
|
15
12
|
import { FadedScrollArea } from '../../primitives/faded-scroll-area.js';
|
|
16
13
|
import { SidebarMenu, SidebarMenuButton, SidebarMenuItem, useSidebar } from '../../primitives/sidebar.js';
|
|
17
14
|
import { useUiPathname } from '../../providers/ui-provider.js';
|
|
15
|
+
import { ProjectReviewNavItem } from './footer/project-review-nav.js';
|
|
18
16
|
import { CreateChannelDialog } from '../spaces/create-channel-dialog.js';
|
|
19
17
|
import { PrivateChannelsNotInRow } from '../spaces/private-channels-not-in.js';
|
|
20
18
|
import { isPersonalSpace, isPrivateSpace, orderSpaces, spaceDisplayName, spacePreview, } from '../spaces/space-identity.js';
|
|
@@ -56,13 +54,8 @@ export function ProjectSpacesNav({ projectId }) {
|
|
|
56
54
|
const [createOpen, setCreateOpen] = useState(false);
|
|
57
55
|
const { personal, others } = useMemo(() => orderSpaces(spaces.data ?? []), [spaces.data]);
|
|
58
56
|
const chatHref = `${uiRoutes().project(projectId)}/chat`;
|
|
59
|
-
// The Review page on its own route (`reviewHref`), beside this sidebar.
|
|
60
|
-
const review = reviewHref(projectId);
|
|
61
|
-
const openAsks = useReviewNeedsYouCount(projectId);
|
|
62
57
|
const hrefOf = (space) => space.kind === 'dm' ? uiRoutes().dm(projectId, space.dm_agent_name ?? '') : uiRoutes().channel(projectId, space.slug ?? '');
|
|
63
|
-
return (_jsxs(FadedScrollArea, { fadeColor: "from-background", className: "h-full min-h-0", children: [_jsxs(SidebarMenu, { className: "gap-px", onKeyDown: moveFocus, children: [
|
|
64
|
-
// Spacing, not a rule, sets Review apart from the spaces.
|
|
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) => {
|
|
58
|
+
return (_jsxs(FadedScrollArea, { fadeColor: "from-background", className: "h-full min-h-0", children: [_jsxs(SidebarMenu, { className: "gap-px", onKeyDown: moveFocus, children: [_jsx(ProjectReviewNavItem, { projectId: projectId, itemClassName: "mb-2" }), _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) => {
|
|
66
59
|
const href = hrefOf(space);
|
|
67
60
|
return (_jsx(SpaceRow, { projectId: projectId, space: space, href: href, active: isAt(pathname, href), name: spaceDisplayName(space, personalName), personal: isPersonalSpace(space), isPrivate: isPrivateSpace(space), names: names }, space.space_id));
|
|
68
61
|
}), spaces.data ? (_jsx(SidebarMenuItem, { children: _jsxs(SidebarMenuButton, { onClick: () => setCreateOpen(true), className: "text-muted-foreground hover:text-sidebar-foreground", children: [_jsx(PlusIcon, {}), _jsx("span", { children: t('spaces.addChannel') })] }) })) : null, _jsx(PrivateChannelsNotInRow, { projectId: projectId })] }), _jsx(CreateChannelDialog, { projectId: projectId, open: createOpen, onOpenChange: setCreateOpen })] }));
|
|
@@ -24,5 +24,5 @@ export function SidebarMoreGroup({ projectId, footer }) {
|
|
|
24
24
|
const expanded = useSessionExpandedStore(selectExpandedIds(projectId));
|
|
25
25
|
const toggleExpanded = useSessionExpandedStore((state) => state.toggleExpanded);
|
|
26
26
|
const open = expanded.includes(MORE_SECTION_ID);
|
|
27
|
-
return (_jsxs(Disclosure, { open: open, onOpenChange: () => toggleExpanded(projectId, MORE_SECTION_ID), className: cn('group/more flex min-h-0 flex-col', open ? 'max-h-1/2' : 'shrink-0'), transition: { duration: 0.15, ease: 'easeOut' }, children: [_jsx(SidebarMenu, { children: _jsx(SidebarMenuItem, { children: _jsx(DisclosureTrigger, { children: _jsxs(SidebarMenuButton, { className: "text-muted-foreground hover:text-sidebar-foreground", children: [_jsx(DotsThreeIcon, { weight: "bold" }), _jsx("span", { className: "min-w-0 flex-1 truncate", children: t('more') }), _jsx(CaretRightSolidIcon, { "aria-hidden": true, className: cn('size-4! shrink-0 transition-transform duration-(--duration-fast) ease-out motion-reduce:transition-none', open && 'rotate-90') })] }) }) }) }), _jsxs(DisclosureContent, { className: "flex min-h-0 flex-1 flex-col", contentClassName: "flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto pt-1", children: [_jsx(SidebarMenu, { children: _jsx(ProjectNavItems, { projectId: projectId }) }), _jsx(ProjectSessionList, { projectId: projectId, secondary: true }), footer] })] }));
|
|
27
|
+
return (_jsxs(Disclosure, { open: open, onOpenChange: () => toggleExpanded(projectId, MORE_SECTION_ID), className: cn('group/more flex min-h-0 flex-col', open ? 'max-h-1/2' : 'shrink-0'), transition: { duration: 0.15, ease: 'easeOut' }, children: [_jsx(SidebarMenu, { children: _jsx(SidebarMenuItem, { children: _jsx(DisclosureTrigger, { children: _jsxs(SidebarMenuButton, { className: "text-muted-foreground hover:text-sidebar-foreground", children: [_jsx(DotsThreeIcon, { weight: "bold" }), _jsx("span", { className: "min-w-0 flex-1 truncate", children: t('more') }), _jsx(CaretRightSolidIcon, { "aria-hidden": true, className: cn('size-4! shrink-0 transition-transform duration-(--duration-fast) ease-out motion-reduce:transition-none', open && 'rotate-90') })] }) }) }) }), _jsxs(DisclosureContent, { className: "flex min-h-0 flex-1 flex-col", contentClassName: "flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto pt-1", children: [_jsx(SidebarMenu, { children: _jsx(ProjectNavItems, { projectId: projectId, review: false }) }), _jsx(ProjectSessionList, { projectId: projectId, secondary: true }), footer] })] }));
|
|
28
28
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kortix/ui",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.5",
|
|
4
4
|
"description": "Kortix UI: the shared React component library for apps/web, Kortix Apps and SDK hosts. Tailwind v4 classes, themed by CSS variables.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Elastic-2.0",
|
|
@@ -160,6 +160,10 @@
|
|
|
160
160
|
"types": "./dist/primitives/collapsible.d.ts",
|
|
161
161
|
"import": "./dist/primitives/collapsible.js"
|
|
162
162
|
},
|
|
163
|
+
"./color-picker": {
|
|
164
|
+
"types": "./dist/primitives/color-picker.d.ts",
|
|
165
|
+
"import": "./dist/primitives/color-picker.js"
|
|
166
|
+
},
|
|
163
167
|
"./command": {
|
|
164
168
|
"types": "./dist/primitives/command.d.ts",
|
|
165
169
|
"import": "./dist/primitives/command.js"
|
|
@@ -775,6 +779,10 @@
|
|
|
775
779
|
"types": "./dist/primitives/glyph-tint.d.ts",
|
|
776
780
|
"import": "./dist/primitives/glyph-tint.js"
|
|
777
781
|
},
|
|
782
|
+
"./gradient-wallpaper": {
|
|
783
|
+
"types": "./dist/primitives/gradient-wallpaper.d.ts",
|
|
784
|
+
"import": "./dist/primitives/gradient-wallpaper.js"
|
|
785
|
+
},
|
|
778
786
|
"./hint": {
|
|
779
787
|
"types": "./dist/primitives/hint.d.ts",
|
|
780
788
|
"import": "./dist/primitives/hint.js"
|
|
@@ -1976,10 +1984,6 @@
|
|
|
1976
1984
|
"types": "./dist/primitives/toast.d.ts",
|
|
1977
1985
|
"import": "./dist/primitives/toast.js"
|
|
1978
1986
|
},
|
|
1979
|
-
"./toast-clearance": {
|
|
1980
|
-
"types": "./dist/primitives/toast-clearance.d.ts",
|
|
1981
|
-
"import": "./dist/primitives/toast-clearance.js"
|
|
1982
|
-
},
|
|
1983
1987
|
"./toggle": {
|
|
1984
1988
|
"types": "./dist/primitives/toggle.d.ts",
|
|
1985
1989
|
"import": "./dist/primitives/toggle.js"
|
|
@@ -2145,9 +2149,9 @@
|
|
|
2145
2149
|
"types": "./dist/workspace/settings/use-leave-workspace.d.ts",
|
|
2146
2150
|
"import": "./dist/workspace/settings/use-leave-workspace.js"
|
|
2147
2151
|
},
|
|
2148
|
-
"./workspace/setup/workspace-setup-
|
|
2149
|
-
"types": "./dist/workspace/setup/workspace-setup-
|
|
2150
|
-
"import": "./dist/workspace/setup/workspace-setup-
|
|
2152
|
+
"./workspace/setup/workspace-setup-modal": {
|
|
2153
|
+
"types": "./dist/workspace/setup/workspace-setup-modal.d.ts",
|
|
2154
|
+
"import": "./dist/workspace/setup/workspace-setup-modal.js"
|
|
2151
2155
|
},
|
|
2152
2156
|
"./workspace/sidebar/footer/project-apps-nav": {
|
|
2153
2157
|
"types": "./dist/workspace/sidebar/footer/project-apps-nav.d.ts",
|
|
@@ -2262,7 +2266,7 @@
|
|
|
2262
2266
|
"@extend-ai/react-docx": "^0.7.5",
|
|
2263
2267
|
"@extend-ai/react-xlsx": "0.13.4",
|
|
2264
2268
|
"@glideapps/glide-data-grid": "6.0.4-alpha24",
|
|
2265
|
-
"@kortix/llm-catalog": "0.16.
|
|
2269
|
+
"@kortix/llm-catalog": "0.16.5",
|
|
2266
2270
|
"@lezer/highlight": "1.2.3",
|
|
2267
2271
|
"@paper-design/shaders-react": "^0.0.76",
|
|
2268
2272
|
"@phosphor-icons/react": "2.1.10",
|
|
@@ -2338,7 +2342,7 @@
|
|
|
2338
2342
|
"zustand": "^5.0.3"
|
|
2339
2343
|
},
|
|
2340
2344
|
"peerDependencies": {
|
|
2341
|
-
"@kortix/sdk": "^0.16.
|
|
2345
|
+
"@kortix/sdk": "^0.16.5",
|
|
2342
2346
|
"@tanstack/react-query": "^5.75.2",
|
|
2343
2347
|
"@types/react": ">=18",
|
|
2344
2348
|
"react": ">=19",
|
|
@@ -89,7 +89,7 @@ Theme with `@kortix/ui/theme`, never by forking a component: `themeToCss(theme)`
|
|
|
89
89
|
| `@kortix/ui` (navigation) | `FilterBar`, `FilterBarItem`, `Tabs`, `TabsContent`, `TabsList`, `TabsTrigger`, `tabsTriggerHeightVariants`, `tabsTriggerPaddingVariants`, `tabsTriggerTextVariants`, `TabsListType`, `TabsSize`, `TabsTriggerSize`, `TabsTriggerVariant`, `TabsUnderlineSize` |
|
|
90
90
|
| `@kortix/ui` (conversation) | `Bubble`, `BubbleContent`, `BubbleGroup`, `BubbleReactions`, `bubbleVariants`, `Message`, `MessageAvatar`, `MessageContent`, `MessageFooter`, `MessageGroup`, `MessageHeader`, `Marker`, `MarkerContent`, `MarkerIcon`, `markerVariants` |
|
|
91
91
|
| `@kortix/ui` (hooks, helpers) | `UiLink`, `UiImage`, `useUiViewer`, `UiViewer`, `UiHostComponents`, `UiPreviewUrlResolver`, `UiPreviewRequest`, `useDebounce`, `useIsMobile`, `useMediaQuery`, `useSlashFocus`, `lazyClient`, `spring`, `floatingZ`, `dialogContentZ`, `dialogOverlayZ`, `useDialogDepth`, `hasOpenFloatingLayer`, `hasOpenNestedDialog`, `DEFAULT_ICON_WEIGHT`, `ICON_WEIGHTS`, `SHIPPED_ICON_WEIGHTS`, `faviconUrlForHostname`, `setUiTelemetry`, `setUiHostEnv`, `setUiRoutes`, `uiRoutes`, `newSessionHref`, `isNewSessionRequested`, `defaultUiRoutes`, `decodeSpaceSegment`, `UiRoutes` |
|
|
92
|
-
| `@kortix/ui/theme` | `KortixTheme`, `themeToCss`, `themeToCssVars`, `ThemeScope`, `ThemeScopeProps`, `THEME_COLOR_VARS`, `ThemeColor`, `ThemeColors`, `ThemeCssVars`, `ThemeTextStep`, `ThemeShadowStep`, `ThemeDurationStep`, `ThemeEasing`, `WALLPAPERS`, `DEFAULT_WALLPAPER_ID`, `getWallpaperById`, `Wallpaper` |
|
|
92
|
+
| `@kortix/ui/theme` | `KortixTheme`, `themeToCss`, `themeToCssVars`, `ThemeScope`, `ThemeScopeProps`, `THEME_COLOR_VARS`, `ThemeColor`, `ThemeColors`, `ThemeCssVars`, `ThemeTextStep`, `ThemeShadowStep`, `ThemeDurationStep`, `ThemeEasing`, `WALLPAPERS`, `DEFAULT_WALLPAPER_ID`, `getWallpaperById`, `Wallpaper`, `getSelectableWallpaper`, `PickerWallpaper`, `PickerWallpaperId`, `GRADIENT_PRESETS`, `GRADIENT_PATTERNS`, `GRADIENT_FINISHES`, `GRADIENT_MIN_COLORS`, `GRADIENT_MAX_COLORS`, `GradientConfig`, `GradientPattern`, `GradientFinish`, `GradientWallpaperId`, `gradientColors`, `CUSTOM_PALETTES`, `CUSTOM_COLOR_PRESETS`, `DEFAULT_CUSTOM_WALLPAPER`, `CustomWallpaperConfig`, `customGradientConfig`, `normalizeCustomWallpaper`, `nextCustomColor`, `randomCustomColors`, `randomCustomWallpaper`, `PresetOverride`, `PresetOverrides`, `normalizePresetOverrides`, `presetWithOverride`, `DEFAULT_WALLPAPER_OPACITY`, `OPACITY_LIMITS` |
|
|
93
93
|
| `@kortix/ui/session` (whole thread) | `SessionThread`, `SessionThreadProps` |
|
|
94
94
|
| `@kortix/ui/session` (blocks) | `UserMessage`, `ThrottledMarkdown`, `UnifiedMarkdown`, `UnifiedMarkdownProps`, `ToolPartRenderer`, `SessionChatInput`, `SessionChatInputProps`, `AgentSelector`, `ModelSelector`, `ModelSelectorProps`, `SessionPermissionPrompt`, `QuestionPrompt`, `QuestionPromptHandle`, `TurnErrorDisplay`, `SessionBusyIndicator`, `SessionStartingLoader` |
|
|
95
95
|
| `@kortix/ui/session` (tool rows, pickers) | `ToolRegistry`, `ToolProps`, `ToolComponent`, `BasicTool`, `BasicToolProps`, `GenericTool`; for a form outside a session: `ModelSelector`, `AgentSelector` |
|
|
@@ -37,6 +37,8 @@ Names: `Close`, `Copy`, `SidebarGlyph`, `SolidRightArrow`
|
|
|
37
37
|
## `@kortix/ui/theme`
|
|
38
38
|
|
|
39
39
|
Source: `src/theme/index.ts`. White-label theming: tokens to CSS, a themed subtree, the session wallpapers.
|
|
40
|
+
The colored wallpapers are data (`src/theme/wallpaper-gradients.ts`): a `GradientConfig` is a pattern, a finish
|
|
41
|
+
and a palette; `normalizeCustomWallpaper` and `normalizePresetOverrides` clean a saved setting.
|
|
40
42
|
|
|
41
43
|
Props: `ThemeScope`: `theme`, `className`, any `div` prop. `themeToCss(theme, selector?)`. Every key: `theming.md`.
|
|
42
44
|
|
|
@@ -52,7 +54,7 @@ export function Preview({ children }: { children: ReactNode }) {
|
|
|
52
54
|
}
|
|
53
55
|
```
|
|
54
56
|
|
|
55
|
-
Names: `THEME_COLOR_VARS`, `themeToCss`, `themeToCssVars`, `KortixTheme`, `ThemeColor`, `ThemeColors`, `ThemeCssVars`, `ThemeDurationStep`, `ThemeEasing`, `ThemeShadowStep`, `ThemeTextStep`, `ThemeScope`, `ThemeScopeProps`, `DEFAULT_WALLPAPER_ID`, `WALLPAPERS`, `getWallpaperById`, `Wallpaper`
|
|
57
|
+
Names: `THEME_COLOR_VARS`, `themeToCss`, `themeToCssVars`, `KortixTheme`, `ThemeColor`, `ThemeColors`, `ThemeCssVars`, `ThemeDurationStep`, `ThemeEasing`, `ThemeShadowStep`, `ThemeTextStep`, `ThemeScope`, `ThemeScopeProps`, `DEFAULT_WALLPAPER_ID`, `WALLPAPERS`, `getWallpaperById`, `Wallpaper`, `getSelectableWallpaper`, `PickerWallpaper`, `PickerWallpaperId`, `GRADIENT_PRESETS`, `GRADIENT_PATTERNS`, `GRADIENT_FINISHES`, `GRADIENT_MIN_COLORS`, `GRADIENT_MAX_COLORS`, `GradientConfig`, `GradientPattern`, `GradientFinish`, `GradientWallpaperId`, `gradientColors`, `CUSTOM_PALETTES`, `CUSTOM_COLOR_PRESETS`, `DEFAULT_CUSTOM_WALLPAPER`, `CustomWallpaperConfig`, `customGradientConfig`, `normalizeCustomWallpaper`, `nextCustomColor`, `randomCustomColors`, `randomCustomWallpaper`, `PresetOverride`, `PresetOverrides`, `normalizePresetOverrides`, `presetWithOverride`, `DEFAULT_WALLPAPER_OPACITY`, `OPACITY_LIMITS`
|
|
56
58
|
|
|
57
59
|
## `@kortix/ui/i18n`
|
|
58
60
|
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { type RefObject } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Keeps bottom-right toasts clear of a composer docked at the bottom of the
|
|
4
|
-
* window. The app's `<Toaster>` reads its bottom offset from
|
|
5
|
-
* `--toast-offset-bottom` (`apps/web/src/app/[locale]/layout.tsx`); a docked
|
|
6
|
-
* composer sets that variable to the distance from its top edge to the window
|
|
7
|
-
* bottom while it reaches into the toast lane. Before this, a toast covered the
|
|
8
|
-
* session composer's Send/Stop button (dev audit, 2026-11-14).
|
|
9
|
-
*
|
|
10
|
-
* Toasts always stay in the window's bottom-right corner. They never follow
|
|
11
|
-
* the composer sideways: right-aligning them with the composer pinned them
|
|
12
|
-
* inside the chat column, away from the corner.
|
|
13
|
-
*/
|
|
14
|
-
export declare const TOAST_OFFSET_VAR = "--toast-offset-bottom";
|
|
15
|
-
/** The element whose resize moves a docked composer (the chat column). */
|
|
16
|
-
export declare const TOAST_ANCHOR_ATTR = "data-toast-anchor";
|
|
17
|
-
export interface ClearanceRect {
|
|
18
|
-
top: number;
|
|
19
|
-
bottom: number;
|
|
20
|
-
left: number;
|
|
21
|
-
right: number;
|
|
22
|
-
width: number;
|
|
23
|
-
height: number;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* The bottom offset that puts a corner toast just above `rect`, or 0 when the
|
|
27
|
-
* element is hidden, not docked at the window bottom, or entirely left of the
|
|
28
|
-
* toast lane (the window's right 380px). A tall composer (long draft,
|
|
29
|
-
* attachments) still counts: only its bottom edge says whether it is docked.
|
|
30
|
-
*/
|
|
31
|
-
export declare function toastClearance(rect: ClearanceRect, viewport: {
|
|
32
|
-
width: number;
|
|
33
|
-
height: number;
|
|
34
|
-
}): number;
|
|
35
|
-
/** Registers `ref`'s element as a docked composer while `active`. */
|
|
36
|
-
export declare function useToastClearance(ref: RefObject<HTMLElement | null>, active: boolean): void;
|