@kortix/ui 0.15.8 → 0.15.10
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 +75 -1
- package/dist/_vendor/shared/index.d.ts +1 -0
- package/dist/_vendor/shared/session/attachment-tile.d.ts +32 -0
- package/dist/_vendor/shared/session/stop-refusal.d.ts +15 -0
- package/dist/_vendor/shared/session/tool-row-text.d.ts +58 -0
- package/dist/_vendor/shared/session-delivery.d.ts +2 -0
- package/dist/access/access/access-dialog-share.js +12 -6
- package/dist/access/access/share-selection.d.ts +9 -0
- package/dist/access/access/share-selection.js +64 -0
- package/dist/customize/connectors/connector-identity.js +3 -3
- package/dist/customize/connectors/connectors-page.js +1 -1
- package/dist/customize/connectors/detail/app-page.js +2 -2
- package/dist/customize/connectors/detail/connector-accounts.d.ts +3 -1
- package/dist/customize/connectors/detail/connector-accounts.js +2 -2
- package/dist/customize/connectors/detail/connector-notice-view.d.ts +4 -0
- package/dist/customize/connectors/detail/connector-notice-view.js +4 -0
- package/dist/customize/connectors/detail/connector-notice.d.ts +31 -4
- package/dist/customize/connectors/detail/connector-notice.js +23 -4
- package/dist/customize/connectors/detail/connector-page.js +35 -10
- package/dist/customize/connectors/detail/connector-status.d.ts +12 -1
- package/dist/customize/connectors/detail/connector-status.js +11 -0
- package/dist/customize/connectors/detail/status-badge.d.ts +3 -3
- package/dist/customize/connectors/detail/status-badge.js +2 -1
- package/dist/customize/connectors/detail/use-connector-detail.js +10 -2
- package/dist/customize/connectors/detail/use-mcp-oauth-sign-in.d.ts +13 -0
- package/dist/customize/connectors/detail/use-mcp-oauth-sign-in.js +29 -0
- package/dist/customize/connectors/install/use-install.js +1 -1
- package/dist/customize/providers/provider-accordion.js +9 -8
- package/dist/customize/providers/provider-connect.d.ts +3 -3
- package/dist/customize/providers/provider-connect.js +10 -16
- package/dist/customize/providers/provider-sheet.js +13 -8
- package/dist/customize/sections/component/email-connect-form.js +4 -2
- package/dist/customize/sections/connector-connection-form.d.ts +0 -1
- package/dist/customize/sections/connector-connection-form.js +0 -9
- package/dist/customize/sections/connectors-view.d.ts +4 -1
- package/dist/customize/sections/connectors-view.js +42 -7
- package/dist/customize/sections/view/account-secret-resources-panel.d.ts +15 -0
- package/dist/customize/sections/view/account-secret-resources-panel.js +44 -5
- package/dist/customize/sections/view/review-center-connected.js +7 -3
- package/dist/customize/sections/view/secret-delivery.d.ts +9 -2
- package/dist/customize/sections/view/secret-delivery.js +14 -4
- package/dist/customize/sections/view/secrets-view.js +21 -5
- package/dist/customize/settings/tabs/workspace-keys.js +53 -11
- package/dist/customize/shared/feature-gate-screen.js +1 -1
- package/dist/customize/triggers/schedule/event-account-picker.js +1 -1
- package/dist/customize/triggers/schedule/schedule-builder.js +1 -1
- package/dist/customize/triggers/schedule/schedule-copy.js +4 -0
- package/dist/customize/triggers/schedule/schedule-detail-sheet.js +14 -3
- package/dist/customize/triggers/schedule/then-fields.d.ts +3 -1
- package/dist/customize/triggers/schedule/then-fields.js +8 -4
- package/dist/customize/triggers/schedule/trigger-composer.js +1 -1
- package/dist/customize/triggers/schedule/trigger-list.d.ts +3 -1
- package/dist/customize/triggers/schedule/trigger-list.js +18 -2
- package/dist/customize/triggers/schedule/trigger-runs-logic.js +4 -2
- package/dist/customize/triggers/schedule/trigger-runs-panel.js +4 -1
- package/dist/customize/triggers/schedule/use-event-app-connect.js +2 -1
- package/dist/files/renderers/pptx-renderer.js +5 -20
- package/dist/files/renderers/presentation/FullScreenPresentationViewer.d.ts +3 -2
- package/dist/files/renderers/presentation/FullScreenPresentationViewer.js +23 -304
- package/dist/files/renderers/presentation/presentation-export-menu.d.ts +14 -0
- package/dist/files/renderers/presentation/presentation-export-menu.js +44 -0
- package/dist/files/renderers/presentation/presentation-utils.d.ts +1 -0
- package/dist/files/renderers/presentation/presentation-utils.js +4 -0
- package/dist/files/renderers/presentation/slide-iframe.d.ts +23 -0
- package/dist/files/renderers/presentation/slide-iframe.js +61 -0
- package/dist/files/renderers/presentation/use-presentation-metadata.d.ts +39 -0
- package/dist/files/renderers/presentation/use-presentation-metadata.js +137 -0
- package/dist/files/renderers/presentation/use-slide-navigation.d.ts +17 -0
- package/dist/files/renderers/presentation/use-slide-navigation.js +82 -0
- package/dist/files/renderers/shared/use-stage-fit-scale.d.ts +19 -0
- package/dist/files/renderers/shared/use-stage-fit-scale.js +41 -0
- package/dist/files/renderers/show-content-renderer.js +16 -11
- package/dist/files/renderers/xlsx/xlsx-renderer.d.ts +4 -13
- package/dist/files/renderers/xlsx/xlsx-renderer.js +6 -63
- package/dist/files/renderers/xlsx/xlsx-viewer.d.ts +4 -2
- package/dist/files/renderers/xlsx/xlsx-viewer.js +28 -34
- package/dist/files/viewer/file-content-renderer.js +1 -4
- package/dist/files/viewer/use-file-content-state.js +10 -9
- package/dist/i18n/en.d.ts +55 -7
- package/dist/i18n/en.js +59 -11
- package/dist/internal/billing/compute-pricing.d.ts +7 -1
- package/dist/internal/billing/compute-pricing.js +7 -1
- package/dist/internal/chrome/use-chrome-offered.d.ts +2 -1
- package/dist/internal/chrome/use-chrome-offered.js +4 -2
- package/dist/internal/hooks/connectors/invalidate-connections.d.ts +10 -0
- package/dist/internal/hooks/connectors/invalidate-connections.js +18 -0
- package/dist/internal/hooks/connectors/use-finish-sign-in.d.ts +13 -0
- package/dist/internal/hooks/connectors/use-finish-sign-in.js +33 -0
- package/dist/internal/hooks/connectors/use-pipedream-connect-member.js +6 -1
- package/dist/internal/hooks/connectors/use-pipedream-connect-project.js +6 -1
- package/dist/internal/hooks/projects/use-new-project-session.d.ts +2 -0
- package/dist/internal/hooks/projects/use-new-project-session.js +4 -1
- 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/lib/browser-noise/rules/injected-scripts.js +2 -2
- package/dist/internal/lib/error-handler.js +33 -0
- package/dist/internal/lib/trigger-clock.d.ts +7 -2
- package/dist/internal/lib/trigger-clock.js +17 -3
- package/dist/internal/notifications/notification-inbox.d.ts +4 -10
- package/dist/internal/notifications/notification-inbox.js +8 -9
- package/dist/internal/stores/connector-gate-store.d.ts +3 -1
- package/dist/internal/stores/connector-gate-store.js +13 -3
- package/dist/internal/stores/upgrade-dialog-store.d.ts +4 -0
- package/dist/internal/stores/upgrade-dialog-store.js +2 -0
- package/dist/lib/routes.d.ts +4 -11
- package/dist/lib/routes.js +3 -5
- package/dist/lib/z-stack.d.ts +5 -1
- package/dist/lib/z-stack.js +12 -2
- package/dist/markdown/unified-markdown-utils.d.ts +7 -0
- package/dist/markdown/unified-markdown-utils.js +19 -0
- package/dist/markdown/unified-markdown.js +16 -3
- package/dist/primitives/alert-dialog.js +1 -1
- package/dist/primitives/dialog.js +3 -1
- package/dist/primitives/drawer.js +1 -1
- package/dist/primitives/modal.js +1 -1
- package/dist/primitives/preview-image.js +1 -1
- package/dist/primitives/sheet.js +1 -1
- package/dist/session/composer/ComposerCard.js +4 -2
- package/dist/session/composer/attachment-tile.d.ts +2 -26
- package/dist/session/composer/attachment-tile.js +3 -47
- package/dist/session/composer/composer-chat-input.d.ts +2 -1
- package/dist/session/composer/composer-chat-input.js +2 -2
- package/dist/session/composer/composer.d.ts +2 -0
- package/dist/session/composer/composer.js +5 -8
- package/dist/session/composer/draft/home-composer-focus-handoff.d.ts +7 -0
- package/dist/session/composer/draft/home-composer-focus-handoff.js +94 -0
- package/dist/session/composer/draft/use-composer-draft.d.ts +3 -1
- package/dist/session/composer/draft/use-composer-draft.js +22 -2
- package/dist/session/composer/editor/composer-editor.d.ts +4 -2
- package/dist/session/composer/editor/composer-editor.js +7 -3
- package/dist/session/composer/hooks/use-composer-focus.js +4 -2
- package/dist/session/index.d.ts +1 -0
- package/dist/session/index.js +1 -0
- package/dist/session/models/chatgpt-connection-button.js +5 -9
- package/dist/session/models/model-connection-gate.d.ts +2 -1
- package/dist/session/models/model-connection-gate.js +21 -5
- package/dist/session/models/model-connection-layout.d.ts +2 -0
- package/dist/session/models/model-connection-layout.js +4 -0
- package/dist/session/models/model-picker-panel.js +6 -2
- package/dist/session/models/model-selector.d.ts +1 -1
- package/dist/session/models/model-selector.js +9 -6
- package/dist/session/models/provider-key-action.d.ts +10 -0
- package/dist/session/models/provider-key-action.js +35 -0
- package/dist/session/models/provider-key-slot.d.ts +9 -0
- package/dist/session/models/provider-key-slot.js +19 -0
- package/dist/session/models/subscription-offer.d.ts +4 -0
- package/dist/session/models/subscription-offer.js +11 -3
- package/dist/session/overrides/session-overrides-toolbar.js +2 -4
- package/dist/session/prompts/ask-deck.d.ts +5 -1
- package/dist/session/prompts/ask-deck.js +15 -3
- package/dist/session/prompts/question-labels.d.ts +16 -0
- package/dist/session/prompts/question-labels.js +34 -0
- package/dist/session/prompts/question-prompt.js +6 -6
- package/dist/session/prompts/session-connect-prompt.d.ts +40 -0
- package/dist/session/prompts/session-connect-prompt.js +126 -0
- package/dist/session/status/provisioning-failure.d.ts +23 -2
- package/dist/session/status/provisioning-failure.js +53 -3
- package/dist/session/status/session-error-banner.d.ts +1 -1
- package/dist/session/status/session-error-banner.js +12 -4
- package/dist/session/status/stop-refusal.d.ts +6 -12
- package/dist/session/status/stop-refusal.js +6 -19
- package/dist/session/thread/agent-run-props.d.ts +19 -0
- package/dist/session/thread/agent-run-props.js +54 -0
- package/dist/session/thread/session-chat.js +34 -6
- package/dist/session/thread/transcript.d.ts +17 -1
- package/dist/session/thread/transcript.js +104 -16
- package/dist/session/tool/tools/bash-tool.d.ts +3 -52
- package/dist/session/tool/tools/bash-tool.js +3 -86
- package/dist/session/turn/answer-streaming.d.ts +21 -0
- package/dist/session/turn/answer-streaming.js +34 -0
- package/dist/session/turn/queued-prompt-bubbles.d.ts +5 -0
- package/dist/session/turn/queued-prompt-bubbles.js +12 -0
- package/dist/session/turn/turn-work-accordion.d.ts +3 -1
- package/dist/session/turn/turn-work-accordion.js +2 -2
- package/dist/styles.css +1 -1
- package/dist/test-utils/intl.d.ts +55 -7
- package/dist/workspace/home/first-chat.d.ts +7 -1
- package/dist/workspace/home/first-chat.js +12 -5
- package/dist/workspace/inbox/workspace-inbox.d.ts +6 -16
- package/dist/workspace/inbox/workspace-inbox.js +9 -51
- package/dist/workspace/layout/project-home.js +5 -11
- package/dist/workspace/layout/use-project-home-send.d.ts +2 -0
- package/dist/workspace/layout/use-project-home-send.js +29 -15
- package/dist/workspace/new/advanced-fields.d.ts +4 -1
- package/dist/workspace/new/advanced-fields.js +2 -2
- package/dist/workspace/new/workspace-name.d.ts +9 -0
- package/dist/workspace/new/workspace-name.js +20 -0
- package/dist/workspace/projects/session-starter.d.ts +6 -4
- package/dist/workspace/projects/session-starter.js +8 -14
- package/dist/workspace/review/review-center.d.ts +6 -2
- package/dist/workspace/review/review-center.js +45 -25
- package/dist/workspace/sidebar/workspace-menu-model.d.ts +3 -5
- package/dist/workspace/sidebar/workspace-menu-model.js +1 -1
- package/package.json +3 -7
- package/skills/kortix-ui/references/modules.md +1 -1
- package/dist/customize/connectors/invalidate-connections.d.ts +0 -2
- package/dist/customize/connectors/invalidate-connections.js +0 -4
- package/dist/internal/notifications/use-inbox-summary.d.ts +0 -17
- package/dist/internal/notifications/use-inbox-summary.js +0 -28
|
@@ -107,6 +107,14 @@ export declare const testUiTranslator: import("use-intl")._Translator<{
|
|
|
107
107
|
access: string;
|
|
108
108
|
actions: string;
|
|
109
109
|
coolingDown: string;
|
|
110
|
+
keyVerified: string;
|
|
111
|
+
keyInvalid: string;
|
|
112
|
+
keyUnchecked: string;
|
|
113
|
+
checkKey: string;
|
|
114
|
+
savedVerified: string;
|
|
115
|
+
savedInvalid: string;
|
|
116
|
+
checkError: string;
|
|
117
|
+
openProviderInModels: string;
|
|
110
118
|
member: string;
|
|
111
119
|
members: string;
|
|
112
120
|
actionsFor: string;
|
|
@@ -179,6 +187,9 @@ export declare const testUiTranslator: import("use-intl")._Translator<{
|
|
|
179
187
|
claudeReconnectDescription: string;
|
|
180
188
|
claudeAccountLabelPlaceholder: string;
|
|
181
189
|
claudeDeleteAccountConfirmTitle: string;
|
|
190
|
+
sharedOnlyYouDescription: string;
|
|
191
|
+
oauthOnlyYouDescription: string;
|
|
192
|
+
claudeOauthOnlyYouDescription: string;
|
|
182
193
|
};
|
|
183
194
|
secrets: {
|
|
184
195
|
undecryptable: {
|
|
@@ -286,6 +297,7 @@ export declare const testUiTranslator: import("use-intl")._Translator<{
|
|
|
286
297
|
repositoryLabel: string;
|
|
287
298
|
loadingOptions: string;
|
|
288
299
|
managedUnavailable: string;
|
|
300
|
+
githubAfterCreate: string;
|
|
289
301
|
installationUnreachable: string;
|
|
290
302
|
reconnect: string;
|
|
291
303
|
managedImportLabel: string;
|
|
@@ -793,10 +805,6 @@ export declare const testUiTranslator: import("use-intl")._Translator<{
|
|
|
793
805
|
name: string;
|
|
794
806
|
description: string;
|
|
795
807
|
};
|
|
796
|
-
pooled_provider_secrets: {
|
|
797
|
-
name: string;
|
|
798
|
-
description: string;
|
|
799
|
-
};
|
|
800
808
|
reminders: {
|
|
801
809
|
name: string;
|
|
802
810
|
description: string;
|
|
@@ -1497,6 +1505,10 @@ export declare const testUiTranslator: import("use-intl")._Translator<{
|
|
|
1497
1505
|
connectModel: string;
|
|
1498
1506
|
imagesUnsupported: string;
|
|
1499
1507
|
imagesUnsupportedHint: string;
|
|
1508
|
+
noModelUpgradeReason: string;
|
|
1509
|
+
noModelKeyReason: string;
|
|
1510
|
+
noModelUpgradePlan: string;
|
|
1511
|
+
noModelAddProviderKey: string;
|
|
1500
1512
|
};
|
|
1501
1513
|
providerRecovery: {
|
|
1502
1514
|
savedPrompt: string;
|
|
@@ -1554,6 +1566,7 @@ export declare const testUiTranslator: import("use-intl")._Translator<{
|
|
|
1554
1566
|
agentWorkingOnFor: string;
|
|
1555
1567
|
somethingWrong: string;
|
|
1556
1568
|
notSent: string;
|
|
1569
|
+
computerDisconnected: string;
|
|
1557
1570
|
retry: string;
|
|
1558
1571
|
resume: string;
|
|
1559
1572
|
agentIsWorking: string;
|
|
@@ -2174,9 +2187,6 @@ export declare const testUiTranslator: import("use-intl")._Translator<{
|
|
|
2174
2187
|
};
|
|
2175
2188
|
inbox: {
|
|
2176
2189
|
title: string;
|
|
2177
|
-
viewReview: string;
|
|
2178
|
-
viewNotifications: string;
|
|
2179
|
-
viewLabel: string;
|
|
2180
2190
|
description: string;
|
|
2181
2191
|
unreadLabel: string;
|
|
2182
2192
|
unreadCount: string;
|
|
@@ -2702,6 +2712,8 @@ export declare const testUiTranslator: import("use-intl")._Translator<{
|
|
|
2702
2712
|
checkConnection: string;
|
|
2703
2713
|
};
|
|
2704
2714
|
i18nComplete: {
|
|
2715
|
+
noModelAddProviderKey: string;
|
|
2716
|
+
noModelUpgradePlan: string;
|
|
2705
2717
|
text03217276a5f1: string;
|
|
2706
2718
|
text0b6a47661327: string;
|
|
2707
2719
|
text1a9030082a20: string;
|
|
@@ -6843,6 +6855,12 @@ export declare const testUiTranslator: import("use-intl")._Translator<{
|
|
|
6843
6855
|
noticeSignInTitle: string;
|
|
6844
6856
|
noticeSignInBody: string;
|
|
6845
6857
|
noticeSignInAction: string;
|
|
6858
|
+
noticeSignInAgainTitle: string;
|
|
6859
|
+
noticeSignInAgainBody: string;
|
|
6860
|
+
noticeNoToolsTitle: string;
|
|
6861
|
+
noticeNoToolsBody: string;
|
|
6862
|
+
noticeAddRoutesAction: string;
|
|
6863
|
+
statusNoTools: string;
|
|
6846
6864
|
connectAccount: string;
|
|
6847
6865
|
notSignedIn: string;
|
|
6848
6866
|
credentialRejected: string;
|
|
@@ -7860,6 +7878,12 @@ export declare const testUiTranslator: import("use-intl")._Translator<{
|
|
|
7860
7878
|
triggerAutoPause: {
|
|
7861
7879
|
title: string;
|
|
7862
7880
|
description: string;
|
|
7881
|
+
billingTitle: string;
|
|
7882
|
+
billingDescription: string;
|
|
7883
|
+
modelTitle: string;
|
|
7884
|
+
modelDescription: string;
|
|
7885
|
+
listBilling: string;
|
|
7886
|
+
listModel: string;
|
|
7863
7887
|
};
|
|
7864
7888
|
featureGate: {
|
|
7865
7889
|
enable: string;
|
|
@@ -10001,6 +10025,10 @@ export declare const testUiTranslator: import("use-intl")._Translator<{
|
|
|
10001
10025
|
actsAsAgent: string;
|
|
10002
10026
|
actsAsBot: string;
|
|
10003
10027
|
actsAsMeHint: string;
|
|
10028
|
+
worksIn: string;
|
|
10029
|
+
worksInAll: string;
|
|
10030
|
+
worksInAllHint: string;
|
|
10031
|
+
worksInWorkspace: string;
|
|
10004
10032
|
actsAsAgentHint: string;
|
|
10005
10033
|
actsAsBotHint: string;
|
|
10006
10034
|
needsPermission: string;
|
|
@@ -10019,6 +10047,7 @@ export declare const testUiTranslator: import("use-intl")._Translator<{
|
|
|
10019
10047
|
rowBot: string;
|
|
10020
10048
|
createdBy: string;
|
|
10021
10049
|
createdDescription: string;
|
|
10050
|
+
createdPersonalDescription: string;
|
|
10022
10051
|
accessFullHint: string;
|
|
10023
10052
|
accessCustomHint: string;
|
|
10024
10053
|
};
|
|
@@ -10092,6 +10121,25 @@ export declare const testUiTranslator: import("use-intl")._Translator<{
|
|
|
10092
10121
|
capWorkspace: string;
|
|
10093
10122
|
capMember: string;
|
|
10094
10123
|
};
|
|
10124
|
+
connectSignIn: {
|
|
10125
|
+
openSignIn: string;
|
|
10126
|
+
checkingTitle: string;
|
|
10127
|
+
checkingDescription: string;
|
|
10128
|
+
signInUnfinished: string;
|
|
10129
|
+
finishSignIn: string;
|
|
10130
|
+
signInFinished: string;
|
|
10131
|
+
cardHeadline: string;
|
|
10132
|
+
cardTitle: string;
|
|
10133
|
+
cardShared: string;
|
|
10134
|
+
cardPrivate: string;
|
|
10135
|
+
signingIn: string;
|
|
10136
|
+
connectedAs: string;
|
|
10137
|
+
connected: string;
|
|
10138
|
+
connect: string;
|
|
10139
|
+
cardFailed: string;
|
|
10140
|
+
blockedTitle: string;
|
|
10141
|
+
blockedDescription: string;
|
|
10142
|
+
};
|
|
10095
10143
|
}, "hardcodedUi.i18nComplete">;
|
|
10096
10144
|
export declare function IntlTestProvider({ children, locale, timeZone, messages, fallback, ...rest }: Partial<IntlConfig> & {
|
|
10097
10145
|
children: ReactNode;
|
|
@@ -18,9 +18,15 @@ import { type ReactNode } from 'react';
|
|
|
18
18
|
* (`project-home.tsx`); the agent's guided setup does the connecting and
|
|
19
19
|
* inviting the items describe.
|
|
20
20
|
*
|
|
21
|
+
* The "Connect ChatGPT" and "Connect Claude" tiles sit directly above the
|
|
22
|
+
* composer (`ModelConnectionLayoutContext`): with no model they are the
|
|
23
|
+
* composer's own `ModelConnectionBar`, with a model they are the dismissible
|
|
24
|
+
* `SubscriptionOffer`. Every other composer keeps them below.
|
|
25
|
+
*
|
|
21
26
|
* The welcome fades in once, over 300ms. It is opacity only, so reduced motion
|
|
22
27
|
* needs no other variant.
|
|
23
28
|
*/
|
|
24
|
-
export declare function FirstChat({ composer }: {
|
|
29
|
+
export declare function FirstChat({ projectId, composer }: {
|
|
30
|
+
projectId: string;
|
|
25
31
|
composer: ReactNode;
|
|
26
32
|
}): import("react").JSX.Element;
|
|
@@ -3,6 +3,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { AppWindowIcon, BriefcaseIcon, ChatsCircleIcon, ClockIcon, GrainsIcon, PlugsConnectedIcon, } from '@phosphor-icons/react';
|
|
4
4
|
import { useId } from 'react';
|
|
5
5
|
import { useUiViewer } from '../../providers/ui-provider.js';
|
|
6
|
+
import { ModelConnectionLayoutContext } from '../../session/models/model-connection-layout.js';
|
|
7
|
+
import { SubscriptionOffer } from '../../session/models/subscription-offer.js';
|
|
6
8
|
import { SESSION_TRANSCRIPT_CLASS } from '../../session/thread/session-transcript-class.js';
|
|
7
9
|
import { useTranslations } from '../../i18n/index.js';
|
|
8
10
|
import { cn } from '../../internal/lib/utils.js';
|
|
@@ -35,17 +37,22 @@ const CAPABILITIES = [
|
|
|
35
37
|
* (`project-home.tsx`); the agent's guided setup does the connecting and
|
|
36
38
|
* inviting the items describe.
|
|
37
39
|
*
|
|
40
|
+
* The "Connect ChatGPT" and "Connect Claude" tiles sit directly above the
|
|
41
|
+
* composer (`ModelConnectionLayoutContext`): with no model they are the
|
|
42
|
+
* composer's own `ModelConnectionBar`, with a model they are the dismissible
|
|
43
|
+
* `SubscriptionOffer`. Every other composer keeps them below.
|
|
44
|
+
*
|
|
38
45
|
* The welcome fades in once, over 300ms. It is opacity only, so reduced motion
|
|
39
46
|
* needs no other variant.
|
|
40
47
|
*/
|
|
41
|
-
export function FirstChat({ composer }) {
|
|
48
|
+
export function FirstChat({ projectId, composer }) {
|
|
42
49
|
const t = useTranslations('firstChat');
|
|
43
50
|
const user = useUiViewer();
|
|
44
51
|
const name = firstNameOf(user?.metadata);
|
|
45
52
|
const headingId = useId();
|
|
46
53
|
const canId = useId();
|
|
47
|
-
return (_jsxs("div", { className: "relative z-10 flex min-h-0 flex-1 flex-col", children: [_jsx("div", { className: "min-h-0 flex-1 overflow-y-auto", children: _jsxs("section", { "aria-labelledby": headingId, className: cn(SESSION_TRANSCRIPT_CLASS,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
54
|
+
return (_jsx(ModelConnectionLayoutContext.Provider, { value: "above", children: _jsxs("div", { className: "relative z-10 flex min-h-0 flex-1 flex-col", children: [_jsx("div", { className: "min-h-0 flex-1 overflow-y-auto", children: _jsxs("section", { "aria-labelledby": headingId, className: cn(SESSION_TRANSCRIPT_CLASS,
|
|
55
|
+
// Below the floating sidebar toggle, and a little lower on wide
|
|
56
|
+
// screens where the column has room to breathe.
|
|
57
|
+
'flex flex-col gap-10 pt-16 pb-8 lg:pt-24', 'transition-opacity duration-(--duration-slow) ease-out starting:opacity-0'), children: [_jsxs("div", { className: "flex flex-col gap-3", children: [_jsx("h1", { id: headingId, className: "text-foreground text-2xl font-medium tracking-tight text-balance", children: name ? t('greeting', { name }) : t('greetingNoName') }), _jsx("p", { className: "text-muted-foreground max-w-prose text-base leading-7 text-pretty", children: t('intro') })] }), _jsxs("div", { className: "flex flex-col gap-4", children: [_jsx("h2", { id: canId, className: "text-foreground text-base font-medium", children: t('canTitle') }), _jsx("ul", { "aria-labelledby": canId, className: "grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3", children: CAPABILITIES.map(({ key, icon: Glyph }) => (_jsxs("li", { className: "border-border bg-popover flex flex-col gap-3 rounded-md border p-4", children: [_jsx("span", { className: "bg-muted text-foreground flex size-8 items-center justify-center rounded-sm", children: _jsx(Glyph, { className: "size-4", "aria-hidden": true }) }), _jsxs("span", { className: "flex flex-col gap-1", children: [_jsx("span", { className: "text-foreground text-sm leading-5 font-medium", children: t(`can.${key}.title`) }), _jsx("span", { className: "text-muted-foreground text-sm leading-5 text-pretty", children: t(`can.${key}.body`) })] })] }, key))) }), _jsx("p", { className: "text-muted-foreground text-sm leading-5 text-pretty", children: t('startHint') })] })] }) }), _jsx("div", { className: "relative z-10 mx-auto w-full max-w-210 shrink-0 pb-2 empty:hidden", children: _jsx(SubscriptionOffer, { projectId: projectId }) }), composer] }) }));
|
|
51
58
|
}
|
|
@@ -1,20 +1,10 @@
|
|
|
1
|
-
export type WorkspaceInboxView = 'review' | 'notifications';
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*
|
|
9
|
-
* (2026-11-08: "REVIEW & INBOX should be merged in 1"). Two tabs under one
|
|
10
|
-
* header:
|
|
11
|
-
*
|
|
12
|
-
* - **Review** — this workspace's Review Center: approvals, questions and
|
|
13
|
-
* change requests to act on. `?id=` opens one item, as `/review?id=` did.
|
|
14
|
-
* - **Notifications** — the person's notifications from every workspace.
|
|
15
|
-
*
|
|
16
|
-
* `/workspaces/<id>/review` redirects to `?view=review`. The workspace menu's
|
|
17
|
-
* Inbox row counts both tabs (`useInboxSummary`).
|
|
2
|
+
* /workspaces/[id]/inbox — this workspace's Review queue (KRTX-4799):
|
|
3
|
+
* approvals, questions and change requests to act on. `?id=` opens one item.
|
|
4
|
+
* The person's notifications are not here: they span every workspace, so a
|
|
5
|
+
* workspace page cannot scope them — they live on the person-level Inbox page
|
|
6
|
+
* (`/inbox`, KRTX-1742), which `AccountTopBar` and the workspace menu's Inbox
|
|
7
|
+
* row open. The sidebar's Review row (`uiRoutes().review`) opens this page.
|
|
18
8
|
*/
|
|
19
9
|
export declare function WorkspaceInbox({ projectId }: {
|
|
20
10
|
projectId: string;
|
|
@@ -1,61 +1,19 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
3
|
-
import { useNotificationInbox } from '@kortix/sdk/react';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
3
|
import { ReviewView } from '../../customize/sections/view/review-view.js';
|
|
5
4
|
import { useTranslations } from '../../i18n/index.js';
|
|
6
|
-
import { useReviewNeedsYouCount } from '../../internal/hooks/use-review-session-summary.js';
|
|
7
5
|
import { ProjectPageHeader } from '../../internal/layout/project-page-header.js';
|
|
8
|
-
import { NotificationInbox } from '../../internal/notifications/notification-inbox.js';
|
|
9
|
-
import { CountBadge } from '../../primitives/count-badge.js';
|
|
10
|
-
import { Tabs, TabsList, TabsTrigger } from '../../primitives/tabs.js';
|
|
11
|
-
import { useUiPathname, useUiRouter, useUiSearchParams, useUiViewerId } from '../../providers/ui-provider.js';
|
|
12
|
-
/** One underline tab: hugs its label and count, full title-bar height. */
|
|
13
|
-
const INBOX_TAB_CLASS = 'h-full w-fit flex-none gap-1.5 px-1';
|
|
14
6
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return itemId || reviewNeedsYou > 0 ? 'review' : 'notifications';
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* /workspaces/[id]/inbox — the one place for what waits on the person
|
|
25
|
-
* (2026-11-08: "REVIEW & INBOX should be merged in 1"). Two tabs under one
|
|
26
|
-
* header:
|
|
27
|
-
*
|
|
28
|
-
* - **Review** — this workspace's Review Center: approvals, questions and
|
|
29
|
-
* change requests to act on. `?id=` opens one item, as `/review?id=` did.
|
|
30
|
-
* - **Notifications** — the person's notifications from every workspace.
|
|
31
|
-
*
|
|
32
|
-
* `/workspaces/<id>/review` redirects to `?view=review`. The workspace menu's
|
|
33
|
-
* Inbox row counts both tabs (`useInboxSummary`).
|
|
7
|
+
* /workspaces/[id]/inbox — this workspace's Review queue (KRTX-4799):
|
|
8
|
+
* approvals, questions and change requests to act on. `?id=` opens one item.
|
|
9
|
+
* The person's notifications are not here: they span every workspace, so a
|
|
10
|
+
* workspace page cannot scope them — they live on the person-level Inbox page
|
|
11
|
+
* (`/inbox`, KRTX-1742), which `AccountTopBar` and the workspace menu's Inbox
|
|
12
|
+
* row open. The sidebar's Review row (`uiRoutes().review`) opens this page.
|
|
34
13
|
*/
|
|
35
14
|
export function WorkspaceInbox({ projectId }) {
|
|
36
|
-
const t = useTranslations('
|
|
37
|
-
const router = useUiRouter();
|
|
38
|
-
const pathname = useUiPathname();
|
|
39
|
-
const searchParams = useUiSearchParams();
|
|
40
|
-
const reviewNeedsYou = useReviewNeedsYouCount(projectId);
|
|
41
|
-
const unread = useNotificationInbox({ userId: useUiViewerId() }).unreadCount;
|
|
42
|
-
const view = workspaceInboxView(searchParams?.get('view') ?? null, searchParams?.get('id') ?? null, reviewNeedsYou);
|
|
43
|
-
const select = (next) => {
|
|
44
|
-
const query = new URLSearchParams(searchParams?.toString() ?? '');
|
|
45
|
-
query.set('view', next);
|
|
46
|
-
// An open Review item belongs to the Review tab.
|
|
47
|
-
if (next !== 'review')
|
|
48
|
-
query.delete('id');
|
|
49
|
-
router.replace(`${pathname ?? ''}?${query.toString()}`);
|
|
50
|
-
};
|
|
15
|
+
const t = useTranslations('sidebar');
|
|
51
16
|
return (
|
|
52
17
|
// `h-svh`: nothing above this box has a definite height (as the Apps page).
|
|
53
|
-
_jsxs("div", { className: "flex h-svh min-h-0 flex-col overflow-hidden", children: [_jsx(ProjectPageHeader, { title: t('
|
|
54
|
-
// "Inbox", a rule, then the underline tabs: the same title-bar
|
|
55
|
-
// grammar as the capability tab bar (customize-tab-bar.tsx). Never
|
|
56
|
-
// the segmented control here.
|
|
57
|
-
_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": true, className: "bg-border mx-1.5 h-4 w-px shrink-0" }), _jsx(Tabs, { value: view, onValueChange: select, className: "h-full gap-0", children: _jsxs(TabsList, { type: "underline", underlineSize: "md", className: "h-10 justify-start gap-4 border-b-0", "aria-label": t('inbox.viewLabel'), children: [_jsxs(TabsTrigger, { value: "review", className: INBOX_TAB_CLASS, "data-testid": "inbox-view-review", children: [t('inbox.viewReview'), reviewNeedsYou > 0 ? _jsx(CountBadge, { count: reviewNeedsYou, tone: "waiting" }) : null] }), _jsxs(TabsTrigger, { value: "notifications", className: INBOX_TAB_CLASS, "data-testid": "inbox-view-notifications", children: [t('inbox.viewNotifications'), unread > 0 ? _jsx(CountBadge, { count: unread }) : null] })] }) })] }) }), view === 'review' ? (
|
|
58
|
-
// Full width: the list and the open item sit side by side, so no
|
|
59
|
-
// reading-width cap here.
|
|
60
|
-
_jsx("div", { className: "flex min-h-0 w-full flex-1 flex-col", children: _jsx(ReviewView, { projectId: projectId }) })) : (_jsx(NotificationInbox, { bare: true }))] }));
|
|
18
|
+
_jsxs("div", { className: "flex h-svh min-h-0 flex-col overflow-hidden", children: [_jsx(ProjectPageHeader, { title: t('spaces.review') }), _jsx("div", { className: "flex min-h-0 w-full flex-1 flex-col", children: _jsx(ReviewView, { projectId: projectId }) })] }));
|
|
61
19
|
}
|
|
@@ -276,16 +276,10 @@ function ProjectHomeView({ projectId, onSend, busy, beforeSend, onboarding: onbo
|
|
|
276
276
|
resetLabel: 'Reset to agent default',
|
|
277
277
|
}
|
|
278
278
|
: undefined;
|
|
279
|
-
const composer = (_jsx(ComposerChatInput, { onSend: handleSend, onCommand: handleCommand, projectId: projectId, draftScope: draftScope,
|
|
280
|
-
//
|
|
281
|
-
//
|
|
282
|
-
|
|
283
|
-
isSending: creating, disabled: creating,
|
|
284
|
-
// The home composer navigates to the new session on send — don't
|
|
285
|
-
// clear it first (that would drop the text on a gated send). The
|
|
286
|
-
// message rides across via `create.pending_prompt` and reappears
|
|
287
|
-
// as the instant shell's optimistic turn.
|
|
288
|
-
clearOnSend: false, autoFocus: true,
|
|
279
|
+
const composer = (_jsx(ComposerChatInput, { onSend: handleSend, onCommand: handleCommand, projectId: projectId, draftScope: draftScope, draftHandoffScope: onSend ? undefined : defaultSend.draftHandoffScope,
|
|
280
|
+
// Keep accepting keystrokes while creation runs. A second Enter is
|
|
281
|
+
// recovered as a draft and handed to the same session on navigation.
|
|
282
|
+
isSending: creating, disabled: onSend ? creating : false, clearOnSend: onSend ? false : 'text-only', autoFocus: true,
|
|
289
283
|
// Desktop: a hero composer floating mid-page has no column for a second
|
|
290
284
|
// rail to align to, so the attach/agent/context controls ride on the
|
|
291
285
|
// toolbar itself, ahead of the model selector, and the `/` menu opens
|
|
@@ -301,5 +295,5 @@ function ProjectHomeView({ projectId, onSend, busy, beforeSend, onboarding: onbo
|
|
|
301
295
|
return (
|
|
302
296
|
// A file dropped anywhere on the page attaches to the composer, as on a
|
|
303
297
|
// session page.
|
|
304
|
-
_jsxs(ComposerDropZone, { className: "bg-background relative flex min-h-0 flex-1 flex-col overflow-hidden lg:px-4.5", children: [_jsx(ProjectHomeWallpaper, {}), _jsx(SidebarToggle, { placement: "floating" }), _jsx(AccessRequestsBell, { requests: accessRequests.data?.requests ?? [], to: accessRequestsTo }), firstChatPending || !onboarded || noAgent || !HomeAnnouncement ? null : _jsx(HomeAnnouncement, {}), _jsx("div", { className: "relative z-10 mx-auto w-full max-w-2xl px-4 pt-14 empty:hidden", children: _jsx(SplitNoticeBanner, { workspaceId: projectId }) }), noAgentReason ? (_jsx(NoAgentHome, { reason: noAgentReason, repoUrl: projectRowQuery.data?.repo_url, branch: projectRowQuery.data?.default_branch })) : firstChat ? (_jsx(FirstChat, { composer: composer })) : (_jsx(ProjectHomeWelcomeBody, { projectId: projectId, onPickSuggestion: applySuggestion, composer: composer }))] }));
|
|
298
|
+
_jsxs(ComposerDropZone, { className: "bg-background relative flex min-h-0 flex-1 flex-col overflow-hidden lg:px-4.5", children: [_jsx(ProjectHomeWallpaper, {}), _jsx(SidebarToggle, { placement: "floating" }), _jsx(AccessRequestsBell, { requests: accessRequests.data?.requests ?? [], to: accessRequestsTo }), firstChatPending || !onboarded || noAgent || !HomeAnnouncement ? null : _jsx(HomeAnnouncement, {}), _jsx("div", { className: "relative z-10 mx-auto w-full max-w-2xl px-4 pt-14 empty:hidden", children: _jsx(SplitNoticeBanner, { workspaceId: projectId }) }), noAgentReason ? (_jsx(NoAgentHome, { reason: noAgentReason, repoUrl: projectRowQuery.data?.repo_url, branch: projectRowQuery.data?.default_branch })) : firstChat ? (_jsx(FirstChat, { projectId: projectId, composer: composer })) : (_jsx(ProjectHomeWelcomeBody, { projectId: projectId, onPickSuggestion: applySuggestion, composer: composer }))] }));
|
|
305
299
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DraftScope } from '../../session/composer/draft/composer-draft.js';
|
|
1
2
|
import { type AttachmentSubmission } from '../../session/composer/attachment-submission.js';
|
|
2
3
|
import type { AttachedFile } from '../../session/composer/session-chat-input.js';
|
|
3
4
|
import type { ProjectHomeSendOptions } from './project-home.js';
|
|
@@ -27,4 +28,5 @@ export interface UseProjectHomeSendOptions {
|
|
|
27
28
|
export declare function useProjectHomeSend(projectId: string, { beforeSend, space }?: UseProjectHomeSendOptions): {
|
|
28
29
|
send: (text: string, files: AttachedFile[] | undefined, options?: ProjectHomeSendOptions, attachments?: AttachmentSubmission) => Promise<void>;
|
|
29
30
|
sending: boolean;
|
|
31
|
+
draftHandoffScope: import("react").RefObject<DraftScope | null>;
|
|
30
32
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { qk, removeCachedProjectSession, startSessionWithPrompt, upsertCachedProjectSession, writeStartStash, } from '@kortix/sdk/react';
|
|
3
3
|
import { useQueryClient } from '@tanstack/react-query';
|
|
4
|
-
import { useCallback, useState } from 'react';
|
|
4
|
+
import { useCallback, useRef, useState } from 'react';
|
|
5
5
|
import { useTranslations } from '../../i18n/index.js';
|
|
6
6
|
import { useNewProjectSession } from '../../internal/hooks/projects/use-new-project-session.js';
|
|
7
7
|
import { useUiViewer } from '../../providers/ui-provider.js';
|
|
@@ -9,6 +9,7 @@ import { errorToast } from '../../primitives/toast.js';
|
|
|
9
9
|
import { postWhenUploaded, sentFailureMessage, } from '../../session/composer/attachment-submission.js';
|
|
10
10
|
import { useFirstPromptPreviewStore } from '../../session/composer/stores/session-composer-handoff-store.js';
|
|
11
11
|
import { promptFileParts } from '../../session/composer/uploaded-file-refs.js';
|
|
12
|
+
import { handoffHomeComposerFocus } from '../../session/composer/draft/home-composer-focus-handoff.js';
|
|
12
13
|
import { buildNewSessionCreateInput } from './new-session-create.js';
|
|
13
14
|
/**
|
|
14
15
|
* The project home composer's send: create the session (with the prompt as
|
|
@@ -25,10 +26,23 @@ export function useProjectHomeSend(projectId, { beforeSend, space } = {}) {
|
|
|
25
26
|
// Composer sending state: spans Enter → create confirmed → navigation. Reset
|
|
26
27
|
// only on create failure (success navigates this page away).
|
|
27
28
|
const [sending, setSending] = useState(false);
|
|
29
|
+
const creatingRef = useRef(false);
|
|
30
|
+
const draftHandoffScope = useRef(null);
|
|
28
31
|
const send = useCallback(async (text, files, options, attachments) => {
|
|
29
32
|
if (!text.trim() && !files?.length)
|
|
30
33
|
return;
|
|
31
|
-
|
|
34
|
+
// A follow-up belongs to the session being created. Refuse it so the
|
|
35
|
+
// composer restores the draft for the navigation handoff.
|
|
36
|
+
if (!space && creatingRef.current)
|
|
37
|
+
throw new Error('Session creation in progress');
|
|
38
|
+
creatingRef.current = true;
|
|
39
|
+
try {
|
|
40
|
+
await beforeSend?.();
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
creatingRef.current = false;
|
|
44
|
+
throw error;
|
|
45
|
+
}
|
|
32
46
|
// Identical create-first path to every other new-session entry point: the
|
|
33
47
|
// composer shows a sending spinner for the create RTT (~one round trip),
|
|
34
48
|
// then navigates into the instant shell, which auto-sends `text` once the
|
|
@@ -53,6 +67,7 @@ export function useProjectHomeSend(projectId, { beforeSend, space } = {}) {
|
|
|
53
67
|
}
|
|
54
68
|
catch (error) {
|
|
55
69
|
errorToast(error instanceof Error ? error.message : tI18nComplete.raw('texta9c0123d9962'));
|
|
70
|
+
creatingRef.current = false;
|
|
56
71
|
setSending(false);
|
|
57
72
|
throw error;
|
|
58
73
|
}
|
|
@@ -77,13 +92,11 @@ export function useProjectHomeSend(projectId, { beforeSend, space } = {}) {
|
|
|
77
92
|
.getState()
|
|
78
93
|
.setFirstPromptPreview(sessionId, text, files ?? [], uploadStatus), (error) => sentFailureMessage(error, tComposerAttachments));
|
|
79
94
|
};
|
|
80
|
-
//
|
|
81
|
-
// creates it with these same options. By then the Promise below has
|
|
82
|
-
// rejected, so nothing after the `await` runs.
|
|
83
|
-
let refused = false;
|
|
95
|
+
// The connector gate keeps this submission pending until retry or cancel.
|
|
84
96
|
let optimisticId = null;
|
|
85
97
|
const sessionId = await new Promise((resolve, reject) => {
|
|
86
98
|
newSession({
|
|
99
|
+
deferConnectorRecovery: true,
|
|
87
100
|
// A space draws the new thread the instant Enter is pressed; the
|
|
88
101
|
// create's server row replaces it in place (same id).
|
|
89
102
|
onCreating: space
|
|
@@ -123,13 +136,18 @@ export function useProjectHomeSend(projectId, { beforeSend, space } = {}) {
|
|
|
123
136
|
// Create failed (already surfaced by the hook). Reject so the
|
|
124
137
|
// composer restores its submitted draft and keeps every handle.
|
|
125
138
|
onError: () => {
|
|
126
|
-
refused = true;
|
|
127
139
|
if (optimisticId)
|
|
128
140
|
removeCachedProjectSession(queryClient, projectId, optimisticId);
|
|
141
|
+
creatingRef.current = false;
|
|
129
142
|
setSending(false);
|
|
130
143
|
reject(new Error('Session creation failed'));
|
|
131
144
|
},
|
|
132
145
|
onNavigate: (sessionId) => {
|
|
146
|
+
if (!space) {
|
|
147
|
+
draftHandoffScope.current = { kind: 'session', sessionId };
|
|
148
|
+
if (viewer?.id)
|
|
149
|
+
handoffHomeComposerFocus(sessionId, viewer.id);
|
|
150
|
+
}
|
|
133
151
|
// PICKS only: the prompt is already a durable inbox row via
|
|
134
152
|
// create.pending_prompt above. The session page's `migrateStash`
|
|
135
153
|
// hands this stash off onto the resolved runtime session.
|
|
@@ -142,12 +160,6 @@ export function useProjectHomeSend(projectId, { beforeSend, space } = {}) {
|
|
|
142
160
|
// RENDER-only copy for the boot shell, so the bubble is on screen
|
|
143
161
|
// from the session page's first frame.
|
|
144
162
|
useFirstPromptPreviewStore.getState().setFirstPromptPreview(sessionId, text, files ?? []);
|
|
145
|
-
// A connector-gate Retry of a held send: hand the uploads off again
|
|
146
|
-
// and POST from here. A ready send's create carried the prompt.
|
|
147
|
-
if (refused && heldAttachments) {
|
|
148
|
-
heldAttachments.resubmit();
|
|
149
|
-
startHeldPost(heldAttachments, sessionId);
|
|
150
|
-
}
|
|
151
163
|
// A space opens the thread beside its timeline (a gate Retry too).
|
|
152
164
|
space?.onOpen(sessionId);
|
|
153
165
|
resolve(sessionId);
|
|
@@ -155,15 +167,17 @@ export function useProjectHomeSend(projectId, { beforeSend, space } = {}) {
|
|
|
155
167
|
});
|
|
156
168
|
});
|
|
157
169
|
// A space composer stays on screen: it is ready for the next message.
|
|
158
|
-
if (space)
|
|
170
|
+
if (space) {
|
|
171
|
+
creatingRef.current = false;
|
|
159
172
|
setSending(false);
|
|
173
|
+
}
|
|
160
174
|
if (!heldAttachments) {
|
|
161
175
|
attachments?.release();
|
|
162
176
|
return;
|
|
163
177
|
}
|
|
164
178
|
startHeldPost(heldAttachments, sessionId);
|
|
165
179
|
}, [beforeSend, space, newSession, projectId, tI18nComplete, tComposerAttachments, queryClient, viewer]);
|
|
166
|
-
return { send, sending };
|
|
180
|
+
return { send, sending, draftHandoffScope };
|
|
167
181
|
}
|
|
168
182
|
/**
|
|
169
183
|
* The new thread's row in its space's cached list, before the create POST: the
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { NewWorkspaceFormState } from './new-workspace-form.js';
|
|
2
|
-
export declare function AdvancedFields({ state, accountId, onChange, connectComputer, }: {
|
|
2
|
+
export declare function AdvancedFields({ state, accountId, noGitHubSourceAccount, onChange, connectComputer, }: {
|
|
3
3
|
state: NewWorkspaceFormState;
|
|
4
4
|
connectComputer?: boolean;
|
|
5
5
|
/** The account the create targets — resolved by the page, which owns the
|
|
@@ -7,6 +7,9 @@ export declare function AdvancedFields({ state, accountId, onChange, connectComp
|
|
|
7
7
|
* account-scoped, so they cannot run on `state.accountId` alone: that is
|
|
8
8
|
* legitimately null for a single-account user. */
|
|
9
9
|
accountId: string | null;
|
|
10
|
+
/** The caller owns or administers no account yet (a first workspace), so
|
|
11
|
+
* there is no GitHub connection to add here: say where GitHub connects. */
|
|
12
|
+
noGitHubSourceAccount?: boolean;
|
|
10
13
|
onChange: (next: NewWorkspaceFormState) => void;
|
|
11
14
|
}): import("react").JSX.Element;
|
|
12
15
|
/**
|
|
@@ -55,7 +55,7 @@ import { useEffect, useMemo, useRef, useState } from 'react';
|
|
|
55
55
|
*/
|
|
56
56
|
/** The `<Select>` value that opens the add-account dialog instead of picking. */
|
|
57
57
|
const ADD_ACCOUNT_VALUE = '__add_github_account__';
|
|
58
|
-
export function AdvancedFields({ state, accountId, onChange, connectComputer, }) {
|
|
58
|
+
export function AdvancedFields({ state, accountId, noGitHubSourceAccount = false, onChange, connectComputer, }) {
|
|
59
59
|
const t = useTranslations('newWorkspace');
|
|
60
60
|
const [addOpen, setAddOpen] = useState(false);
|
|
61
61
|
// Same cache key the account hub's Git tab and `connected-tab.tsx` use, so
|
|
@@ -151,7 +151,7 @@ export function AdvancedFields({ state, accountId, onChange, connectComputer, })
|
|
|
151
151
|
return (_jsx(SelectItem, { size: "md", value: option.value, children: _jsxs("span", { className: "flex items-baseline gap-2", children: [_jsx("span", { children: option.kind === 'managed'
|
|
152
152
|
? t('repository.sources.managed.label')
|
|
153
153
|
: githubInstallationLabel(option.ownerLogin) }), typeLabel ? (_jsx("span", { className: "text-muted-foreground text-xs", children: typeLabel })) : null] }) }, option.value));
|
|
154
|
-
}), accountId ? (_jsxs(_Fragment, { children: [_jsx(SelectSeparator, {}), _jsx(SelectItem, { size: "md", value: ADD_ACCOUNT_VALUE, children: _jsxs("span", { className: "flex items-center gap-2", children: [_jsx(PlusIcon, { className: "size-3.5" }), t('repository.addGitHubAccount')] }) })] })) : null] })] }), selected?.kind === 'managed' ? (
|
|
154
|
+
}), accountId ? (_jsxs(_Fragment, { children: [_jsx(SelectSeparator, {}), _jsx(SelectItem, { size: "md", value: ADD_ACCOUNT_VALUE, children: _jsxs("span", { className: "flex items-center gap-2", children: [_jsx(PlusIcon, { className: "size-3.5" }), t('repository.addGitHubAccount')] }) })] })) : null] })] }), selected?.kind === 'managed' ? (_jsxs("p", { className: "text-muted-foreground text-xs", children: [t('repository.sources.managed.description'), noGitHubSourceAccount ? _jsxs(_Fragment, { children: [" ", t('repository.githubAfterCreate')] }) : null] })) : null, installationsQuery.isError ? (_jsx("p", { className: "text-destructive text-xs", children: t('repository.loadGitHubAccountsError') })) : null] }))] }), selected?.kind === 'github' ? (_jsxs("div", { className: "flex flex-col space-y-3", children: [_jsx(Label, { htmlFor: "workspace-action", children: t('repository.label') }), _jsx(Tabs, { id: "workspace-action", value: action, onValueChange: (value) => onChange(withRepositoryAction(state, value)), children: _jsxs(TabsList, { className: "w-full", children: [_jsx(TabsTrigger, { value: "create", size: "sm", className: "flex-1", children: t('repository.actionCreate') }), _jsx(TabsTrigger, { value: "import", size: "sm", className: "flex-1", children: t('repository.actionImport') })] }) }), createNeedsAuthorization && action === 'create' ? (_jsx("p", { className: "text-muted-foreground text-xs", children: t('repository.createPersonalAuthorize') })) : null] })) : null, selected?.kind === 'github' && action === 'import' ? (
|
|
155
155
|
// One decision — which repository, on which branch — so the two
|
|
156
156
|
// fields share the in-field gap rather than the gap between fields.
|
|
157
157
|
_jsxs("div", { className: "flex flex-col space-y-3", children: [_jsx(ImportRepositoryField, { state: state, accountId: accountId, onChange: onChange }), _jsx("p", { className: "text-muted-foreground text-xs", children: t('repository.importHint') }), state.repoFullName ? (_jsxs("div", { className: "flex flex-col space-y-3", children: [_jsx(Label, { htmlFor: "workspace-branch", children: t('repository.defaultBranch') }), _jsx(ImportBranchField, { state: state, accountId: accountId, onChange: onChange })] })) : null] })) : null, selected?.kind === 'managed' && managedOperator ? (_jsxs(_Fragment, { children: [_jsx(ManagedImportField, { state: state, onChange: onChange }), state.repoFullName ? (_jsxs("div", { className: "flex flex-col space-y-3", children: [_jsx(Label, { htmlFor: "workspace-branch", children: t('repository.defaultBranch') }), _jsx(Input, { id: "workspace-branch", size: "md", value: state.defaultBranch, onChange: (event) => onChange({ ...state, defaultBranch: event.target.value }), placeholder: "main" })] })) : null] })) : null, addAccountDialog] }));
|
|
@@ -38,3 +38,12 @@ export declare function workspaceNameMessage(result: WorkspaceNameResult, touche
|
|
|
38
38
|
* for tests.
|
|
39
39
|
*/
|
|
40
40
|
export declare function suggestWorkspaceName(random?: () => number): string;
|
|
41
|
+
/**
|
|
42
|
+
* `/workspaces/new?name=` — the name the chooser's inline form already shows.
|
|
43
|
+
* "More options" carries it so the page opens on the SAME name instead of a
|
|
44
|
+
* second random suggestion. An invalid or absent value resolves to `null`,
|
|
45
|
+
* and the page keeps its own suggestion.
|
|
46
|
+
*/
|
|
47
|
+
export declare function readNameParam(params: URLSearchParams): string | null;
|
|
48
|
+
/** `href` with `?name=` set to `name` (trimmed), keeping any other params. */
|
|
49
|
+
export declare function withNameParam(href: string, name: string): string;
|
|
@@ -89,3 +89,23 @@ export function suggestWorkspaceName(random = Math.random) {
|
|
|
89
89
|
const pick = (list) => list[Math.floor(random() * list.length)];
|
|
90
90
|
return `${pick(NAME_ADJECTIVES)} ${pick(NAME_NOUNS)}`;
|
|
91
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* `/workspaces/new?name=` — the name the chooser's inline form already shows.
|
|
94
|
+
* "More options" carries it so the page opens on the SAME name instead of a
|
|
95
|
+
* second random suggestion. An invalid or absent value resolves to `null`,
|
|
96
|
+
* and the page keeps its own suggestion.
|
|
97
|
+
*/
|
|
98
|
+
export function readNameParam(params) {
|
|
99
|
+
const result = validateWorkspaceName(params.get('name') ?? '');
|
|
100
|
+
return result.ok ? result.name : null;
|
|
101
|
+
}
|
|
102
|
+
/** `href` with `?name=` set to `name` (trimmed), keeping any other params. */
|
|
103
|
+
export function withNameParam(href, name) {
|
|
104
|
+
const trimmed = name.trim();
|
|
105
|
+
if (!trimmed)
|
|
106
|
+
return href;
|
|
107
|
+
const [path, query = ''] = href.split('?');
|
|
108
|
+
const params = new URLSearchParams(query);
|
|
109
|
+
params.set('name', trimmed);
|
|
110
|
+
return `${path}?${params.toString()}`;
|
|
111
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { ProjectSession, ProjectSessionInitiatorType } from '@kortix/sdk';
|
|
2
2
|
/**
|
|
3
|
-
* Who started the RUN a session belongs to
|
|
4
|
-
* `
|
|
5
|
-
*
|
|
6
|
-
*
|
|
3
|
+
* Who started the RUN a session belongs to. The classification lives once in
|
|
4
|
+
* `@kortix/shared/session/session-starter` (the server-derived `initiator`:
|
|
5
|
+
* member/trigger/channel/api/system, "You" only when the starter is the
|
|
6
|
+
* viewer); this host derives the row's wording from it — `labels.you`, the
|
|
7
|
+
* member's name with the owner fallbacks, `labels.unknown` when nothing names
|
|
8
|
+
* the starter.
|
|
7
9
|
*/
|
|
8
10
|
export interface SessionStarter {
|
|
9
11
|
type: ProjectSessionInitiatorType;
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
+
import { classifySessionStarter } from '../../_vendor/kortix-shared.js';
|
|
1
2
|
export function sessionStarter(session, viewerId, labels) {
|
|
2
|
-
const
|
|
3
|
-
if (
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const name = initiator?.label || session.owner_name || session.owner_email || null;
|
|
9
|
-
return { type: 'member', id, isViewer, label: isViewer ? labels.you : (name ?? labels.unknown) };
|
|
3
|
+
const core = classifySessionStarter(session, viewerId);
|
|
4
|
+
if (core.type === 'member') {
|
|
5
|
+
return {
|
|
6
|
+
...core,
|
|
7
|
+
label: core.isViewer ? labels.you : core.label ?? session.owner_name ?? session.owner_email ?? labels.unknown,
|
|
8
|
+
};
|
|
10
9
|
}
|
|
11
|
-
return {
|
|
12
|
-
type: initiator.type,
|
|
13
|
-
id: initiator.id,
|
|
14
|
-
isViewer: false,
|
|
15
|
-
label: initiator.label || initiator.id || labels.unknown,
|
|
16
|
-
};
|
|
10
|
+
return { ...core, label: core.label || core.id || labels.unknown };
|
|
17
11
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { ReviewVerdict } from '@kortix/sdk';
|
|
1
|
+
import type { SessionAsk, ReviewVerdict } from '@kortix/sdk';
|
|
2
2
|
import { type ReactNode } from 'react';
|
|
3
3
|
import { type BulkResult } from './review-actions.js';
|
|
4
4
|
import { type ReviewItem, type ReviewSegment } from './types.js';
|
|
5
|
-
export declare function ReviewCenter({ initialItems, segment: segmentProp, onSegmentChange, loadMore, onAct, onBulkAct, onOpenSession, onRecoverChange, recoveringCrId, onRefresh, isLoading, isFetching, isFetched, isError, sessionLabels, verdictAllowed, needsYouDeck, }?: {
|
|
5
|
+
export declare function ReviewCenter({ initialItems, segment: segmentProp, onSegmentChange, loadMore, onAct, onBulkAct, onOpenSession, onRecoverChange, recoveringCrId, onRefresh, isLoading, isFetching, isFetched, isError, sessionLabels, verdictAllowed, needsYouDeck, sessionAsks, onSelectAsk, selectedAskId, }?: {
|
|
6
6
|
/**
|
|
7
7
|
* The asks deck (questions and approvals agents wait on): in the empty
|
|
8
8
|
* detail pane, or above the list on a narrow inbox. It stays mounted while
|
|
@@ -12,6 +12,10 @@ export declare function ReviewCenter({ initialItems, segment: segmentProp, onSeg
|
|
|
12
12
|
needsYouDeck?: (opts: {
|
|
13
13
|
paused: boolean;
|
|
14
14
|
}) => ReactNode;
|
|
15
|
+
/** Open session asks appear beside review items in the Needs you list. */
|
|
16
|
+
sessionAsks?: readonly SessionAsk[];
|
|
17
|
+
onSelectAsk?: (id: string) => void;
|
|
18
|
+
selectedAskId?: string | null;
|
|
15
19
|
/** When provided, the inbox renders real data instead of the mock fixtures. */
|
|
16
20
|
initialItems?: ReviewItem[];
|
|
17
21
|
/** Connected mode: the segment is the server's filter, so the parent owns it. */
|