@kortix/ui 0.15.1 → 0.15.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_vendor/kortix-shared.js +157 -2
- package/dist/_vendor/shared/channel-descriptors.d.ts +1 -1
- package/dist/_vendor/shared/index.d.ts +1 -2
- package/dist/_vendor/shared/workspace-actions.d.ts +155 -0
- package/dist/_vendor/shared/workspace-settings.d.ts +62 -0
- package/dist/access/access/access-dialog-share.js +6 -6
- package/dist/access/access/access-dialog.d.ts +44 -1
- package/dist/access/access/access-dialog.js +8 -8
- package/dist/access/access/agent-principals.d.ts +3 -3
- package/dist/access/access/agent-principals.js +5 -4
- package/dist/access/access/invite-people-dialog.d.ts +37 -0
- package/dist/access/access/invite-people-dialog.js +140 -0
- package/dist/access/access/principal-picker.js +3 -2
- package/dist/access/access/project-select.js +2 -2
- package/dist/access/access/role-select.d.ts +9 -8
- package/dist/access/access/role-select.js +22 -25
- package/dist/access/access/workspace-role-dialog.d.ts +27 -0
- package/dist/access/access/workspace-role-dialog.js +48 -0
- package/dist/access/iam/add-github-account-dialog.d.ts +1 -1
- package/dist/access/iam/add-github-account-dialog.js +1 -1
- package/dist/access/iam/api-key-expiry.d.ts +18 -0
- package/dist/access/iam/api-key-expiry.js +47 -0
- package/dist/access/iam/api-key-rows.d.ts +6 -0
- package/dist/access/iam/api-key-rows.js +3 -0
- package/dist/access/iam/workspace-key-acts-as.d.ts +41 -0
- package/dist/access/iam/workspace-key-acts-as.js +48 -0
- package/dist/access/sharing-intent.js +1 -1
- package/dist/access/sharing-picker.js +1 -1
- package/dist/animated-copy-icon.d.ts +2 -2
- package/dist/animated-copy-icon.js +7 -4
- package/dist/apps/app-shared.js +2 -2
- package/dist/artifacts/artifact-frame.d.ts +0 -1
- package/dist/artifacts/artifact-frame.js +4 -10
- package/dist/artifacts/artifact-session.js +3 -7
- package/dist/artifacts/frame-policy.d.ts +1 -1
- package/dist/artifacts/frame-policy.js +2 -2
- package/dist/customize/agents/agent-drives-section.js +2 -2
- package/dist/customize/agents/agent-page-chrome.js +1 -1
- package/dist/customize/agents/agent-page.js +4 -5
- package/dist/customize/agents/agents-page.js +2 -3
- package/dist/customize/connectors/connector-identity.d.ts +1 -1
- package/dist/customize/connectors/connector-identity.js +1 -1
- package/dist/customize/connectors/connector-moves-banner.js +2 -2
- package/dist/customize/connectors/connectors-page.d.ts +2 -2
- package/dist/customize/connectors/connectors-page.js +4 -4
- package/dist/customize/connectors/detail/app-page.js +1 -1
- package/dist/customize/connectors/detail/connector-page.d.ts +1 -1
- package/dist/customize/connectors/detail/connector-page.js +1 -1
- package/dist/customize/connectors/detail/connector-policy-sets.js +2 -2
- package/dist/customize/connectors/detail/connector-tools.js +7 -7
- package/dist/customize/connectors/detail/connector-triggers.js +2 -3
- package/dist/customize/connectors/detail/email-inboxes.js +2 -2
- package/dist/customize/models/models-page.d.ts +1 -1
- package/dist/customize/models/models-page.js +1 -1
- package/dist/customize/project-settings/project-admin-sections.d.ts +53 -17
- package/dist/customize/project-settings/project-admin-sections.js +80 -31
- package/dist/customize/project-settings/project-settings-page.d.ts +2 -2
- package/dist/customize/project-settings/project-settings-page.js +6 -4
- package/dist/customize/project-settings/project-settings-sections.d.ts +2 -3
- package/dist/customize/project-settings/project-settings-sections.js +9 -4
- package/dist/customize/providers/provider-accordion.d.ts +3 -1
- package/dist/customize/providers/provider-accordion.js +2 -2
- package/dist/customize/secrets/secrets-page.d.ts +1 -1
- package/dist/customize/secrets/secrets-page.js +1 -1
- package/dist/customize/sections/component/email-connect-form.js +2 -2
- package/dist/customize/sections/component/slack-byo-wizard.js +3 -3
- package/dist/customize/sections/connectors-view.js +17 -17
- package/dist/customize/sections/gateway-view.d.ts +7 -5
- package/dist/customize/sections/gateway-view.js +28 -17
- package/dist/customize/sections/llm-provider/chatgpt-subscription-connect.js +2 -2
- package/dist/customize/sections/llm-provider/custom-provider-form.js +2 -2
- package/dist/customize/sections/llm-provider/llm-provider-modal.d.ts +1 -1
- package/dist/customize/sections/llm-provider/llm-provider-modal.js +4 -4
- package/dist/customize/sections/llm-provider/models-tab-row.js +5 -3
- package/dist/customize/sections/llm-provider/types.d.ts +2 -0
- package/dist/customize/sections/view/agent-editor-catalog.d.ts +5 -6
- package/dist/customize/sections/view/agent-editor-catalog.js +33 -19
- package/dist/customize/sections/view/agent-editor.js +1 -1
- package/dist/customize/sections/view/channels-view.js +13 -13
- package/dist/customize/sections/view/gateway/gateway-budgets.js +12 -10
- package/dist/customize/sections/view/gateway/gateway-logs.d.ts +1 -1
- package/dist/customize/sections/view/gateway/gateway-logs.js +3 -3
- package/dist/customize/sections/view/gateway/gateway-overview.js +1 -1
- package/dist/customize/sections/view/gateway/gateway-routing.js +1 -1
- package/dist/customize/sections/view/git-view.js +3 -3
- package/dist/customize/sections/view/grant-mode-field.js +2 -2
- package/dist/customize/sections/view/review-center-connected.js +1 -1
- package/dist/customize/sections/view/review-view.d.ts +0 -15
- package/dist/customize/sections/view/review-view.js +1 -23
- package/dist/customize/sections/view/secret-delivery.js +2 -2
- package/dist/customize/sections/view/secrets-view.js +16 -16
- package/dist/customize/sections/view/subscription-usage-tab.d.ts +12 -1
- package/dist/customize/sections/view/subscription-usage-tab.js +71 -72
- package/dist/customize/settings/rail-copy-context.js +1 -1
- package/dist/customize/settings/rail.d.ts +1 -1
- package/dist/customize/settings/rail.js +11 -18
- package/dist/customize/settings/settings-tab-header.d.ts +1 -1
- package/dist/customize/settings/settings-tab-header.js +1 -1
- package/dist/customize/settings/settings-tabs.d.ts +5 -12
- package/dist/customize/settings/settings-tabs.js +31 -44
- package/dist/customize/settings/tabs/experimental-tab.js +4 -4
- package/dist/customize/settings/tabs/general-tab.d.ts +29 -11
- package/dist/customize/settings/tabs/general-tab.js +55 -25
- package/dist/customize/settings/tabs/project-edit-patch.d.ts +0 -13
- package/dist/customize/settings/tabs/project-edit-patch.js +0 -28
- package/dist/customize/settings/tabs/sandbox-tab.js +2 -2
- package/dist/customize/settings/tabs/tokens-tab.d.ts +32 -2
- package/dist/customize/settings/tabs/tokens-tab.js +157 -32
- package/dist/customize/settings/tabs/workspace-keys.d.ts +6 -0
- package/dist/customize/settings/tabs/workspace-keys.js +240 -0
- package/dist/customize/shared/capability-library.js +3 -1
- package/dist/customize/shared/catalog/catalog-space-tabs.js +2 -2
- package/dist/customize/shared/customize-tab-bar.d.ts +6 -2
- package/dist/customize/shared/customize-tab-bar.js +36 -35
- package/dist/customize/shared/standalone-settings-nav.js +2 -2
- package/dist/customize/triggers/schedule/schedule-copy.d.ts +1 -1
- package/dist/customize/triggers/schedule/trigger-composer.js +5 -6
- package/dist/customize/triggers/schedule/trigger-list.d.ts +2 -2
- package/dist/customize/triggers/schedule/trigger-list.js +12 -18
- package/dist/customize/triggers/schedule/trigger-session-access-copy.d.ts +6 -6
- package/dist/customize/triggers/schedule/trigger-session-access-copy.js +3 -3
- package/dist/customize/triggers/schedule/when-event.js +4 -4
- package/dist/customize/triggers/schedule/when-webhook-address.js +2 -2
- package/dist/customize/triggers/schedule/when-webhook.js +2 -2
- package/dist/customize/triggers/schedule-view.js +4 -5
- package/dist/customize/triggers/triggers-page.d.ts +1 -1
- package/dist/customize/triggers/triggers-page.js +1 -1
- package/dist/files/drives/drive-storage.d.ts +2 -2
- package/dist/files/drives/drive-storage.js +13 -6
- package/dist/files/project/components/change-request-detail-dialog.js +6 -6
- package/dist/files/project/components/change-requests-panel.js +2 -2
- package/dist/files/project/components/diff-preview-banner.d.ts +1 -1
- package/dist/files/project/components/diff-preview-banner.js +1 -1
- package/dist/files/project/components/drive-grid-view.js +1 -1
- package/dist/files/project/components/drive-list-view.js +1 -1
- package/dist/files/project/context.d.ts +1 -1
- package/dist/files/project/context.js +1 -1
- package/dist/files/renderers/image-renderer.js +1 -1
- package/dist/files/runtime/hooks/use-binary-blob.js +12 -2
- package/dist/files/runtime/hooks/use-file-content.js +18 -2
- package/dist/files/viewer/file-content-renderer.js +2 -2
- package/dist/files/viewer/preview-fit.d.ts +1 -1
- package/dist/files/viewer/preview-fit.js +1 -1
- package/dist/i18n/en.d.ts +312 -210
- package/dist/i18n/en.js +880 -778
- package/dist/i18n/ui-catalog/account-hub-translation-keys.generated.js +9 -9
- package/dist/i18n/ui-catalog/app-registry-translation-keys.generated.js +12 -6
- package/dist/i18n/ui-catalog/product-catalog-translation-keys.generated.js +5 -5
- package/dist/i18n/ui-catalog/remaining-ui-translation-keys.generated.js +67 -60
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +1 -0
- package/dist/icons/solid-right-arrow.d.ts +8 -0
- package/dist/icons/solid-right-arrow.js +11 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/account-hub/account-hub-entry.js +9 -8
- package/dist/internal/account-hub/account-hub-location.d.ts +20 -3
- package/dist/internal/account-hub/account-hub-location.js +16 -7
- package/dist/internal/account-hub/hub-sheet.d.ts +1 -1
- package/dist/internal/account-hub/hub-sheet.js +1 -1
- package/dist/internal/account-hub/sections.d.ts +2 -2
- package/dist/internal/account-hub/sections.js +10 -10
- package/dist/internal/account-hub/use-account-hub-access.d.ts +2 -0
- package/dist/internal/account-hub/use-account-hub-access.js +13 -5
- package/dist/internal/account-hub/workspace-settings-route.d.ts +27 -0
- package/dist/internal/account-hub/workspace-settings-route.js +51 -0
- package/dist/internal/components/agent-mark.js +6 -0
- package/dist/internal/components/clickable-path.d.ts +3 -0
- package/dist/internal/components/clickable-path.js +4 -1
- package/dist/internal/components/nav-rail.d.ts +3 -1
- package/dist/internal/components/nav-rail.js +2 -0
- package/dist/internal/components/repository-disconnected.js +2 -2
- package/dist/internal/desktop/desktop-back-button.d.ts +1 -1
- package/dist/internal/files/file-read-retry.d.ts +13 -0
- package/dist/internal/files/file-read-retry.js +53 -1
- package/dist/internal/goals/goal-meta.d.ts +2 -1
- package/dist/internal/goals/goal-meta.js +4 -2
- package/dist/internal/hooks/account/use-accounts-list.d.ts +2 -12
- package/dist/internal/hooks/account/use-accounts-list.js +1 -14
- package/dist/internal/hooks/account/use-my-invites.d.ts +1 -1
- package/dist/internal/hooks/account/use-my-invites.js +1 -1
- package/dist/internal/hooks/use-review-session-summary.d.ts +7 -0
- package/dist/internal/hooks/use-review-session-summary.js +12 -1
- package/dist/internal/layout/project-capability-nav.d.ts +6 -17
- package/dist/internal/layout/project-capability-nav.js +7 -79
- package/dist/internal/layout/project-settings-nav.d.ts +2 -2
- package/dist/internal/layout/project-settings-nav.js +3 -3
- package/dist/internal/lib/billing/billing-gate-state.d.ts +11 -0
- package/dist/internal/lib/billing/billing-gate-state.js +18 -0
- package/dist/internal/lib/browser-noise/rules/expected-states.js +2 -3
- package/dist/internal/lib/browser-noise/rules/extensions.js +18 -0
- package/dist/internal/lib/browser-noise/rules/injected-scripts.js +66 -5
- package/dist/internal/lib/capability-tab-routes.d.ts +16 -40
- package/dist/internal/lib/capability-tab-routes.js +25 -54
- package/dist/internal/lib/desktop.d.ts +1 -1
- package/dist/internal/lib/desktop.js +1 -1
- package/dist/internal/lib/github-installations.d.ts +1 -1
- package/dist/internal/lib/github-installations.js +1 -1
- package/dist/internal/lib/model-pricing.js +1 -1
- package/dist/internal/lib/navigation/session-href.d.ts +1 -1
- package/dist/internal/lib/navigation/session-href.js +1 -1
- package/dist/internal/lib/onboarding/landing-destination.d.ts +12 -4
- package/dist/internal/lib/onboarding/landing-destination.js +17 -5
- package/dist/internal/lib/onboarding/last-project-cookie.d.ts +1 -1
- package/dist/internal/lib/onboarding/last-project-cookie.js +1 -1
- package/dist/internal/lib/project-actions.d.ts +1 -4
- package/dist/internal/lib/project-actions.js +2 -5
- package/dist/internal/lib/provider-branding.js +11 -3
- package/dist/internal/lib/trigger-clock.d.ts +5 -0
- package/dist/internal/lib/trigger-clock.js +15 -0
- package/dist/internal/lib/turn-broadcast.d.ts +0 -3
- package/dist/internal/lib/use-project-can.d.ts +1 -3
- package/dist/internal/lib/use-project-can.js +0 -5
- package/dist/internal/lib/web-notifications.d.ts +1 -8
- package/dist/internal/lib/web-notifications.js +17 -58
- package/dist/internal/notifications/notification-bell.d.ts +13 -33
- package/dist/internal/notifications/notification-bell.js +14 -117
- package/dist/internal/notifications/notification-inbox.d.ts +51 -0
- package/dist/internal/notifications/notification-inbox.js +122 -0
- package/dist/internal/notifications/notification-rows.d.ts +3 -4
- package/dist/internal/notifications/notification-rows.js +1 -4
- package/dist/internal/notifications/use-inbox-summary.d.ts +17 -0
- package/dist/internal/notifications/use-inbox-summary.js +28 -0
- package/dist/internal/notifications/web-push.d.ts +9 -10
- package/dist/internal/notifications/web-push.js +9 -10
- package/dist/internal/reminders/use-refetch-after-fire.d.ts +0 -2
- package/dist/internal/reminders/use-refetch-after-fire.js +1 -10
- package/dist/internal/stores/account-panel-store.d.ts +17 -1
- package/dist/internal/stores/account-panel-store.js +19 -2
- package/dist/internal/stores/project-switch-store.d.ts +2 -2
- package/dist/internal/stores/project-switch-store.js +4 -4
- package/dist/internal/stores/settings-panel-store.d.ts +6 -0
- package/dist/internal/stores/settings-panel-store.js +4 -1
- package/dist/internal/stores/web-notification-store.d.ts +6 -9
- package/dist/internal/stores/web-notification-store.js +0 -4
- package/dist/internal/stores/workspace-settings-rail-store.d.ts +67 -0
- package/dist/internal/stores/workspace-settings-rail-store.js +11 -0
- package/dist/lib/routes.d.ts +8 -0
- package/dist/lib/routes.js +22 -18
- package/dist/lib/z-stack.d.ts +7 -0
- package/dist/lib/z-stack.js +13 -0
- package/dist/markdown/copy-button.d.ts +2 -2
- package/dist/markdown/copy-button.js +22 -20
- package/dist/markdown/doc-editor/doc-menus.d.ts +1 -10
- package/dist/markdown/doc-editor/doc-menus.js +6 -69
- package/dist/markdown/file-links.js +21 -0
- package/dist/markdown/setup-links/setup-link-button.js +1 -1
- package/dist/primitives/button.d.ts +1 -1
- package/dist/primitives/emoji-tint.d.ts +1 -1
- package/dist/primitives/emoji-tint.js +1 -1
- package/dist/primitives/error-state.js +8 -1
- package/dist/primitives/inline-meta.d.ts +12 -1
- package/dist/primitives/inline-meta.js +38 -5
- package/dist/primitives/page-search-bar.js +6 -6
- package/dist/primitives/section.d.ts +3 -3
- package/dist/primitives/section.js +9 -9
- package/dist/primitives/status.d.ts +5 -5
- package/dist/primitives/status.js +33 -33
- package/dist/primitives/tabs.d.ts +14 -26
- package/dist/primitives/tabs.js +103 -105
- package/dist/primitives/tag.d.ts +1 -1
- package/dist/primitives/toast.d.ts +6 -6
- package/dist/primitives/toast.js +55 -48
- package/dist/providers/session-ids.d.ts +1 -1
- package/dist/providers/ui-provider.d.ts +2 -0
- package/dist/session/agents/agent-strip.js +6 -6
- package/dist/session/agents/subagent-dialog-content.js +3 -4
- package/dist/session/agents/workflow-run-controls.d.ts +0 -2
- package/dist/session/agents/workflow-run-controls.js +1 -12
- package/dist/session/composer/ComposerCard.js +1 -1
- package/dist/session/composer/animated-placeholder.js +1 -1
- package/dist/session/composer/chat-input/chat-input-control.js +1 -8
- package/dist/session/composer/composer-toolbar.d.ts +18 -16
- package/dist/session/composer/composer-toolbar.js +10 -1
- package/dist/session/composer/composer.js +5 -13
- package/dist/session/composer/reasoning-effort-selector.d.ts +21 -0
- package/dist/session/composer/reasoning-effort-selector.js +46 -1
- package/dist/session/header/reminder-parts.d.ts +1 -1
- package/dist/session/header/session-goal-indicator.js +2 -3
- package/dist/session/header/session-reminders-indicator.js +3 -3
- package/dist/session/header/session-site-header.js +3 -7
- package/dist/session/index.d.ts +1 -1
- package/dist/session/models/model-availability.d.ts +11 -0
- package/dist/session/models/model-availability.js +12 -0
- package/dist/session/models/model-connection-gate.d.ts +11 -26
- package/dist/session/models/model-connection-gate.js +22 -35
- package/dist/session/models/model-grouping.d.ts +30 -0
- package/dist/session/models/model-grouping.js +46 -0
- package/dist/session/models/model-picker-panel.d.ts +62 -0
- package/dist/session/models/model-picker-panel.js +181 -0
- package/dist/session/models/model-selector.d.ts +28 -4
- package/dist/session/models/model-selector.js +59 -15
- package/dist/session/models/model-tags.d.ts +4 -8
- package/dist/session/models/model-tags.js +20 -13
- package/dist/session/models/subscription-offer.d.ts +35 -0
- package/dist/session/models/subscription-offer.js +91 -0
- package/dist/session/models/use-model-connection-gate.d.ts +3 -3
- package/dist/session/models/use-model-connection-gate.js +8 -6
- package/dist/session/overrides/session-overrides-toolbar.js +8 -5
- package/dist/session/panel/open-session-quick-view.js +1 -1
- package/dist/session/panel/session-detail-panel.js +5 -1
- package/dist/session/panel/session-panel-provider.js +2 -2
- package/dist/session/panel/session-reminders-panel.js +6 -17
- package/dist/session/panel/shared/use-panel-derivations.d.ts +1 -0
- package/dist/session/panel/shared/use-panel-derivations.js +1 -1
- package/dist/session/panel/shared/use-panel-handoffs.d.ts +2 -2
- package/dist/session/panel/shared/use-panel-handoffs.js +22 -3
- package/dist/session/panel/use-session-panel-state.js +1 -1
- package/dist/session/prompts/ask-deck.d.ts +5 -3
- package/dist/session/prompts/ask-deck.js +30 -10
- package/dist/session/prompts/session-access-prompt.d.ts +61 -0
- package/dist/session/prompts/session-access-prompt.js +88 -0
- package/dist/session/prompts/session-permission-prompt.js +1 -1
- package/dist/session/scope/session-scope-control.js +2 -2
- package/dist/session/status/session-notice-banner.js +3 -3
- package/dist/session/status/session-route-prefetch.d.ts +2 -2
- package/dist/session/thread/optimistic-turn.js +1 -1
- package/dist/session/thread/session-chat.js +40 -18
- package/dist/session/thread/session-context-message-explorer.js +2 -2
- package/dist/session/thread/session-history.js +3 -3
- package/dist/session/tool/render-static.d.ts +11 -0
- package/dist/session/tool/render-static.js +16 -0
- package/dist/session/tool/shared/session-helpers.js +2 -2
- package/dist/session/tool/tool-part-renderer.d.ts +6 -1
- package/dist/session/tool/tool-part-renderer.js +9 -5
- package/dist/session/tool/tools/kortix-action-tool.js +4 -25
- package/dist/session/tool/tools/session-spawn-tool.js +7 -4
- package/dist/session/tool/tools/task-tool.js +27 -6
- package/dist/session/tool/tools/workflow-run-card.js +5 -1
- package/dist/session/tool/tools/workflow-tool.js +3 -14
- package/dist/session/turn/user-message.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/test-utils/intl.d.ts +10096 -0
- package/dist/test-utils/intl.js +27 -0
- package/dist/test-utils/strip-tags.d.ts +24 -0
- package/dist/test-utils/strip-tags.js +32 -0
- package/dist/workspace/admin/project-admin-dashboard.d.ts +51 -33
- package/dist/workspace/admin/project-admin-dashboard.js +269 -81
- package/dist/workspace/admin/settings-search-landing.d.ts +11 -0
- package/dist/workspace/admin/settings-search-landing.js +103 -0
- package/dist/workspace/admin/settings-search.d.ts +69 -0
- package/dist/workspace/admin/settings-search.js +393 -0
- package/dist/workspace/home/access-requests-bell.d.ts +6 -9
- package/dist/workspace/home/access-requests-bell.js +8 -10
- package/dist/workspace/home/existing-repo-setup-prompt.d.ts +22 -0
- package/dist/workspace/home/existing-repo-setup-prompt.js +58 -0
- package/dist/workspace/home/no-agent-home.d.ts +25 -0
- package/dist/workspace/home/no-agent-home.js +44 -0
- package/dist/workspace/home/welcome-body.js +2 -1
- package/dist/workspace/inbox/workspace-inbox.d.ts +21 -0
- package/dist/workspace/inbox/workspace-inbox.js +52 -0
- package/dist/workspace/layout/project-files-view.js +1 -1
- package/dist/workspace/layout/project-home.js +60 -10
- package/dist/workspace/memory/memory-body.js +2 -2
- package/dist/workspace/new/account-param.d.ts +1 -1
- package/dist/workspace/new/account-param.js +4 -4
- package/dist/workspace/new/advanced-fields.js +3 -3
- package/dist/workspace/new/clone-param.d.ts +1 -1
- package/dist/workspace/new/clone-param.js +1 -1
- package/dist/workspace/new/create-workspace-key.js +1 -1
- package/dist/workspace/new/github-source.d.ts +6 -6
- package/dist/workspace/new/github-source.js +6 -6
- package/dist/workspace/new/new-workspace-form.d.ts +11 -141
- package/dist/workspace/new/new-workspace-form.js +9 -195
- package/dist/workspace/new/provision-new-workspace.d.ts +14 -0
- package/dist/workspace/new/provision-new-workspace.js +14 -0
- package/dist/workspace/new/repository-options.d.ts +2 -2
- package/dist/workspace/new/repository-options.js +2 -2
- package/dist/workspace/new/source-param.d.ts +2 -2
- package/dist/workspace/new/source-param.js +2 -2
- package/dist/workspace/new/use-create-workspace.d.ts +43 -102
- package/dist/workspace/new/use-create-workspace.js +77 -136
- package/dist/workspace/new/use-project-quota.d.ts +1 -1
- package/dist/workspace/new/use-project-quota.js +1 -1
- package/dist/workspace/new/workspace-handoff.d.ts +2 -2
- package/dist/workspace/new/workspace-handoff.js +2 -2
- package/dist/workspace/new/workspace-name.d.ts +1 -1
- package/dist/workspace/new/workspace-name.js +1 -1
- package/dist/workspace/project-selector/project-selector-model.d.ts +115 -57
- package/dist/workspace/project-selector/project-selector-model.js +157 -111
- package/dist/workspace/projects/modal/project-icon-field.d.ts +5 -5
- package/dist/workspace/projects/modal/project-icon-field.js +4 -4
- package/dist/workspace/projects/policies-panel.js +3 -3
- package/dist/workspace/sessions/board-grouping.js +1 -1
- package/dist/workspace/sessions/project-sessions-view.js +2 -2
- package/dist/workspace/sessions/session-detail.js +2 -2
- package/dist/workspace/sessions/sessions-board.d.ts +1 -1
- package/dist/workspace/sessions/sessions-board.js +1 -1
- package/dist/workspace/settings/split-notice-banner.d.ts +13 -0
- package/dist/workspace/settings/split-notice-banner.js +59 -0
- package/dist/workspace/settings/use-leave-workspace.d.ts +16 -0
- package/dist/workspace/settings/use-leave-workspace.js +60 -0
- package/dist/workspace/sidebar/footer/project-files-nav.js +2 -2
- package/dist/workspace/sidebar/footer/sandbox-health.js +1 -1
- package/dist/workspace/sidebar/invitations-menu-group.d.ts +2 -2
- package/dist/workspace/sidebar/invitations-menu-group.js +4 -4
- package/dist/workspace/sidebar/modal/session-embed-section.js +1 -1
- package/dist/workspace/sidebar/modal/share-session-access.js +1 -1
- package/dist/workspace/sidebar/modal/share-session-modal.js +3 -3
- package/dist/workspace/sidebar/project-nav-items.js +14 -25
- package/dist/workspace/sidebar/project-sidebar.js +18 -7
- package/dist/workspace/sidebar/project-spaces-nav.js +6 -15
- package/dist/workspace/sidebar/sidebar-drill.d.ts +37 -0
- package/dist/workspace/sidebar/sidebar-drill.js +110 -0
- package/dist/workspace/sidebar/use-workspace-directory.d.ts +24 -0
- package/dist/workspace/sidebar/use-workspace-directory.js +24 -0
- package/dist/workspace/sidebar/use-workspace-list.d.ts +37 -0
- package/dist/workspace/sidebar/use-workspace-list.js +71 -0
- package/dist/workspace/sidebar/workspace-grouping.d.ts +6 -67
- package/dist/workspace/sidebar/workspace-grouping.js +4 -107
- package/dist/workspace/sidebar/workspace-menu-model.d.ts +30 -12
- package/dist/workspace/sidebar/workspace-menu-model.js +13 -107
- package/dist/workspace/sidebar/workspace-menu-section.d.ts +7 -1
- package/dist/workspace/sidebar/workspace-menu-section.js +65 -100
- package/dist/workspace/sidebar/workspace-settings-sidebar-nav.d.ts +34 -0
- package/dist/workspace/sidebar/workspace-settings-sidebar-nav.js +282 -0
- package/dist/workspace/space/space-filter-tabs.js +2 -2
- package/dist/workspace/space/space-page.d.ts +1 -1
- package/dist/workspace/space/space-page.js +1 -1
- package/package.json +59 -51
- package/skills/kortix-ui/SKILL.md +66 -66
- package/skills/kortix-ui/references/custom-dashboard.md +15 -15
- package/skills/kortix-ui/references/modules.md +15 -15
- package/dist/_vendor/shared/artifact-annotations.d.ts +0 -311
- package/dist/_vendor/shared/artifact-comments.d.ts +0 -155
- package/dist/customize/agents/agent-pin-button.d.ts +0 -10
- package/dist/customize/agents/agent-pin-button.js +0 -20
- package/dist/customize/settings/tabs/transfer-workspace-dialog.d.ts +0 -4
- package/dist/customize/settings/tabs/transfer-workspace-dialog.js +0 -82
- package/dist/internal/account-hub/account-settings-shell.d.ts +0 -7
- package/dist/internal/account-hub/account-settings-shell.js +0 -87
- package/dist/internal/account-hub/account-settings-sidebar.d.ts +0 -2
- package/dist/internal/account-hub/account-settings-sidebar.js +0 -169
- package/dist/internal/hooks/use-notification-center.d.ts +0 -50
- package/dist/internal/hooks/use-notification-center.js +0 -151
- package/dist/internal/lib/use-project-feature-flags.d.ts +0 -26
- package/dist/internal/lib/use-project-feature-flags.js +0 -78
- package/dist/internal/stores/pinned-agents-store.d.ts +0 -26
- package/dist/internal/stores/pinned-agents-store.js +0 -20
- package/dist/primitives/info-banner.d.ts +0 -14
- package/dist/primitives/info-banner.js +0 -72
- package/dist/workspace/new/account-picker.d.ts +0 -71
- package/dist/workspace/new/account-picker.js +0 -92
- package/dist/workspace/new/use-creatable-accounts.d.ts +0 -8
- package/dist/workspace/new/use-creatable-accounts.js +0 -33
|
@@ -14,21 +14,17 @@ import { createElement } from 'react';
|
|
|
14
14
|
* 1. Browser support for the Notification API
|
|
15
15
|
* 2. Permission is granted
|
|
16
16
|
* 3. Master enable toggle is on
|
|
17
|
-
* 4. The kind:
|
|
18
|
-
* session of a project with `notification_center` on), the person's
|
|
19
|
-
* server-side Push choice; otherwise the per-browser kind switch
|
|
17
|
+
* 4. The kind: the person's server-side Push choice for it
|
|
20
18
|
* 5. Optionally skips if tab is visible (onlyWhenHidden preference)
|
|
21
19
|
*
|
|
22
20
|
* Every OS notification carries the tag of the Web Push message for the same
|
|
23
21
|
* event: `<type>:<sessionId>`, or `<type>:<projectId>:<triggerSlug>` for an
|
|
24
22
|
* alert (`notificationTag`). Only two service-worker notifications with one
|
|
25
23
|
* tag replace each other: a `new Notification` never replaces one. So while
|
|
26
|
-
* this browser holds a Web Push subscription, the service worker shows
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* the notification center (KRTX-1742).
|
|
24
|
+
* this browser holds a Web Push subscription, the service worker shows this
|
|
25
|
+
* page's copy too, and whichever copy arrives second replaces the first
|
|
26
|
+
* (KRTX-1742).
|
|
30
27
|
*/
|
|
31
|
-
import { cachedNotificationCenter, cachedNotificationCenterAnswer, } from '../hooks/use-notification-center.js';
|
|
32
28
|
import { hasWebPushSubscription } from '../notifications/web-push.js';
|
|
33
29
|
import { customToast, dismissToast, ToastCard, toastIcon, errorToast, infoToast, successToast, warningToast, } from '../../primitives/toast.js';
|
|
34
30
|
import { ClockIcon, GitPullRequestIcon } from '@phosphor-icons/react';
|
|
@@ -75,27 +71,6 @@ export function setServerPushPreferences(kinds) {
|
|
|
75
71
|
function serverPushAllows(type) {
|
|
76
72
|
return serverPush[TYPE_TO_KIND[type]] !== false;
|
|
77
73
|
}
|
|
78
|
-
/**
|
|
79
|
-
* The per-browser switch of each session kind: the kind gate for a payload of
|
|
80
|
-
* a project with `notification_center` off. The other kinds come only from
|
|
81
|
-
* the inbox.
|
|
82
|
-
*/
|
|
83
|
-
const TYPE_TO_PREF = {
|
|
84
|
-
completion: 'onCompletion',
|
|
85
|
-
error: 'onError',
|
|
86
|
-
question: 'onQuestion',
|
|
87
|
-
permission: 'onPermission',
|
|
88
|
-
};
|
|
89
|
-
/**
|
|
90
|
-
* An inbox row, or a session of a project with `notification_center` on: by
|
|
91
|
-
* the raising tab's answer, else by this tab's cached detail or project list.
|
|
92
|
-
* Fail-closed: no project id or nothing cached takes the path from before
|
|
93
|
-
* the notification center.
|
|
94
|
-
*/
|
|
95
|
-
function fromNotificationCenter(payload) {
|
|
96
|
-
return (payload.fromInbox === true ||
|
|
97
|
-
(payload.notificationCenter ?? cachedNotificationCenter(getSharedQueryClient(), payload.projectId)));
|
|
98
|
-
}
|
|
99
74
|
/** Map notification types to sound events */
|
|
100
75
|
const TYPE_TO_SOUND = {
|
|
101
76
|
completion: 'completion',
|
|
@@ -120,14 +95,14 @@ const TYPE_TO_SOUND = {
|
|
|
120
95
|
* time they click, minutes later, the person may be anywhere, so reading the
|
|
121
96
|
* path at click time would resolve the wrong project or none at all.
|
|
122
97
|
*
|
|
123
|
-
* An optional two-letter locale segment leads (`/de/
|
|
124
|
-
* `/
|
|
98
|
+
* An optional two-letter locale segment leads (`/de/workspaces/…`).
|
|
99
|
+
* `/workspaces/new` and `/workspaces/start` are pages, not projects.
|
|
125
100
|
*/
|
|
126
101
|
function currentProjectId() {
|
|
127
102
|
if (typeof window === 'undefined')
|
|
128
103
|
return null;
|
|
129
104
|
const path = normalizeAppPathname(window.location.pathname);
|
|
130
|
-
return projectIdFromPathname(path.replace(/^\/[a-z]{2}(?=\/projects(?:\/|$))/, ''));
|
|
105
|
+
return projectIdFromPathname(path.replace(/^\/[a-z]{2}(?=\/(?:workspaces|projects)(?:\/|$))/, ''));
|
|
131
106
|
}
|
|
132
107
|
/**
|
|
133
108
|
* The payload names a project and the URL shows a different one. Both sides
|
|
@@ -191,8 +166,8 @@ export function isTabHidden() {
|
|
|
191
166
|
* page. Reads the query cache; never fetches.
|
|
192
167
|
*/
|
|
193
168
|
export function spacesThreadHref(location, session, cache) {
|
|
194
|
-
// An optional two-letter locale segment leads (`/de/
|
|
195
|
-
const match = /^(?:\/[a-z]{2})?\/projects\/([^/]+)\/(c|dm)\/([^/]+)\/?$/.exec(normalizeAppPathname(location.pathname));
|
|
169
|
+
// An optional two-letter locale segment leads (`/de/workspaces/…`).
|
|
170
|
+
const match = /^(?:\/[a-z]{2})?\/(?:workspaces|projects)\/([^/]+)\/(c|dm)\/([^/]+)\/?$/.exec(normalizeAppPathname(location.pathname));
|
|
196
171
|
if (!match || match[1] !== session.projectId)
|
|
197
172
|
return null;
|
|
198
173
|
const [, projectId, kind, segment] = match;
|
|
@@ -318,7 +293,6 @@ export function sendWebNotification(payload,
|
|
|
318
293
|
/** Skip all preference/permission gates (used for test notifications) */
|
|
319
294
|
force = false) {
|
|
320
295
|
const { preferences } = useWebNotificationStore.getState();
|
|
321
|
-
const notificationCenter = fromNotificationCenter(payload);
|
|
322
296
|
// `force` (the settings test button) never counts as on screen, focused or
|
|
323
297
|
// another project: it exists to prove the channels work.
|
|
324
298
|
const { sessionId } = payload;
|
|
@@ -357,16 +331,9 @@ force = false) {
|
|
|
357
331
|
// Preferences check
|
|
358
332
|
if (!preferences.enabled)
|
|
359
333
|
return null;
|
|
360
|
-
// Kind check: the person's Push choice,
|
|
361
|
-
if (
|
|
362
|
-
|
|
363
|
-
return null;
|
|
364
|
-
}
|
|
365
|
-
else {
|
|
366
|
-
const prefKey = TYPE_TO_PREF[payload.type];
|
|
367
|
-
if (prefKey && !preferences[prefKey])
|
|
368
|
-
return null;
|
|
369
|
-
}
|
|
334
|
+
// Kind check: the person's Push choice, the same one the phone obeys.
|
|
335
|
+
if (!serverPushAllows(payload.type))
|
|
336
|
+
return null;
|
|
370
337
|
// On-screen and other-project check: see `notificationChannels`.
|
|
371
338
|
if (!channels.os)
|
|
372
339
|
return null;
|
|
@@ -378,9 +345,8 @@ force = false) {
|
|
|
378
345
|
}
|
|
379
346
|
// With Web Push on, the service worker also shows this event's push, and a
|
|
380
347
|
// `new Notification` would never replace it: hand this copy to the worker.
|
|
381
|
-
// `force` (the settings test button) keeps the in-page notification.
|
|
382
|
-
|
|
383
|
-
if (!force && notificationCenter && hasWebPushSubscription() && 'serviceWorker' in navigator) {
|
|
348
|
+
// `force` (the settings test button) keeps the in-page notification.
|
|
349
|
+
if (!force && hasWebPushSubscription() && 'serviceWorker' in navigator) {
|
|
384
350
|
void showWorkerNotification(payload);
|
|
385
351
|
return null;
|
|
386
352
|
}
|
|
@@ -730,15 +696,9 @@ extra) {
|
|
|
730
696
|
if (since !== undefined && turnCompleteShownSince(sessionId, since))
|
|
731
697
|
return;
|
|
732
698
|
// Resolved here and relayed whole: a receiving tab may be on a page whose
|
|
733
|
-
// path holds no project id
|
|
734
|
-
// `notification_center` flag.
|
|
699
|
+
// path holds no project id.
|
|
735
700
|
const projectId = extra?.projectId ?? currentProjectId();
|
|
736
|
-
const msg = {
|
|
737
|
-
sessionId,
|
|
738
|
-
sessionTitle,
|
|
739
|
-
projectId,
|
|
740
|
-
notificationCenter: cachedNotificationCenterAnswer(getSharedQueryClient(), projectId),
|
|
741
|
-
};
|
|
701
|
+
const msg = { sessionId, sessionTitle, projectId };
|
|
742
702
|
broadcastTurnComplete(msg);
|
|
743
703
|
notifyTaskCompleteFor(msg, tI18nComplete);
|
|
744
704
|
}
|
|
@@ -747,7 +707,7 @@ extra) {
|
|
|
747
707
|
* shape the broadcast receiver runs so a relayed completion cannot re-broadcast
|
|
748
708
|
* and loop. It takes the relayed message whole, so no field gets lost.
|
|
749
709
|
*/
|
|
750
|
-
export function notifyTaskCompleteFor({ sessionId, sessionTitle, projectId
|
|
710
|
+
export function notifyTaskCompleteFor({ sessionId, sessionTitle, projectId }, tI18nComplete) {
|
|
751
711
|
noteTurnCompleteShown(sessionId);
|
|
752
712
|
// On a channel or DM page the turn is a thread: it says "thread" and opens
|
|
753
713
|
// in the page's panel. A default title ("New session - <time>") names nothing.
|
|
@@ -775,7 +735,6 @@ export function notifyTaskCompleteFor({ sessionId, sessionTitle, projectId, noti
|
|
|
775
735
|
// page — reinterpreting it as THIS tab's project would build a wrong
|
|
776
736
|
// deep link (the same rule the click-time path documents above).
|
|
777
737
|
projectId,
|
|
778
|
-
notificationCenter,
|
|
779
738
|
};
|
|
780
739
|
if (!projectId) {
|
|
781
740
|
sendWebNotification(payload);
|
|
@@ -1,33 +1,25 @@
|
|
|
1
1
|
/** @internal Kortix apps only. No semver: it may change in any release. */
|
|
2
|
-
import type { InboxNotification } from '@kortix/sdk';
|
|
3
|
-
import { BellIcon } from '@phosphor-icons/react';
|
|
4
|
-
export interface NotificationPanelProps {
|
|
5
|
-
rows: readonly InboxNotification[];
|
|
6
|
-
state: 'loading' | 'error' | 'ready';
|
|
7
|
-
unreadCount: number;
|
|
8
|
-
/** The footer offer to turn browser notifications on; null hides it. */
|
|
9
|
-
prompt: string | null;
|
|
10
|
-
onOpenRow: (row: InboxNotification) => void;
|
|
11
|
-
onMarkAllRead: () => void;
|
|
12
|
-
onRetry: () => void;
|
|
13
|
-
onTurnOn: () => void;
|
|
14
|
-
onDismissPrompt: () => void;
|
|
15
|
-
}
|
|
16
|
-
/** Props only: the header, the All / Needs you / Done tabs, the rows, and the footer offer. */
|
|
17
|
-
export declare function NotificationPanel({ rows, state, unreadCount, prompt, onOpenRow, onMarkAllRead, onRetry, onTurnOn, onDismissPrompt, }: NotificationPanelProps): import("react").JSX.Element;
|
|
18
2
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
3
|
+
* `BellMark`: a glyph with a count disc off its bottom-right corner, in the
|
|
4
|
+
* toast's badge-glow style. The account pages' Inbox button (KRTX-1742) and the
|
|
5
|
+
* project home's access-requests control draw their counts with it. The inbox
|
|
6
|
+
* itself is a page:
|
|
7
|
+
* `notification-inbox.tsx`.
|
|
24
8
|
*/
|
|
9
|
+
import { BellIcon } from '@phosphor-icons/react';
|
|
25
10
|
/**
|
|
26
11
|
* The toast's `REFLECTION_MASK` scaled from its 20px icon to the 16px bell
|
|
27
12
|
* (16px → 12px), centred on the glyph's bottom-right corner where the count
|
|
28
13
|
* sits. At full size it would tint the whole bell.
|
|
29
14
|
*/
|
|
30
15
|
export declare const BELL_REFLECTION_MASK = "radial-gradient(circle 12px at 100% 100%, #000 35%, transparent 100%)";
|
|
16
|
+
/**
|
|
17
|
+
* The bell (Paper B12 in the toast's badge-glow style): the glyph muted, then
|
|
18
|
+
* again in the badge's colour under `BELL_REFLECTION_MASK`, so the
|
|
19
|
+
* colour reaches in from the corner the count sits on, as `EntityTile` in
|
|
20
|
+
* `components/ui/toast.tsx` and `TriggerTile` draw it. Yellow when something
|
|
21
|
+
* waits on the person (the Needs you tab), blue otherwise.
|
|
22
|
+
*/
|
|
31
23
|
export declare function BellMark({ count, needsYou, surface, icon: Glyph, }: {
|
|
32
24
|
count: number;
|
|
33
25
|
needsYou: boolean;
|
|
@@ -35,15 +27,3 @@ export declare function BellMark({ count, needsYou, surface, icon: Glyph, }: {
|
|
|
35
27
|
/** The glyph under the count: the bell, or another control's own mark. */
|
|
36
28
|
icon?: typeof BellIcon;
|
|
37
29
|
}): import("react").JSX.Element;
|
|
38
|
-
/**
|
|
39
|
-
* The bell and its popover. Renders nothing, and reads no inbox, while signed
|
|
40
|
-
* out or while the flag is off for `projectId` (without one: for every cached
|
|
41
|
-
* project). `onNavigate` runs when a row opens its subject (the mobile sidebar
|
|
42
|
-
* closes its sheet).
|
|
43
|
-
*/
|
|
44
|
-
export declare function NotificationBell({ projectId, onNavigate, surface, }: {
|
|
45
|
-
projectId?: string;
|
|
46
|
-
onNavigate?: () => void;
|
|
47
|
-
/** The surface the bell sits on: the count disc paints it, so the disc reads as cut out. */
|
|
48
|
-
surface?: 'bg-background' | 'bg-sidebar';
|
|
49
|
-
}): import("react").JSX.Element | null;
|
|
@@ -1,70 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
2
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* Triggers page for an alert) and marks itself read. When this browser shows
|
|
10
|
-
* no notifications yet, the panel's footer offers to turn them on.
|
|
11
|
-
*
|
|
12
|
-
* `NotificationPanel` is the props-only half: the popover content renders
|
|
13
|
-
* through a portal, so tests render the panel itself.
|
|
3
|
+
* `BellMark`: a glyph with a count disc off its bottom-right corner, in the
|
|
4
|
+
* toast's badge-glow style. The account pages' Inbox button (KRTX-1742) and the
|
|
5
|
+
* project home's access-requests control draw their counts with it. The inbox
|
|
6
|
+
* itself is a page:
|
|
7
|
+
* `notification-inbox.tsx`.
|
|
14
8
|
*/
|
|
15
|
-
import { HoverPrefetchLink } from '../components/hover-prefetch-link.js';
|
|
16
|
-
import { Button } from '../../primitives/button.js';
|
|
17
|
-
import { CountBadge } from '../../primitives/count-badge.js';
|
|
18
|
-
import Hint from '../../primitives/hint.js';
|
|
19
|
-
import { Popover, PopoverContent, PopoverTrigger } from '../../primitives/popover.js';
|
|
20
|
-
import { Skeleton } from '../../primitives/skeleton.js';
|
|
21
|
-
import { Tabs, TabsList, TabsTrigger } from '../../primitives/tabs.js';
|
|
22
|
-
import { ButtonGroup } from '../../primitives/button-group.js';
|
|
23
|
-
import { EmptyState } from '../../primitives/empty-state.js';
|
|
24
|
-
import { SolidCheckIcon } from '../icons/solid-check-icon.js';
|
|
25
|
-
import { ErrorState } from '../../primitives/error-state.js';
|
|
26
|
-
import { useUiViewerId } from '../../providers/ui-provider.js';
|
|
27
|
-
import { useLocale, useTranslations } from '../../i18n/index.js';
|
|
28
|
-
import { relativeTime } from '../lib/relative-time.js';
|
|
29
9
|
import { cn } from '../lib/utils.js';
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
/** Every kind glyph is solid: Phosphor at `weight="fill"`, the done check is `SolidCheckIcon`. */
|
|
39
|
-
const solid = (Icon) => function SolidKindIcon(props) {
|
|
40
|
-
return _jsx(Icon, { weight: "fill", ...props });
|
|
41
|
-
};
|
|
42
|
-
const KIND_MARK = {
|
|
43
|
-
turn_done: { icon: SolidCheckIcon, className: 'text-kortix-green' },
|
|
44
|
-
turn_error: { icon: solid(XCircleIcon), className: 'text-kortix-red' },
|
|
45
|
-
question: { icon: solid(QuestionIcon), className: 'text-kortix-yellow' },
|
|
46
|
-
permission: { icon: solid(ShieldWarningIcon), className: 'text-kortix-yellow' },
|
|
47
|
-
shared: { icon: solid(ShareIcon), className: 'text-muted-foreground' },
|
|
48
|
-
automation_failed: { icon: solid(WarningIcon), className: 'text-kortix-red' },
|
|
49
|
-
automation_recovered: { icon: SolidCheckIcon, className: 'text-kortix-green' },
|
|
50
|
-
capture_device_down: { icon: solid(WarningIcon), className: 'text-kortix-red' },
|
|
51
|
-
capture_device_recovered: { icon: SolidCheckIcon, className: 'text-kortix-green' },
|
|
52
|
-
artifact_comment: { icon: solid(ChatCircleIcon), className: 'text-muted-foreground' },
|
|
53
|
-
};
|
|
54
|
-
/** Props only: the header, the All / Needs you / Done tabs, the rows, and the footer offer. */
|
|
55
|
-
export function NotificationPanel({ rows, state, unreadCount, prompt, onOpenRow, onMarkAllRead, onRetry, onTurnOn, onDismissPrompt, }) {
|
|
56
|
-
const t = useTranslations('notifications');
|
|
57
|
-
const locale = useLocale();
|
|
58
|
-
const [tab, setTab] = useState('all');
|
|
59
|
-
const visible = tabRows(rows, tab);
|
|
60
|
-
const needsCount = tabUnreadCount(rows, 'needs');
|
|
61
|
-
const doneCount = tabUnreadCount(rows, 'done');
|
|
62
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center justify-between gap-2 px-4 pt-2", children: [_jsx("h3", { className: "text-foreground text-sm font-medium", children: t('bell.label') }), unreadCount > 0 ? (_jsx(Button, { variant: "ghost", size: "xs", className: "text-muted-foreground -mr-2.5", onClick: onMarkAllRead, children: t('bell.markAllRead') })) : null] }), _jsx(Tabs, { value: tab, onValueChange: (value) => setTab(value), children: _jsxs(TabsList, { type: "underline", size: "sm", className: "w-full justify-start gap-4 px-4", children: [_jsx(TabsTrigger, { value: "all", className: "w-fit flex-none", children: t('bell.tabAll') }), _jsxs(TabsTrigger, { value: "needs", className: "w-fit flex-none gap-1.5", children: [t('bell.tabNeedsYou'), needsCount > 0 ? _jsx(CountBadge, { count: needsCount, tone: "waiting" }) : null] }), _jsxs(TabsTrigger, { value: "done", className: "w-fit flex-none gap-1.5", children: [t('bell.tabDone'), doneCount > 0 ? _jsx(CountBadge, { count: doneCount }) : null] })] }) }), state === 'loading' ? (_jsx("div", { className: "space-y-1 p-2", children: [0, 1, 2].map((index) => (_jsx(Skeleton, { className: "h-11 py-0" }, index))) })) : state === 'error' ? (_jsx(ErrorState, { size: "sm", title: t('bell.loadError'), action: _jsx(Button, { variant: "outline", size: "sm", onClick: onRetry, children: t('bell.retry') }) })) : visible.length === 0 ? (_jsx(EmptyState, { size: "sm", title: tab === 'needs' && rows.length > 0 ? t('bell.emptyNeedsYou') : t('bell.empty') })) : (_jsx("ul", { className: "max-h-96 space-y-0.5 overflow-y-auto p-1.5", children: visible.map((row) => {
|
|
63
|
-
const mark = KIND_MARK[row.kind] ?? KIND_MARK.shared;
|
|
64
|
-
const unread = !row.read;
|
|
65
|
-
return (_jsx("li", { children: _jsxs(HoverPrefetchLink, { href: withoutNotificationParam(row.url), onClick: () => onOpenRow(row), "data-unread": unread ? '' : undefined, className: "hover:bg-hover focus-visible:ring-ring flex items-start gap-3 rounded-lg px-3 py-2.5 outline-none focus-visible:ring-2", children: [_jsx(mark.icon, { className: cn('mt-0.5 size-4 shrink-0', mark.className, !unread && 'opacity-60'), "aria-hidden": true }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: cn('block truncate text-sm', unread ? 'text-foreground font-medium' : 'text-muted-foreground'), children: row.title }), _jsxs("span", { className: "text-muted-foreground mt-0.5 flex min-w-0 items-center gap-1 text-xs", children: [_jsx("span", { className: "shrink-0", children: t(`kind.${row.kind}`) }), row.project_name ? (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": true, className: "shrink-0", children: "\u00B7" }), _jsx("span", { className: "min-w-0 truncate", children: row.project_name })] })) : null, _jsx("span", { "aria-hidden": true, className: "shrink-0", children: "\u00B7" }), _jsx("span", { className: "shrink-0 tabular-nums", children: relativeTime(row.created_at, locale) })] })] }), _jsx("span", { className: "flex h-5 w-2 shrink-0 items-center justify-end", children: unread ? (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": true, className: "bg-kortix-blue size-1.5 rounded-full" }), _jsx("span", { className: "sr-only", children: t('bell.unread') })] })) : null })] }) }, row.id));
|
|
66
|
-
}) })), prompt ? (_jsxs("div", { className: "flex items-center gap-2 border-t px-4 py-2", children: [_jsx("p", { className: "text-muted-foreground min-w-0 flex-1 text-xs text-pretty", children: prompt }), _jsxs(ButtonGroup, { children: [_jsx(Button, { variant: "secondary", size: "xs", onClick: onTurnOn, children: t('bell.turnOn') }), _jsx(Hint, { label: t('bell.dismiss'), side: "top", children: _jsx(Button, { variant: "secondary", size: "icon-sm", "aria-label": t('bell.dismiss'), onClick: onDismissPrompt, children: _jsx(XIcon, { className: "size-3.5 shrink-0" }) }) })] })] })) : null] }));
|
|
67
|
-
}
|
|
10
|
+
import { BellIcon } from '@phosphor-icons/react';
|
|
11
|
+
import { badgeCount } from './notification-rows.js';
|
|
12
|
+
/**
|
|
13
|
+
* The toast's `REFLECTION_MASK` scaled from its 20px icon to the 16px bell
|
|
14
|
+
* (16px → 12px), centred on the glyph's bottom-right corner where the count
|
|
15
|
+
* sits. At full size it would tint the whole bell.
|
|
16
|
+
*/
|
|
17
|
+
export const BELL_REFLECTION_MASK = 'radial-gradient(circle 12px at 100% 100%, #000 35%, transparent 100%)';
|
|
68
18
|
/**
|
|
69
19
|
* The bell (Paper B12 in the toast's badge-glow style): the glyph muted, then
|
|
70
20
|
* again in the badge's colour under `BELL_REFLECTION_MASK`, so the
|
|
@@ -72,12 +22,6 @@ export function NotificationPanel({ rows, state, unreadCount, prompt, onOpenRow,
|
|
|
72
22
|
* `components/ui/toast.tsx` and `TriggerTile` draw it. Yellow when something
|
|
73
23
|
* waits on the person (the Needs you tab), blue otherwise.
|
|
74
24
|
*/
|
|
75
|
-
/**
|
|
76
|
-
* The toast's `REFLECTION_MASK` scaled from its 20px icon to the 16px bell
|
|
77
|
-
* (16px → 12px), centred on the glyph's bottom-right corner where the count
|
|
78
|
-
* sits. At full size it would tint the whole bell.
|
|
79
|
-
*/
|
|
80
|
-
export const BELL_REFLECTION_MASK = 'radial-gradient(circle 12px at 100% 100%, #000 35%, transparent 100%)';
|
|
81
25
|
export function BellMark({ count, needsYou, surface = 'bg-background', icon: Glyph = BellIcon, }) {
|
|
82
26
|
const tone = needsYou
|
|
83
27
|
? { reflection: 'text-kortix-yellow', disc: 'bg-kortix-yellow' }
|
|
@@ -85,50 +29,3 @@ export function BellMark({ count, needsYou, surface = 'bg-background', icon: Gly
|
|
|
85
29
|
return (_jsxs("span", { className: "relative size-4 shrink-0", children: [_jsx(Glyph, { className: "size-4" }), count > 0 ? (_jsxs(_Fragment, { children: [_jsx(Glyph, { "aria-hidden": true, className: cn('absolute inset-0 size-4', tone.reflection), style: { maskImage: BELL_REFLECTION_MASK, WebkitMaskImage: BELL_REFLECTION_MASK } }), _jsx("span", { "aria-hidden": true, className: cn('absolute -right-2.5 -bottom-2 flex rounded-full p-px', surface), children: _jsx("span", { "data-slot": "bell-count", className: cn('text-background flex h-3.5 min-w-3.5 items-center justify-center rounded-full px-0.5 text-[9px] leading-none font-semibold tabular-nums', // audit:allow a numeral in a 13px disc on a 16px glyph; no type rung fits
|
|
86
30
|
tone.disc), children: badgeCount(count) }) })] })) : null] }));
|
|
87
31
|
}
|
|
88
|
-
/**
|
|
89
|
-
* The bell and its popover. Renders nothing, and reads no inbox, while signed
|
|
90
|
-
* out or while the flag is off for `projectId` (without one: for every cached
|
|
91
|
-
* project). `onNavigate` runs when a row opens its subject (the mobile sidebar
|
|
92
|
-
* closes its sheet).
|
|
93
|
-
*/
|
|
94
|
-
export function NotificationBell({ projectId, onNavigate, surface = 'bg-background', }) {
|
|
95
|
-
const t = useTranslations('notifications');
|
|
96
|
-
const viewerId = useUiViewerId();
|
|
97
|
-
const [open, setOpen] = useState(false);
|
|
98
|
-
const notificationCenter = useNotificationInboxEnabled(projectId);
|
|
99
|
-
const inbox = useNotificationInbox({ userId: viewerId, enabled: notificationCenter });
|
|
100
|
-
const notificationsOn = useWebNotificationStore((s) => s.preferences.enabled);
|
|
101
|
-
const permission = useWebNotificationStore((s) => s.permission);
|
|
102
|
-
const promptDismissed = useWebNotificationStore((s) => s.promptDismissed);
|
|
103
|
-
const requestPermission = useWebNotificationStore((s) => s.requestPermission);
|
|
104
|
-
const setPreference = useWebNotificationStore((s) => s.setPreference);
|
|
105
|
-
const dismissPrompt = useWebNotificationStore((s) => s.dismissPrompt);
|
|
106
|
-
if (!viewerId || !notificationCenter)
|
|
107
|
-
return null;
|
|
108
|
-
const count = inbox.unreadCount;
|
|
109
|
-
const needsYou = tabUnreadCount(inbox.data?.notifications ?? [], 'needs') > 0;
|
|
110
|
-
const label = count > 0 ? t('bell.unreadLabel', { count }) : t('bell.label');
|
|
111
|
-
// A fresh profile enables notifications before OS permission is granted.
|
|
112
|
-
const offerTurnOn = isNotificationSupported() &&
|
|
113
|
-
(!notificationsOn || permission === 'default') &&
|
|
114
|
-
permission !== 'denied' &&
|
|
115
|
-
!promptDismissed;
|
|
116
|
-
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(Hint, { side: "bottom", label: t('bell.label'), children: _jsx(PopoverTrigger, { asChild: true, children: _jsx(Button, { type: "button", variant: "ghost", size: "icon", "aria-label": label, className: "relative shrink-0", children: _jsx(BellMark, { count: count, needsYou: needsYou, surface: surface }) }) }) }), _jsx(PopoverContent, { align: "start", sideOffset: 8, className: "w-96 overflow-hidden p-0", children: _jsx(NotificationPanel, { rows: inbox.data?.notifications ?? [], state: inbox.data ? 'ready' : inbox.isError ? 'error' : 'loading', unreadCount: count, prompt: offerTurnOn
|
|
117
|
-
? webPushSupported()
|
|
118
|
-
? t('bell.promptPush')
|
|
119
|
-
: t('bell.promptBackground')
|
|
120
|
-
: null, onOpenRow: (row) => {
|
|
121
|
-
setOpen(false);
|
|
122
|
-
onNavigate?.();
|
|
123
|
-
if (!row.read)
|
|
124
|
-
inbox.markRead([row.id]).catch(() => { });
|
|
125
|
-
}, onMarkAllRead: () => {
|
|
126
|
-
inbox.markAllRead().catch(() => { });
|
|
127
|
-
}, onRetry: () => void inbox.refetch(),
|
|
128
|
-
// From the click itself: the browser asks for permission only
|
|
129
|
-
// inside a user gesture.
|
|
130
|
-
onTurnOn: async () => {
|
|
131
|
-
if ((await requestPermission()) === 'granted')
|
|
132
|
-
setPreference('enabled', true);
|
|
133
|
-
}, onDismissPrompt: dismissPrompt }) })] }));
|
|
134
|
-
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/** @internal Kortix apps only. No semver: it may change in any release. */
|
|
2
|
+
import type { InboxNotification } from '@kortix/sdk';
|
|
3
|
+
import { type ReactNode } from 'react';
|
|
4
|
+
/** Where "Notification settings" goes: a page (outside a project) or the Settings overlay (inside one). */
|
|
5
|
+
export type InboxSettingsTarget = {
|
|
6
|
+
href: string;
|
|
7
|
+
} | {
|
|
8
|
+
onOpen: () => void;
|
|
9
|
+
};
|
|
10
|
+
export interface NotificationInboxViewProps {
|
|
11
|
+
rows: readonly InboxNotification[];
|
|
12
|
+
state: 'loading' | 'error' | 'ready';
|
|
13
|
+
unreadCount: number;
|
|
14
|
+
/** The offer to turn browser notifications on; null hides it. */
|
|
15
|
+
prompt: string | null;
|
|
16
|
+
settings: InboxSettingsTarget;
|
|
17
|
+
/**
|
|
18
|
+
* The row above the page outside a project (the account pages' top bar).
|
|
19
|
+
* Then the title is the column's heading. Absent: the project page header.
|
|
20
|
+
*/
|
|
21
|
+
header?: ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* Only the scrolling list, without the page frame and title: the workspace
|
|
24
|
+
* Inbox draws its own header and the Review | Notifications tabs above it.
|
|
25
|
+
*/
|
|
26
|
+
bare?: boolean;
|
|
27
|
+
onOpenRow: (row: InboxNotification) => void;
|
|
28
|
+
onMarkAllRead: () => void;
|
|
29
|
+
onRetry: () => void;
|
|
30
|
+
onTurnOn: () => void;
|
|
31
|
+
onDismissPrompt: () => void;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Props only: the page frame and header, the description, the All / Needs you
|
|
35
|
+
* / Done tabs with "Mark all as read", the offer, the rows and the settings
|
|
36
|
+
* footer. Inside a project the title is `ProjectPageHeader` (the Review,
|
|
37
|
+
* Goals and Artifacts pages' header: it owns the desktop title-bar band).
|
|
38
|
+
*/
|
|
39
|
+
export declare function NotificationInboxView({ rows, state, unreadCount, prompt, settings, header, bare, onOpenRow, onMarkAllRead, onRetry, onTurnOn, onDismissPrompt, }: NotificationInboxViewProps): import("react").JSX.Element;
|
|
40
|
+
/**
|
|
41
|
+
* The Inbox page. Reads the inbox `NotificationHost` polls (one cache entry,
|
|
42
|
+
* so the sidebar count and the page agree), and renders nothing while signed
|
|
43
|
+
* out. `settingsHref`: the Settings page outside a project (`/settings/…`);
|
|
44
|
+
* without it, "Notification settings" opens the project's Settings overlay.
|
|
45
|
+
* `header` sits above the page (the account pages' top bar).
|
|
46
|
+
*/
|
|
47
|
+
export declare function NotificationInbox({ settingsHref, header, bare, }: {
|
|
48
|
+
settingsHref?: string;
|
|
49
|
+
header?: ReactNode;
|
|
50
|
+
bare?: boolean;
|
|
51
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* The Inbox (KRTX-1742): the person's notifications from every project, as a
|
|
5
|
+
* page. The project sidebar's Inbox row opens it inside the project shell
|
|
6
|
+
* (`uiRoutes().inbox`); `AccountTopBar` opens it on the account-level pages.
|
|
7
|
+
*
|
|
8
|
+
* A row opens its subject (its session, its Artifact, or the Loops or
|
|
9
|
+
* Triggers page for an alert) and marks itself read. The tabs split what
|
|
10
|
+
* waits on the person (Needs you) from the rest (Done). When this browser
|
|
11
|
+
* shows no notifications yet, the page offers to turn them on. The footer
|
|
12
|
+
* links to the per-kind Push and Email choices in Settings.
|
|
13
|
+
*
|
|
14
|
+
* `NotificationInboxView` is the props-only half: tests render it alone.
|
|
15
|
+
*/
|
|
16
|
+
import { ProjectPageHeader } from '../layout/project-page-header.js';
|
|
17
|
+
import { HoverPrefetchLink } from '../components/hover-prefetch-link.js';
|
|
18
|
+
import { Button } from '../../primitives/button.js';
|
|
19
|
+
import { ButtonGroup } from '../../primitives/button-group.js';
|
|
20
|
+
import { CountBadge } from '../../primitives/count-badge.js';
|
|
21
|
+
import { EmptyArt } from '../../primitives/empty-art.js';
|
|
22
|
+
import { EmptyState } from '../../primitives/empty-state.js';
|
|
23
|
+
import { ErrorState } from '../../primitives/error-state.js';
|
|
24
|
+
import Hint from '../../primitives/hint.js';
|
|
25
|
+
import { Alert as BannerAlert, AlertTitle as BannerAlertTitle, AlertActions as BannerAlertActions, AlertMedia as BannerAlertMedia } from '../../primitives/alert.js';
|
|
26
|
+
import { Skeleton } from '../../primitives/skeleton.js';
|
|
27
|
+
import { Tabs, TabsList, TabsTrigger } from '../../primitives/tabs.js';
|
|
28
|
+
import { SolidCheckIcon } from '../icons/solid-check-icon.js';
|
|
29
|
+
import { UiLink, useUiViewerId } from '../../providers/ui-provider.js';
|
|
30
|
+
import { useLocale, useTranslations } from '../../i18n/index.js';
|
|
31
|
+
import { relativeTime } from '../lib/relative-time.js';
|
|
32
|
+
import { cn } from '../lib/utils.js';
|
|
33
|
+
import { isNotificationSupported } from '../lib/web-notifications.js';
|
|
34
|
+
import { useSettingsPanelStore } from '../stores/settings-panel-store.js';
|
|
35
|
+
import { useWebNotificationStore } from '../stores/web-notification-store.js';
|
|
36
|
+
import { useNotificationInbox } from '@kortix/sdk/react';
|
|
37
|
+
import { BellIcon, ChecksIcon, GearSixIcon, QuestionIcon, ShareIcon, ShieldWarningIcon, WarningIcon, XCircleIcon, XIcon, } from '@phosphor-icons/react';
|
|
38
|
+
import { useState } from 'react';
|
|
39
|
+
import { tabRows, tabUnreadCount, withoutNotificationParam } from './notification-rows.js';
|
|
40
|
+
import { webPushSupported } from './web-push.js';
|
|
41
|
+
/** Every kind glyph is solid: Phosphor at `weight="fill"`, the done check is `SolidCheckIcon`. */
|
|
42
|
+
const solid = (Icon) => function SolidKindIcon(props) {
|
|
43
|
+
return _jsx(Icon, { weight: "fill", ...props });
|
|
44
|
+
};
|
|
45
|
+
const KIND_MARK = {
|
|
46
|
+
turn_done: { icon: SolidCheckIcon, className: 'text-kortix-green' },
|
|
47
|
+
turn_error: { icon: solid(XCircleIcon), className: 'text-kortix-red' },
|
|
48
|
+
question: { icon: solid(QuestionIcon), className: 'text-kortix-yellow' },
|
|
49
|
+
permission: { icon: solid(ShieldWarningIcon), className: 'text-kortix-yellow' },
|
|
50
|
+
shared: { icon: solid(ShareIcon), className: 'text-muted-foreground' },
|
|
51
|
+
automation_failed: { icon: solid(WarningIcon), className: 'text-kortix-red' },
|
|
52
|
+
automation_recovered: { icon: SolidCheckIcon, className: 'text-kortix-green' },
|
|
53
|
+
capture_device_down: { icon: solid(WarningIcon), className: 'text-kortix-red' },
|
|
54
|
+
capture_device_recovered: { icon: SolidCheckIcon, className: 'text-kortix-green' },
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Props only: the page frame and header, the description, the All / Needs you
|
|
58
|
+
* / Done tabs with "Mark all as read", the offer, the rows and the settings
|
|
59
|
+
* footer. Inside a project the title is `ProjectPageHeader` (the Review,
|
|
60
|
+
* Goals and Artifacts pages' header: it owns the desktop title-bar band).
|
|
61
|
+
*/
|
|
62
|
+
export function NotificationInboxView({ rows, state, unreadCount, prompt, settings, header, bare = false, onOpenRow, onMarkAllRead, onRetry, onTurnOn, onDismissPrompt, }) {
|
|
63
|
+
const t = useTranslations('notifications');
|
|
64
|
+
const [tab, setTab] = useState('all');
|
|
65
|
+
const visible = tabRows(rows, tab);
|
|
66
|
+
const needsCount = tabUnreadCount(rows, 'needs');
|
|
67
|
+
const doneCount = tabUnreadCount(rows, 'done');
|
|
68
|
+
const settingsLabel = (_jsxs(_Fragment, { children: [_jsx(GearSixIcon, { className: "size-3.5 shrink-0" }), t('inbox.settings')] }));
|
|
69
|
+
const list = (_jsx("div", { className: "min-h-0 flex-1 overflow-y-auto", children: _jsxs("div", { className: cn('mx-auto flex w-full max-w-4xl flex-col gap-4 px-4 py-6 pb-20', !bare && 'md:px-8'), children: [_jsxs("div", { className: "flex flex-col gap-1.5", children: [header ? _jsx("h1", { className: "text-foreground text-xl font-medium text-balance", children: t('inbox.title') }) : null, _jsx("p", { className: "text-muted-foreground text-sm text-pretty", children: t('inbox.description') })] }), _jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [_jsx(Tabs, { value: tab, onValueChange: (value) => setTab(value), children: _jsxs(TabsList, { children: [_jsxs(TabsTrigger, { value: "all", className: "gap-1.5", children: [t('inbox.tabAll'), unreadCount > 0 ? _jsx(CountBadge, { count: unreadCount }) : null] }), _jsxs(TabsTrigger, { value: "needs", className: "gap-1.5", children: [t('inbox.tabNeedsYou'), needsCount > 0 ? _jsx(CountBadge, { count: needsCount, tone: "waiting" }) : null] }), _jsxs(TabsTrigger, { value: "done", className: "gap-1.5", children: [t('inbox.tabDone'), doneCount > 0 ? _jsx(CountBadge, { count: doneCount }) : null] })] }) }), unreadCount > 0 ? (_jsxs(Button, { variant: "outline", size: "sm", className: "gap-1.5", onClick: onMarkAllRead, children: [_jsx(ChecksIcon, { className: "size-3.5 shrink-0" }), t('inbox.markAllRead')] })) : null] }), prompt ? (_jsxs(BannerAlert, { variant: "default", children: [_jsx(BannerAlertMedia, { children: _jsx(BellIcon, {}) }), _jsx(BannerAlertTitle, { children: prompt }), _jsx(BannerAlertActions, { children: _jsxs(ButtonGroup, { children: [_jsx(Button, { variant: "secondary", size: "xs", onClick: onTurnOn, children: t('inbox.turnOn') }), _jsx(Hint, { label: t('inbox.dismiss'), side: "top", children: _jsx(Button, { variant: "secondary", size: "icon-sm", "aria-label": t('inbox.dismiss'), onClick: onDismissPrompt, children: _jsx(XIcon, { className: "size-3.5 shrink-0" }) }) })] }) })] })) : null, state === 'loading' ? (_jsx("div", { className: "space-y-0.5", children: [0, 1, 2].map((index) => (_jsx(Skeleton, { className: "h-14 w-full rounded-lg" }, index))) })) : state === 'error' ? (_jsx(ErrorState, { size: "sm", title: t('inbox.loadError'), action: _jsx(Button, { variant: "outline", size: "sm", onClick: onRetry, children: t('inbox.retry') }) })) : visible.length === 0 ? (_jsx(EmptyState, { size: "sm", media: _jsx(EmptyArt, { icon: BellIcon }), title: tab === 'needs' && rows.length > 0 ? t('inbox.emptyNeedsYou') : t('inbox.empty'), description: tab === 'needs' && rows.length > 0 ? t('inbox.emptyNeedsYouDescription') : t('inbox.emptyDescription') })) : (_jsx("ul", { className: "space-y-0.5", children: visible.map((row) => (_jsx("li", { children: _jsx(InboxRow, { row: row, onOpen: () => onOpenRow(row) }) }, row.id))) })), _jsxs("div", { className: "flex flex-col gap-2 pt-2 sm:flex-row sm:items-center sm:justify-between", children: [_jsx("p", { className: "text-muted-foreground text-sm text-pretty", children: t('inbox.emailOptIn') }), 'href' in settings ? (_jsx(Button, { asChild: true, variant: "outline", size: "sm", className: "gap-1.5 self-start sm:self-auto", children: _jsx(UiLink, { href: settings.href, children: settingsLabel }) })) : (_jsx(Button, { variant: "outline", size: "sm", className: "gap-1.5 self-start sm:self-auto", onClick: settings.onOpen, children: settingsLabel }))] })] }) }));
|
|
70
|
+
if (bare)
|
|
71
|
+
return list;
|
|
72
|
+
return (
|
|
73
|
+
// `h-svh`: nothing above this box has a definite height (as the Review page).
|
|
74
|
+
_jsxs("div", { className: "flex h-svh min-h-0 flex-col overflow-hidden", children: [header ?? _jsx(ProjectPageHeader, { title: t('inbox.title') }), list] }));
|
|
75
|
+
}
|
|
76
|
+
/** One notification: the kind glyph, its subject, its detail, then kind, project and age. */
|
|
77
|
+
function InboxRow({ row, onOpen }) {
|
|
78
|
+
const t = useTranslations('notifications');
|
|
79
|
+
const locale = useLocale();
|
|
80
|
+
const mark = KIND_MARK[row.kind] ?? KIND_MARK.shared;
|
|
81
|
+
const unread = !row.read;
|
|
82
|
+
return (_jsxs(HoverPrefetchLink, { href: withoutNotificationParam(row.url), onClick: onOpen, "data-unread": unread ? '' : undefined, className: "hover:bg-hover focus-visible:ring-ring flex items-start gap-3 rounded-lg px-3 py-2.5 outline-none focus-visible:ring-2", children: [_jsx(mark.icon, { className: cn('mt-0.5 size-4 shrink-0', mark.className, !unread && 'opacity-60'), "aria-hidden": true }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: cn('block truncate text-sm', unread ? 'text-foreground font-medium' : 'text-muted-foreground'), children: row.title }), row.body ? _jsx("span", { className: "text-muted-foreground mt-0.5 block truncate text-sm", children: row.body }) : null, _jsxs("span", { className: "text-muted-foreground mt-0.5 flex min-w-0 items-center gap-1 text-xs", children: [_jsx("span", { className: "shrink-0", children: t(`kind.${row.kind}`) }), row.project_name ? (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": true, className: "shrink-0", children: "\u00B7" }), _jsx("span", { className: "min-w-0 truncate", children: row.project_name })] })) : null, _jsx("span", { "aria-hidden": true, className: "shrink-0", children: "\u00B7" }), _jsx("span", { className: "shrink-0 tabular-nums", children: relativeTime(row.created_at, locale) })] })] }), _jsx("span", { className: "flex h-5 w-2 shrink-0 items-center justify-end", children: unread ? (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": true, className: "bg-kortix-blue size-1.5 rounded-full" }), _jsx("span", { className: "sr-only", children: t('inbox.unread') })] })) : null })] }));
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* The Inbox page. Reads the inbox `NotificationHost` polls (one cache entry,
|
|
86
|
+
* so the sidebar count and the page agree), and renders nothing while signed
|
|
87
|
+
* out. `settingsHref`: the Settings page outside a project (`/settings/…`);
|
|
88
|
+
* without it, "Notification settings" opens the project's Settings overlay.
|
|
89
|
+
* `header` sits above the page (the account pages' top bar).
|
|
90
|
+
*/
|
|
91
|
+
export function NotificationInbox({ settingsHref, header, bare, }) {
|
|
92
|
+
const t = useTranslations('notifications');
|
|
93
|
+
const viewerId = useUiViewerId();
|
|
94
|
+
const inbox = useNotificationInbox({ userId: viewerId });
|
|
95
|
+
const notificationsOn = useWebNotificationStore((s) => s.preferences.enabled);
|
|
96
|
+
const permission = useWebNotificationStore((s) => s.permission);
|
|
97
|
+
const promptDismissed = useWebNotificationStore((s) => s.promptDismissed);
|
|
98
|
+
const requestPermission = useWebNotificationStore((s) => s.requestPermission);
|
|
99
|
+
const setPreference = useWebNotificationStore((s) => s.setPreference);
|
|
100
|
+
const dismissPrompt = useWebNotificationStore((s) => s.dismissPrompt);
|
|
101
|
+
if (!viewerId)
|
|
102
|
+
return null;
|
|
103
|
+
// A fresh profile enables notifications before OS permission is granted.
|
|
104
|
+
const offerTurnOn = isNotificationSupported() &&
|
|
105
|
+
(!notificationsOn || permission === 'default') &&
|
|
106
|
+
permission !== 'denied' &&
|
|
107
|
+
!promptDismissed;
|
|
108
|
+
return (_jsx(NotificationInboxView, { rows: inbox.data?.notifications ?? [], state: inbox.data ? 'ready' : inbox.isError ? 'error' : 'loading', unreadCount: inbox.unreadCount, prompt: offerTurnOn ? (webPushSupported() ? t('inbox.promptPush') : t('inbox.promptBackground')) : null, settings: settingsHref
|
|
109
|
+
? { href: settingsHref }
|
|
110
|
+
: { onOpen: () => useSettingsPanelStore.getState().openSettings('sessions') }, header: header, bare: bare, onOpenRow: (row) => {
|
|
111
|
+
if (!row.read)
|
|
112
|
+
inbox.markRead([row.id]).catch(() => { });
|
|
113
|
+
}, onMarkAllRead: () => {
|
|
114
|
+
inbox.markAllRead().catch(() => { });
|
|
115
|
+
}, onRetry: () => void inbox.refetch(),
|
|
116
|
+
// From the click itself: the browser asks for permission only
|
|
117
|
+
// inside a user gesture.
|
|
118
|
+
onTurnOn: async () => {
|
|
119
|
+
if ((await requestPermission()) === 'granted')
|
|
120
|
+
setPreference('enabled', true);
|
|
121
|
+
}, onDismissPrompt: dismissPrompt }));
|
|
122
|
+
}
|
|
@@ -59,10 +59,9 @@ export declare function webNotificationType(row: InboxNotification): WebNotifica
|
|
|
59
59
|
export declare function notificationTag(row: InboxNotification): string;
|
|
60
60
|
/**
|
|
61
61
|
* Where a row's open action goes, named by the page its `url` opens: its
|
|
62
|
-
*
|
|
63
|
-
* alert), or the Triggers page.
|
|
62
|
+
* session, the Reminders page (a reminder alert), or the Triggers page.
|
|
64
63
|
*/
|
|
65
|
-
export declare function rowDestination(row: InboxNotification): '
|
|
64
|
+
export declare function rowDestination(row: InboxNotification): 'session' | 'reminders' | 'triggers';
|
|
66
65
|
/** The message `public/sw.js` posts to a tab already on a clicked notification's page. */
|
|
67
66
|
export declare const NOTIFICATION_OPEN_MESSAGE = "kortix:notification-open";
|
|
68
67
|
/** The notification id a service-worker message says this tab opened, or null. */
|
|
@@ -81,7 +80,7 @@ export declare function pollsWhileHidden(input: {
|
|
|
81
80
|
}): boolean;
|
|
82
81
|
/** The id of the newest unread row of `sessionId` in `rows` (newest first), or null. */
|
|
83
82
|
export declare function sessionUnreadRowId(rows: readonly InboxNotification[] | undefined, sessionId: string): string | null;
|
|
84
|
-
/** The
|
|
83
|
+
/** The Inbox page's tabs. `needs` holds the kinds that wait on the person: an answer, an approval, a failure to look at. */
|
|
85
84
|
export type NotificationTab = 'all' | 'needs' | 'done';
|
|
86
85
|
/**
|
|
87
86
|
* The rows a tab shows: unread first, so an untouched row never sits between
|
|
@@ -73,12 +73,9 @@ export function notificationTag(row) {
|
|
|
73
73
|
}
|
|
74
74
|
/**
|
|
75
75
|
* Where a row's open action goes, named by the page its `url` opens: its
|
|
76
|
-
*
|
|
77
|
-
* alert), or the Triggers page.
|
|
76
|
+
* session, the Reminders page (a reminder alert), or the Triggers page.
|
|
78
77
|
*/
|
|
79
78
|
export function rowDestination(row) {
|
|
80
|
-
if (row.artifact_id)
|
|
81
|
-
return 'artifact';
|
|
82
79
|
if (row.session_id)
|
|
83
80
|
return 'session';
|
|
84
81
|
const path = new URL(row.url, 'http://kortix.invalid').pathname;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** @internal Kortix apps only. No semver: it may change in any release. */
|
|
2
|
+
/**
|
|
3
|
+
* The Inbox entry point (KRTX-1742) in the workspace menu: the Inbox page's
|
|
4
|
+
* href, its count, and whether something waits on the person ("needs you").
|
|
5
|
+
* The Inbox holds Review too (2026-11-08), so the count is the unread
|
|
6
|
+
* notifications (99+ at most) plus what waits in this workspace's Review,
|
|
7
|
+
* and "needs you" is an unread question, permission request or failure, or
|
|
8
|
+
* any Review item that waits. The notifications are the inbox
|
|
9
|
+
* `NotificationHost` polls; the Review number reads the review summary and
|
|
10
|
+
* asks the session list already polls. `href` is null when the host serves
|
|
11
|
+
* no Inbox page.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useInboxSummary(projectId: string): {
|
|
14
|
+
href: string | null;
|
|
15
|
+
count: number;
|
|
16
|
+
needsYou: boolean;
|
|
17
|
+
};
|