moi-computer 0.12.1-next.3 → 0.13.0
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/bunfig.toml +1 -5
- package/client/api/app-config.ts +1 -2
- package/client/api/app-ui-keys.ts +3 -1
- package/client/api/http.ts +4 -1
- package/client/api/workspace-keys.ts +3 -3
- package/client/app/app-provider.tsx +22 -2
- package/client/app/app-router.tsx +4 -0
- package/client/app/routes/home-route.tsx +14 -0
- package/client/app/routes/onboarding-route.tsx +11 -0
- package/client/app/routes/settings-route.tsx +1 -1
- package/client/app/routes/workspace-route.tsx +21 -19
- package/client/components/shared/screen-shell.tsx +23 -0
- package/client/components/shared/ultrafast-icon.tsx +61 -0
- package/client/components/shared/workspace-icon.tsx +2 -2
- package/client/features/account/account-test-utils.tsx +4 -3
- package/client/features/app-settings/api.ts +33 -0
- package/client/features/app-settings/general-settings.tsx +39 -0
- package/client/features/{settings → app-settings}/settings-page.tsx +5 -1
- package/client/features/chat/applet-chat-intents.ts +4 -20
- package/client/features/chat/chat-send.ts +17 -13
- package/client/features/chat/composer/model-order.ts +8 -4
- package/client/features/chat/composer/model-picker.tsx +88 -34
- package/client/features/chat/composer/use-workspace-composer-state.tsx +11 -3
- package/client/features/chat/composer/use-workspace-skill-updates.ts +1 -1
- package/client/features/chat/connection/chat-frames.ts +3 -15
- package/client/features/chat/messages/chat-empty-state.tsx +1 -4
- package/client/features/chat/messages/fork-history.ts +5 -5
- package/client/features/chat/messages/tool-group/subagent-card.tsx +1 -0
- package/client/features/chat/messages/turn-view.tsx +3 -12
- package/client/features/chat/messages/user-message-bubble.tsx +63 -0
- package/client/features/chat/sessions/api.ts +121 -80
- package/client/features/chat/sessions/browser-tab-state.ts +14 -12
- package/client/features/chat/sessions/chat-selector.tsx +5 -6
- package/client/features/chat/sessions/use-selected-session.ts +172 -257
- package/client/features/chat/use-chat.ts +14 -19
- package/client/features/collab/components/user-avatar.tsx +4 -10
- package/client/features/collab/workspace-users-menu.tsx +1 -1
- package/client/features/connectors/api.ts +12 -4
- package/client/features/connectors/mcp-server-cards.tsx +17 -7
- package/client/features/connectors/read-connectors.ts +35 -0
- package/client/features/demo/demo-dialog.tsx +11 -3
- package/client/features/dev/collab/local-user-settings.tsx +1 -1
- package/client/features/dev/dev-index-page.tsx +5 -0
- package/client/features/dev/dev-routes.tsx +2 -0
- package/client/features/dev/harness-debug-page.tsx +3 -3
- package/client/features/dev/onboarding-preview-page.tsx +76 -0
- package/client/features/dev/workspace-setup-mocks.ts +16 -14
- package/client/features/dev/workspace-setup-preview.tsx +11 -17
- package/client/features/harness/api.ts +45 -15
- package/client/features/harness/device-login-steps.tsx +9 -3
- package/client/features/harness/harness-login-panel.tsx +228 -0
- package/client/features/harness/harness-presentation.ts +15 -0
- package/client/features/harness/harness-selector.tsx +119 -0
- package/client/features/harness/use-harness-login.ts +77 -0
- package/client/features/home/home-page.tsx +7 -7
- package/client/features/onboarding/agent-setup-step.tsx +57 -0
- package/client/features/onboarding/api.ts +42 -0
- package/client/features/onboarding/onboarding-idea-disk.tsx +129 -0
- package/client/features/onboarding/onboarding-page.tsx +32 -0
- package/client/features/onboarding/onboarding-screen.tsx +20 -0
- package/client/features/onboarding/onboarding-status.tsx +24 -0
- package/client/features/onboarding/workspace-setup-step.tsx +239 -0
- package/client/features/overview/default/registry.tsx +2 -2
- package/client/features/overview/default/views-widget.tsx +6 -5
- package/client/features/overview/overview.tsx +9 -11
- package/client/features/overview/widget-canvas.tsx +1 -1
- package/client/features/overview/workspace-name.tsx +2 -2
- package/client/features/views/api.ts +69 -16
- package/client/features/views/pending-view-screen.tsx +30 -9
- package/client/features/views/use-view-actions.ts +19 -20
- package/client/features/views/view-presentation.ts +2 -2
- package/client/features/views/view-submission.ts +28 -41
- package/client/features/workspace/add/api.ts +3 -23
- package/client/features/workspace/add/create-workspace-dialog.tsx +6 -5
- package/client/features/workspace/add/import-workspace-dialog.tsx +3 -3
- package/client/features/workspace/add/workspace-agent-options.ts +11 -12
- package/client/features/workspace/add/workspace-agent-selector.tsx +3 -132
- package/client/features/workspace/api.ts +32 -36
- package/client/features/workspace/harness-transition.ts +89 -0
- package/client/features/{settings → workspace/settings}/api.ts +1 -34
- package/client/features/{settings → workspace/settings}/connectors-settings.tsx +31 -10
- package/client/features/workspace/settings/general-settings.tsx +180 -0
- package/client/features/{settings → workspace/settings}/use-env-vars.ts +1 -1
- package/client/features/{settings → workspace/settings}/workspace-icon-picker.tsx +3 -3
- package/client/features/workspace/setup/workspace-login-state.tsx +37 -156
- package/client/features/workspace/setup/workspace-recovery-states.tsx +0 -12
- package/client/features/workspace/setup/workspace-setup.tsx +34 -14
- package/client/features/workspace/setup/workspace-welcome-state.tsx +2 -2
- package/client/features/workspace/use-workspace-navigation.ts +25 -9
- package/client/features/workspace/workspace-content.tsx +11 -8
- package/client/features/workspace/workspace-frame.tsx +2 -1
- package/client/features/workspace/workspace-layout-context.tsx +5 -2
- package/client/features/workspace/workspace-menu.tsx +12 -8
- package/client/features/workspace/workspace-pending-screen.tsx +10 -10
- package/client/features/workspace/workspace-presentation.tsx +5 -13
- package/client/features/workspace/workspace-state.ts +169 -0
- package/client/features/workspace/workspace-tabs.tsx +22 -2
- package/client/index.css +2 -0
- package/client/index.tsx +3 -3
- package/client/lib/flags.ts +1 -1
- package/client/lib/{app-icon-registry.ts → identity-icon-registry.ts} +10 -14
- package/client/runtime/workspace-events.ts +21 -4
- package/client/runtime/workspace-theme.ts +9 -0
- package/client/tailwind-config.ts +43 -0
- package/dist/chunk-2y59vrxg.js +5 -0
- package/dist/chunk-58dyt9bk.js +2 -0
- package/dist/{chunk-tqd3pkg8.css → chunk-60q353jq.css} +1 -1
- package/dist/chunk-bncc7heg.js +1 -0
- package/dist/{chunk-11cab5dq.css → chunk-cq2r11fg.css} +1 -1
- package/dist/chunk-cqt3s31j.js +546 -0
- package/dist/chunk-dcmks9sm.js +75 -0
- package/dist/chunk-md45evr2.css +1 -0
- package/dist/chunk-n0nab26d.js +1 -0
- package/dist/chunk-nf2wkvf9.js +14 -0
- package/dist/chunk-nmzhgyp9.js +2 -0
- package/dist/chunk-q37knr3m.js +2 -0
- package/dist/chunk-s90m4qkz.js +1 -0
- package/dist/chunk-wjvd4byz.js +2 -0
- package/dist/index.html +1 -1
- package/lib/harness-instructions.ts +1 -1
- package/lib/{app-icons.ts → identity-icons.ts} +6 -7
- package/lib/onboarding.ts +41 -0
- package/lib/speed-mode.ts +5 -0
- package/lib/types.ts +75 -64
- package/lib/view-build-directives.ts +1 -2
- package/lib/workspace-icon.ts +2 -2
- package/lib/workspace-layout.ts +1 -1
- package/lib/workspace-name.ts +15 -12
- package/package.json +11 -8
- package/server/README.md +27 -25
- package/server/api/harnesses.ts +31 -8
- package/server/api/index.ts +189 -127
- package/server/api/onboarding.ts +46 -0
- package/server/app-config.ts +16 -24
- package/server/app-settings.ts +6 -2
- package/server/applets/config.ts +5 -5
- package/server/applets/views.ts +19 -17
- package/server/cli/commands/init.ts +3 -3
- package/server/cli/commands/skill.ts +16 -17
- package/server/cli/commands/start.ts +8 -34
- package/server/cli/server.ts +18 -6
- package/server/collab/config.ts +1 -2
- package/server/collab/manager.ts +4 -1
- package/server/collab/skill/index.ts +1 -1
- package/server/control.ts +3 -3
- package/server/data-dir.ts +1 -1
- package/server/harness/README.md +24 -8
- package/server/harness/acp/session.ts +8 -4
- package/server/harness/auth.ts +14 -17
- package/server/harness/claude-code/NOTES.md +4 -3
- package/server/harness/claude-code/index.ts +5 -6
- package/server/harness/claude-code/mcp.ts +17 -0
- package/server/harness/claude-code/models.ts +2 -20
- package/server/harness/claude-code/run-action.ts +123 -0
- package/server/harness/claude-code/session-title.ts +5 -7
- package/server/harness/claude-code/session.ts +24 -16
- package/server/harness/codex/NOTES.md +22 -10
- package/server/harness/codex/adapter.ts +14 -17
- package/server/harness/codex/client.ts +8 -5
- package/server/harness/codex/connectors.ts +92 -0
- package/server/harness/codex/index.ts +4 -1
- package/server/harness/codex/pagination.ts +8 -5
- package/server/harness/codex/run-action.ts +93 -0
- package/server/harness/codex/session-title.ts +6 -8
- package/server/harness/codex/session.ts +11 -11
- package/server/harness/codex/transport.ts +13 -6
- package/server/harness/command.ts +45 -0
- package/server/harness/executable.ts +5 -0
- package/server/harness/fork.ts +6 -4
- package/server/harness/install.ts +49 -0
- package/server/harness/openclaw/session.ts +1 -2
- package/server/harness/run-action.ts +85 -0
- package/server/harness/session-title.ts +0 -46
- package/server/harness/types.ts +30 -3
- package/server/onboarding/brief.ts +29 -0
- package/server/onboarding/ideas.ts +48 -0
- package/server/onboarding/jobs.ts +291 -0
- package/server/onboarding/prompt.md +49 -0
- package/server/sessions/archive.ts +5 -14
- package/server/sessions/config.ts +17 -16
- package/server/sessions/lifecycle.ts +15 -13
- package/server/sessions/pending-views.ts +79 -108
- package/server/sessions/selected.ts +75 -161
- package/server/sessions/store.ts +40 -113
- package/server/sessions/view-sessions.ts +128 -111
- package/server/skills/locations.ts +82 -0
- package/server/skills/lock.ts +29 -0
- package/server/skills/template.ts +36 -25
- package/server/skills/update.ts +52 -5
- package/server/skills/version.ts +17 -22
- package/server/skills/workspace.ts +121 -0
- package/server/web.ts +22 -8
- package/server/workspace-state/file.ts +177 -0
- package/server/workspace-state/index.ts +162 -0
- package/server/workspace-state/legacy-migration.ts +79 -0
- package/server/workspace-state/lock.ts +42 -0
- package/server/workspace-state/types.ts +16 -0
- package/server/workspaces/change-harness.ts +88 -0
- package/server/workspaces/harness-transition.ts +29 -0
- package/server/workspaces/init.ts +29 -6
- package/server/workspaces/layout.ts +3 -0
- package/server/workspaces/registry.ts +27 -1
- package/{workspace/.claude/skills/moi-workspace → skill}/SKILL.md +7 -5
- package/{workspace/.claude/skills/moi-workspace → skill}/references/COLLAB.md +4 -8
- package/skill/references/DESIGN.md +167 -0
- package/{workspace/.claude/skills/moi-workspace → skill}/references/SCRATCHPAD.md +2 -2
- package/{workspace/.claude/skills/moi-workspace → skill}/references/UI-COMPONENTS.md +3 -0
- package/ui-components/badge.tsx +1 -1
- package/client/accept-hmr-dependencies.ts +0 -22
- package/client/features/settings/general-settings.tsx +0 -103
- package/client/features/workspace/setup/workspace-setup-panel.tsx +0 -18
- package/dist/chunk-20ynagd4.js +0 -2
- package/dist/chunk-42tde9a6.js +0 -1
- package/dist/chunk-9w543s0r.js +0 -2
- package/dist/chunk-a5372n61.js +0 -546
- package/dist/chunk-aja9y1vn.js +0 -68
- package/dist/chunk-fvcvrh3d.css +0 -1
- package/dist/chunk-gtfjw3nx.js +0 -1
- package/dist/chunk-j39y2aky.js +0 -14
- package/dist/chunk-pcnahct1.js +0 -5
- package/dist/chunk-pja30km3.js +0 -1
- package/dist/chunk-rm894bc2.js +0 -2
- package/dist/chunk-tevvtfbk.js +0 -10
- package/dist/chunk-tgt9zd0r.js +0 -2
- package/dist/chunk-tv5k5z00.js +0 -1
- package/dist/chunk-zq2ae5dx.js +0 -2
- package/lib/experimental.ts +0 -14
- package/workspace/.claude/skills/moi-workspace/references/DESIGN.md +0 -157
- /package/client/features/{settings → app-settings}/profile-settings.tsx +0 -0
- /package/client/features/{settings → app-settings}/settings-section.tsx +0 -0
- /package/client/features/{settings → app-settings}/users-settings.tsx +0 -0
- /package/client/features/{settings → workspace/settings}/environment-settings.tsx +0 -0
- /package/client/features/{settings → workspace/settings}/icon-picker-options.ts +0 -0
- /package/client/features/{settings → workspace/settings}/settings-layout.tsx +0 -0
- /package/client/features/{settings → workspace/settings}/workspace-settings-dialog.tsx +0 -0
- /package/{workspace/.claude/skills/moi-workspace → skill}/references/INTENTS.md +0 -0
|
@@ -1,31 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
readSelectedSession,
|
|
4
|
-
writeSelectedSession
|
|
5
|
-
} from '@/client/features/chat/sessions/browser-tab-state'
|
|
6
|
-
import { useCallback, useMemo } from 'react'
|
|
1
|
+
import { useQuery, useQueryClient, type QueryClient } from '@tanstack/react-query'
|
|
2
|
+
import { useCallback } from 'react'
|
|
7
3
|
import { useParams } from 'wouter'
|
|
8
|
-
import { isWorkspaceTabId } from '@/lib/workspace-tabs'
|
|
9
|
-
import type { WorkspaceSessionSelection, WorkspaceTabId } from '@/lib/types'
|
|
10
|
-
import { composerDraftKey } from '@/lib/session-drafts'
|
|
11
|
-
import { useUiStore } from '@/client/store/ui'
|
|
12
|
-
|
|
13
|
-
import { useIsMutating, useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
|
|
14
|
-
import type { QueryClient } from '@tanstack/react-query'
|
|
15
4
|
|
|
16
5
|
import { appUiKeys } from '@/client/api/app-ui-keys'
|
|
17
6
|
import { jsonRequest, requestJson } from '@/client/api/http'
|
|
18
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
readSelectedSession,
|
|
9
|
+
writeSelectedSession,
|
|
10
|
+
type BrowserTabSelection
|
|
11
|
+
} from '@/client/features/chat/sessions/browser-tab-state'
|
|
12
|
+
import { useCollabEnabled } from '@/client/features/collab'
|
|
19
13
|
import { useWorkspaceId } from '@/client/features/workspace/workspace-context'
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
14
|
+
import {
|
|
15
|
+
changeWorkspaceStateCache,
|
|
16
|
+
getCachedWorkspaceState,
|
|
17
|
+
renameSessionInState,
|
|
18
|
+
useWorkspaceState,
|
|
19
|
+
useWorkspaceStateWrite
|
|
20
|
+
} from '@/client/features/workspace/workspace-state'
|
|
21
|
+
import { useUiStore } from '@/client/store/ui'
|
|
22
|
+
import { composerDraftKey } from '@/lib/session-drafts'
|
|
23
|
+
import type { SelectedSessionScope, WorkspaceState, WorkspaceTabId } from '@/lib/types'
|
|
24
|
+
import { isWorkspaceTabId } from '@/lib/workspace-tabs'
|
|
29
25
|
|
|
30
26
|
type SetSelectedSession = (sessionId: string | null) => void
|
|
31
27
|
|
|
@@ -35,23 +31,25 @@ type SelectedSessionResult = readonly [
|
|
|
35
31
|
selectSessionForTab: (sessionId: string, tabId: WorkspaceTabId) => Promise<void>
|
|
36
32
|
]
|
|
37
33
|
|
|
38
|
-
|
|
34
|
+
// PUT shows `sessionId` in the tab (only while it still shows `ifMatch`, when
|
|
35
|
+
// given); DELETE clears the tab if it still shows `sessionId`.
|
|
36
|
+
type SelectionWrite = {
|
|
37
|
+
sessionId: string
|
|
38
|
+
tabId: WorkspaceTabId
|
|
39
|
+
show: boolean
|
|
40
|
+
ifMatch?: string | null
|
|
41
|
+
}
|
|
39
42
|
|
|
40
|
-
export function
|
|
41
|
-
|
|
42
|
-
return scope === 'browser-tab' ? ([...key, 'browser-tab'] as const) : key
|
|
43
|
+
export function browserTabSelectionKey(workspaceId: string) {
|
|
44
|
+
return appUiKeys.browserTabSelection(workspaceId)
|
|
43
45
|
}
|
|
44
46
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
) {
|
|
47
|
+
// sessionStorage is the source; the query only lets React observe it. Dropped
|
|
48
|
+
// on unmount so the next visit reads storage again.
|
|
49
|
+
export function browserTabSelectionOptions(workspaceId: string) {
|
|
49
50
|
return {
|
|
50
|
-
queryKey:
|
|
51
|
-
queryFn: () =>
|
|
52
|
-
scope === 'browser-tab'
|
|
53
|
-
? Promise.resolve(readSelectedSession(workspaceId))
|
|
54
|
-
: requestJson<WorkspaceSessionSelection>(`/api/workspaces/${workspaceId}/selected-session`),
|
|
51
|
+
queryKey: browserTabSelectionKey(workspaceId),
|
|
52
|
+
queryFn: () => Promise.resolve(readSelectedSession(workspaceId)),
|
|
55
53
|
staleTime: Infinity,
|
|
56
54
|
gcTime: 0,
|
|
57
55
|
refetchOnMount: false,
|
|
@@ -59,77 +57,102 @@ export function selectedSessionOptions(
|
|
|
59
57
|
}
|
|
60
58
|
}
|
|
61
59
|
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
// The chat a tab shows: the pin, then this browser tab's own choice (collab),
|
|
61
|
+
// then the workspace's. Undefined until the state has loaded.
|
|
62
|
+
export function selectedSessionForTab(
|
|
63
|
+
state: WorkspaceState | undefined,
|
|
64
|
+
tabId: WorkspaceTabId,
|
|
65
|
+
local?: BrowserTabSelection
|
|
66
|
+
): string | null | undefined {
|
|
67
|
+
if (!state) return undefined
|
|
68
|
+
if (state.pinnedSessionId) return state.pinnedSessionId
|
|
69
|
+
if (local && tabId in local.selected) return local.selected[tabId] ?? null
|
|
70
|
+
return state.selected[tabId] ?? null
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function cachedBrowserTabSelection(
|
|
74
|
+
queryClient: QueryClient,
|
|
75
|
+
workspaceId: string
|
|
76
|
+
): BrowserTabSelection {
|
|
77
|
+
return (
|
|
78
|
+
queryClient.getQueryData<BrowserTabSelection>(browserTabSelectionKey(workspaceId)) ??
|
|
79
|
+
readSelectedSession(workspaceId)
|
|
80
|
+
)
|
|
64
81
|
}
|
|
65
82
|
|
|
66
|
-
|
|
83
|
+
// For handlers outside render, which must see a change before React does.
|
|
84
|
+
export function cachedSelectedSession(
|
|
67
85
|
queryClient: QueryClient,
|
|
68
86
|
workspaceId: string,
|
|
69
|
-
sessionId: string | null,
|
|
70
87
|
tabId: WorkspaceTabId,
|
|
71
|
-
scope: SelectedSessionScope
|
|
72
|
-
):
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
current &&
|
|
78
|
-
previousSessionId === sessionId &&
|
|
79
|
-
(scope === 'shared' || tabId in current.selected)
|
|
88
|
+
scope: SelectedSessionScope
|
|
89
|
+
): string | null | undefined {
|
|
90
|
+
return selectedSessionForTab(
|
|
91
|
+
getCachedWorkspaceState(queryClient, workspaceId),
|
|
92
|
+
tabId,
|
|
93
|
+
scope === 'browser-tab' ? cachedBrowserTabSelection(queryClient, workspaceId) : undefined
|
|
80
94
|
)
|
|
81
|
-
return null
|
|
82
|
-
|
|
83
|
-
const selected = { ...current?.selected }
|
|
84
|
-
if (sessionId === null && scope === 'shared') delete selected[tabId]
|
|
85
|
-
else selected[tabId] = sessionId
|
|
86
|
-
queryClient.setQueryData<WorkspaceSessionSelection>(queryKey, {
|
|
87
|
-
selected,
|
|
88
|
-
pinned: current?.pinned ?? null
|
|
89
|
-
})
|
|
90
|
-
if (scope === 'browser-tab') writeSelectedSession(workspaceId, { selected, pinned: null })
|
|
91
|
-
return { sessionId, previousSessionId, tabId, scope }
|
|
92
95
|
}
|
|
93
96
|
|
|
94
|
-
|
|
97
|
+
function setBrowserTabSelection(
|
|
95
98
|
queryClient: QueryClient,
|
|
96
99
|
workspaceId: string,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
change: (selected: BrowserTabSelection['selected']) => void
|
|
101
|
+
): void {
|
|
102
|
+
const selected = { ...cachedBrowserTabSelection(queryClient, workspaceId).selected }
|
|
103
|
+
change(selected)
|
|
104
|
+
queryClient.setQueryData<BrowserTabSelection>(browserTabSelectionKey(workspaceId), { selected })
|
|
105
|
+
writeSelectedSession(workspaceId, { selected })
|
|
106
|
+
}
|
|
102
107
|
|
|
103
|
-
|
|
104
|
-
if (
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
if (currentSessionId !== input.sessionId && currentSessionId !== input.previousSessionId) {
|
|
108
|
-
return 'ignored'
|
|
109
|
-
}
|
|
108
|
+
function applySelectionWrite(draft: WorkspaceState, input: SelectionWrite): void {
|
|
109
|
+
if (input.show) draft.selected[input.tabId] = input.sessionId
|
|
110
|
+
else if (draft.selected[input.tabId] === input.sessionId) delete draft.selected[input.tabId]
|
|
111
|
+
}
|
|
110
112
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
queryClient
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
113
|
+
// The request that points `tabId` at `sessionId` (null: a new chat), or
|
|
114
|
+
// undefined when nothing needs saving. Collab saves locally right here.
|
|
115
|
+
function selectionChange(
|
|
116
|
+
queryClient: QueryClient,
|
|
117
|
+
workspaceId: string,
|
|
118
|
+
sessionId: string | null,
|
|
119
|
+
tabId: WorkspaceTabId,
|
|
120
|
+
scope: SelectedSessionScope
|
|
121
|
+
): SelectionWrite | undefined {
|
|
122
|
+
if (scope === 'browser-tab') {
|
|
123
|
+
const local = cachedBrowserTabSelection(queryClient, workspaceId)
|
|
124
|
+
if (tabId in local.selected && (local.selected[tabId] ?? null) === sessionId) return
|
|
125
|
+
setBrowserTabSelection(queryClient, workspaceId, selected => {
|
|
126
|
+
selected[tabId] = sessionId
|
|
127
|
+
})
|
|
128
|
+
return
|
|
129
|
+
}
|
|
130
|
+
const current = getCachedWorkspaceState(queryClient, workspaceId)?.selected[tabId] ?? null
|
|
131
|
+
if (current === sessionId) return
|
|
132
|
+
if (sessionId === null) return current ? { sessionId: current, tabId, show: false } : undefined
|
|
133
|
+
return { sessionId, tabId, show: true, ifMatch: current }
|
|
119
134
|
}
|
|
120
135
|
|
|
121
|
-
|
|
136
|
+
// Show a chat in a tab before the server confirms it, without a request: for
|
|
137
|
+
// flows whose own request makes the server select it (view submission).
|
|
138
|
+
export function setSelectedSessionInCache(
|
|
122
139
|
queryClient: QueryClient,
|
|
123
140
|
workspaceId: string,
|
|
124
|
-
|
|
141
|
+
sessionId: string,
|
|
142
|
+
tabId: WorkspaceTabId,
|
|
143
|
+
scope: SelectedSessionScope
|
|
125
144
|
): void {
|
|
126
|
-
if (
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
145
|
+
if (scope === 'browser-tab')
|
|
146
|
+
setBrowserTabSelection(queryClient, workspaceId, selected => {
|
|
147
|
+
selected[tabId] = sessionId
|
|
148
|
+
})
|
|
149
|
+
else
|
|
150
|
+
changeWorkspaceStateCache(queryClient, workspaceId, draft => {
|
|
151
|
+
draft.selected[tabId] = sessionId
|
|
152
|
+
})
|
|
131
153
|
}
|
|
132
154
|
|
|
155
|
+
// A harness replaced a temporary chat id with its real one.
|
|
133
156
|
export function renameSelectedSessionInCache(
|
|
134
157
|
queryClient: QueryClient,
|
|
135
158
|
workspaceId: string,
|
|
@@ -139,29 +162,12 @@ export function renameSelectedSessionInCache(
|
|
|
139
162
|
useUiStore
|
|
140
163
|
.getState()
|
|
141
164
|
.moveComposerDraft(composerDraftKey(workspaceId, from), composerDraftKey(workspaceId, to))
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
selected: Object.fromEntries(
|
|
149
|
-
Object.entries(current.selected).map(([tabId, id]) => [
|
|
150
|
-
tabId,
|
|
151
|
-
id === from ? to : id
|
|
152
|
-
])
|
|
153
|
-
),
|
|
154
|
-
pinned: current.pinned === from ? to : current.pinned
|
|
155
|
-
}
|
|
156
|
-
: current
|
|
157
|
-
)
|
|
158
|
-
}
|
|
159
|
-
const local = readSelectedSession(workspaceId)
|
|
160
|
-
writeSelectedSession(workspaceId, {
|
|
161
|
-
selected: Object.fromEntries(
|
|
162
|
-
Object.entries(local.selected).map(([tabId, id]) => [tabId, id === from ? to : id])
|
|
163
|
-
),
|
|
164
|
-
pinned: null
|
|
165
|
+
changeWorkspaceStateCache(queryClient, workspaceId, draft =>
|
|
166
|
+
renameSessionInState(draft, from, to)
|
|
167
|
+
)
|
|
168
|
+
setBrowserTabSelection(queryClient, workspaceId, selected => {
|
|
169
|
+
for (const [tabId, sessionId] of Object.entries(selected) as [WorkspaceTabId, string | null][])
|
|
170
|
+
if (sessionId === from) selected[tabId] = to
|
|
165
171
|
})
|
|
166
172
|
}
|
|
167
173
|
|
|
@@ -170,15 +176,17 @@ export function useCurrentTabId(): WorkspaceTabId {
|
|
|
170
176
|
return isWorkspaceTabId(tab) ? tab : 'overview'
|
|
171
177
|
}
|
|
172
178
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
)
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
179
|
+
function useSelectionWrite(workspaceId: string) {
|
|
180
|
+
return useWorkspaceStateWrite<SelectionWrite>(workspaceId, {
|
|
181
|
+
request: ({ sessionId, tabId, show, ifMatch }) =>
|
|
182
|
+
requestJson<WorkspaceState>(
|
|
183
|
+
`/api/workspaces/${workspaceId}/sessions/${encodeURIComponent(sessionId)}/selection`,
|
|
184
|
+
jsonRequest(show ? 'PUT' : 'DELETE', show ? { tabId, ifMatch } : { tabId }),
|
|
185
|
+
'Couldn’t save selected chat'
|
|
186
|
+
),
|
|
187
|
+
optimistic: applySelectionWrite,
|
|
188
|
+
errorTitle: 'Couldn’t save selected chat'
|
|
189
|
+
})
|
|
182
190
|
}
|
|
183
191
|
|
|
184
192
|
export function useSelectedSession(explicitTabId?: WorkspaceTabId): SelectedSessionResult {
|
|
@@ -188,164 +196,71 @@ export function useSelectedSession(explicitTabId?: WorkspaceTabId): SelectedSess
|
|
|
188
196
|
const collabEnabled = useCollabEnabled()
|
|
189
197
|
const scope: SelectedSessionScope = collabEnabled ? 'browser-tab' : 'shared'
|
|
190
198
|
const queryClient = useQueryClient()
|
|
191
|
-
const
|
|
192
|
-
const
|
|
193
|
-
(
|
|
194
|
-
|
|
195
|
-
)
|
|
196
|
-
const
|
|
197
|
-
|
|
198
|
-
// WorkspaceContent remains an observer for the active workspace. Nested hook
|
|
199
|
-
// users reuse its result without refetching; once the route unmounts, dropping
|
|
200
|
-
// the cache makes the next visit load the server-owned selection again.
|
|
201
|
-
const query = useQuery(selectedSessionOptions(workspaceId, scope))
|
|
202
|
-
// A pin is shared with CLI creation and applies to every workspace tab.
|
|
203
|
-
const sharedSelection = useWorkspaceSessionSelection().data
|
|
204
|
-
|
|
205
|
-
const { mutate: saveSelectedSession, mutateAsync: saveSelectedSessionAsync } = useMutation<
|
|
206
|
-
SelectedSessionState,
|
|
207
|
-
Error,
|
|
208
|
-
SaveSelectedSessionInput
|
|
209
|
-
>({
|
|
210
|
-
mutationKey,
|
|
211
|
-
scope: { id: `selected-session:${workspaceId}` },
|
|
212
|
-
mutationFn: input => {
|
|
213
|
-
if (input.scope === 'browser-tab') {
|
|
214
|
-
writeSelectedSession(
|
|
215
|
-
workspaceId,
|
|
216
|
-
queryClient.getQueryData<WorkspaceSessionSelection>(queryKey) ??
|
|
217
|
-
readSelectedSession(workspaceId)
|
|
218
|
-
)
|
|
219
|
-
return Promise.resolve({ sessionId: input.sessionId })
|
|
220
|
-
}
|
|
221
|
-
return requestJson<SelectedSessionState>(
|
|
222
|
-
`/api/workspaces/${workspaceId}/selected-session`,
|
|
223
|
-
jsonRequest('PUT', input),
|
|
224
|
-
'Couldn’t save selected chat'
|
|
225
|
-
)
|
|
226
|
-
},
|
|
227
|
-
onSuccess: (saved, input) => {
|
|
228
|
-
const result = settleSelectedSessionSave(queryClient, workspaceId, saved, input)
|
|
229
|
-
if (result !== 'conflict') return
|
|
230
|
-
|
|
231
|
-
toast.add({ title: 'Couldn’t save selected chat', type: 'error' })
|
|
232
|
-
void queryClient.invalidateQueries({ queryKey, exact: true })
|
|
233
|
-
},
|
|
234
|
-
onError: (_error, input) => {
|
|
235
|
-
const current = queryClient.getQueryData<WorkspaceSessionSelection>(queryKey)
|
|
236
|
-
if ((current?.selected[input.tabId] ?? null) !== input.sessionId) return
|
|
237
|
-
|
|
238
|
-
toast.add({ title: 'Couldn’t save selected chat', type: 'error' })
|
|
239
|
-
void queryClient.invalidateQueries({ queryKey, exact: true })
|
|
240
|
-
},
|
|
241
|
-
onSettled: () => {
|
|
242
|
-
if (scope === 'shared' && queryClient.isMutating({ mutationKey, exact: true }) === 1)
|
|
243
|
-
void queryClient.invalidateQueries({ queryKey, exact: true })
|
|
244
|
-
}
|
|
245
|
-
})
|
|
199
|
+
const state = useWorkspaceState(workspaceId).data
|
|
200
|
+
const local = useQuery({
|
|
201
|
+
...browserTabSelectionOptions(workspaceId),
|
|
202
|
+
enabled: scope === 'browser-tab'
|
|
203
|
+
}).data
|
|
204
|
+
const { mutate: save, mutateAsync: saveAsync } = useSelectionWrite(workspaceId)
|
|
246
205
|
|
|
247
206
|
const setSelectedSessionId = useCallback<SetSelectedSession>(
|
|
248
207
|
sessionId => {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
)
|
|
252
|
-
|
|
253
|
-
const input = optimisticallySetSelectedSession(
|
|
254
|
-
queryClient,
|
|
255
|
-
workspaceId,
|
|
256
|
-
sessionId,
|
|
257
|
-
tabId,
|
|
258
|
-
scope
|
|
259
|
-
)
|
|
260
|
-
if (input) saveSelectedSession(input)
|
|
208
|
+
// A pinned chat shows in every tab until it is unpinned.
|
|
209
|
+
if (getCachedWorkspaceState(queryClient, workspaceId)?.pinnedSessionId) return
|
|
210
|
+
const input = selectionChange(queryClient, workspaceId, sessionId, tabId, scope)
|
|
211
|
+
if (input) save(input)
|
|
261
212
|
},
|
|
262
|
-
[queryClient,
|
|
213
|
+
[queryClient, save, workspaceId, tabId, scope]
|
|
263
214
|
)
|
|
264
215
|
|
|
265
216
|
const selectSessionForTab = useCallback(
|
|
266
217
|
async (sessionId: string, destination: WorkspaceTabId) => {
|
|
267
|
-
const input =
|
|
268
|
-
queryClient,
|
|
269
|
-
workspaceId,
|
|
270
|
-
sessionId,
|
|
271
|
-
destination,
|
|
272
|
-
scope
|
|
273
|
-
)
|
|
218
|
+
const input = selectionChange(queryClient, workspaceId, sessionId, destination, scope)
|
|
274
219
|
if (!input) return
|
|
275
|
-
const saved = await
|
|
276
|
-
if (
|
|
277
|
-
saved.sessionId !== sessionId ||
|
|
278
|
-
queryClient.getQueryData<WorkspaceSessionSelection>(queryKey)?.selected[destination] !==
|
|
279
|
-
sessionId
|
|
280
|
-
)
|
|
281
|
-
throw new Error('Couldn’t save selected chat')
|
|
220
|
+
const saved = await saveAsync(input)
|
|
221
|
+
if (saved.selected[destination] !== sessionId) throw new Error('Couldn’t save selected chat')
|
|
282
222
|
},
|
|
283
|
-
[queryClient,
|
|
223
|
+
[queryClient, saveAsync, scope, workspaceId]
|
|
284
224
|
)
|
|
285
225
|
|
|
286
|
-
useWorkspaceEvent(event => {
|
|
287
|
-
if (event.type !== 'selected-session:updated' || event.workspaceId !== workspaceId) return
|
|
288
|
-
applySelectedSessionEvent(queryClient, workspaceId, scope === 'shared' && pendingSaves > 0)
|
|
289
|
-
})
|
|
290
|
-
|
|
291
226
|
const selectedSessionId =
|
|
292
|
-
|
|
227
|
+
scope === 'browser-tab' && local === undefined
|
|
293
228
|
? undefined
|
|
294
|
-
: selectedSessionForTab(
|
|
295
|
-
sharedSelection,
|
|
296
|
-
tabId,
|
|
297
|
-
scope === 'browser-tab' ? query.data : undefined
|
|
298
|
-
)
|
|
229
|
+
: selectedSessionForTab(state, tabId, scope === 'browser-tab' ? local : undefined)
|
|
299
230
|
return [selectedSessionId, setSelectedSessionId, selectSessionForTab]
|
|
300
231
|
}
|
|
301
232
|
|
|
302
|
-
function useWorkspaceSessionSelection() {
|
|
303
|
-
const workspaceId = useWorkspaceId()
|
|
304
|
-
return useQuery(selectedSessionOptions(workspaceId))
|
|
305
|
-
}
|
|
306
|
-
|
|
307
233
|
export function usePinnedSession() {
|
|
308
234
|
const workspaceId = useWorkspaceId()
|
|
309
235
|
const queryClient = useQueryClient()
|
|
310
|
-
const
|
|
311
|
-
const
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
}))
|
|
326
|
-
return previousPinnedSessionId
|
|
327
|
-
},
|
|
328
|
-
onError: (_error, sessionId, previousPinnedSessionId) => {
|
|
329
|
-
queryClient.setQueryData<WorkspaceSessionSelection>(
|
|
330
|
-
appUiKeys.sessionSelection(workspaceId),
|
|
331
|
-
current =>
|
|
332
|
-
current?.pinned === sessionId
|
|
333
|
-
? { ...current, pinned: previousPinnedSessionId ?? null }
|
|
334
|
-
: current
|
|
335
|
-
)
|
|
336
|
-
toast.add({ title: 'Couldn’t pin chat', type: 'error' })
|
|
337
|
-
},
|
|
338
|
-
onSettled: () => {
|
|
339
|
-
void queryClient.invalidateQueries({
|
|
340
|
-
queryKey: appUiKeys.sessionSelection(workspaceId),
|
|
341
|
-
exact: true
|
|
342
|
-
})
|
|
236
|
+
const state = useWorkspaceState(workspaceId).data
|
|
237
|
+
const { mutate, mutateAsync } = useWorkspaceStateWrite<{ sessionId: string; pinned: boolean }>(
|
|
238
|
+
workspaceId,
|
|
239
|
+
{
|
|
240
|
+
request: ({ sessionId, pinned }) =>
|
|
241
|
+
requestJson<WorkspaceState>(
|
|
242
|
+
`/api/workspaces/${workspaceId}/sessions/${encodeURIComponent(sessionId)}/pin`,
|
|
243
|
+
{ method: pinned ? 'PUT' : 'DELETE' },
|
|
244
|
+
pinned ? 'Couldn’t pin chat' : 'Couldn’t unpin chat'
|
|
245
|
+
),
|
|
246
|
+
optimistic: (draft, { sessionId, pinned }) => {
|
|
247
|
+
if (pinned) draft.pinnedSessionId = sessionId
|
|
248
|
+
else if (draft.pinnedSessionId === sessionId) delete draft.pinnedSessionId
|
|
249
|
+
},
|
|
250
|
+
errorTitle: 'Couldn’t change the pinned chat'
|
|
343
251
|
}
|
|
344
|
-
|
|
252
|
+
)
|
|
253
|
+
const pin = useCallback((sessionId: string) => mutate({ sessionId, pinned: true }), [mutate])
|
|
254
|
+
const unpinAsync = useCallback(async () => {
|
|
255
|
+
const pinned = getCachedWorkspaceState(queryClient, workspaceId)?.pinnedSessionId
|
|
256
|
+
if (pinned) await mutateAsync({ sessionId: pinned, pinned: false })
|
|
257
|
+
}, [mutateAsync, queryClient, workspaceId])
|
|
258
|
+
const unpin = useCallback(() => void unpinAsync().catch(() => {}), [unpinAsync])
|
|
345
259
|
return {
|
|
346
|
-
pinnedSessionId:
|
|
347
|
-
loaded:
|
|
348
|
-
pin
|
|
349
|
-
|
|
260
|
+
pinnedSessionId: state?.pinnedSessionId,
|
|
261
|
+
loaded: state !== undefined,
|
|
262
|
+
pin,
|
|
263
|
+
unpin,
|
|
264
|
+
unpinAsync
|
|
350
265
|
}
|
|
351
266
|
}
|
|
@@ -3,12 +3,8 @@ import { useCallback, useMemo } from 'react'
|
|
|
3
3
|
import { useQueryClient } from '@tanstack/react-query'
|
|
4
4
|
|
|
5
5
|
import { workspaceKeys } from '@/client/api/workspace-keys'
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
useSessionView,
|
|
9
|
-
useWorkspaceSessions
|
|
10
|
-
} from '@/client/features/chat/sessions/api'
|
|
11
|
-
import { useWorkspaceAgent } from '@/client/features/workspace/api'
|
|
6
|
+
import { useSessionState, useSessionView } from '@/client/features/chat/sessions/api'
|
|
7
|
+
import { useWorkspaceHarness } from '@/client/features/workspace/api'
|
|
12
8
|
import { useSelectedSession } from '@/client/features/chat/sessions/use-selected-session'
|
|
13
9
|
import { useCollabEnabled } from '@/client/features/collab'
|
|
14
10
|
import {
|
|
@@ -58,8 +54,7 @@ export function useChat(address: WorkspaceTabAddress) {
|
|
|
58
54
|
const { layout } = useWorkspaceLayoutCtx()
|
|
59
55
|
const [selectedSession, selectSession] = useSelectedSession(address.activeTab)
|
|
60
56
|
const collabEnabled = useCollabEnabled()
|
|
61
|
-
const modelsData =
|
|
62
|
-
const sessions = useWorkspaceSessions(workspaceId).data
|
|
57
|
+
const modelsData = useWorkspaceHarness(workspaceId).data
|
|
63
58
|
// A newly forked/native session can precede the provider's session listing.
|
|
64
59
|
// Archive explicitly clears selection; a stale catalog must not do so.
|
|
65
60
|
const selectedSessionId = selectedSession ?? null
|
|
@@ -79,20 +74,20 @@ export function useChat(address: WorkspaceTabAddress) {
|
|
|
79
74
|
|
|
80
75
|
const viewQuery = useSessionView(workspaceId, selectedSessionId)
|
|
81
76
|
const { refetch } = viewQuery
|
|
82
|
-
|
|
77
|
+
// Tab, settings and fork history, from the workspace state.
|
|
78
|
+
const session = useSessionState(workspaceId, selectedSessionId)
|
|
83
79
|
const { refetch: refetchSession } = session
|
|
84
80
|
const retryLoad = useCallback(async () => {
|
|
85
81
|
await refetch()
|
|
86
82
|
await refetchSession()
|
|
87
83
|
}, [refetch, refetchSession])
|
|
88
|
-
const
|
|
84
|
+
const fork = session.data?.fork
|
|
89
85
|
const sessionReady = !selectedSessionId || session.data !== undefined
|
|
90
86
|
let view = sessionReady ? (viewQuery.data ?? EMPTY) : EMPTY
|
|
91
|
-
if (viewQuery.data &&
|
|
87
|
+
if (viewQuery.data && fork) view = visibleForkHistory(viewQuery.data, fork)
|
|
92
88
|
const chatLoaded =
|
|
93
89
|
selectedSession !== undefined &&
|
|
94
90
|
sessionReady &&
|
|
95
|
-
sessions !== undefined &&
|
|
96
91
|
(selectedSessionId === null || viewQuery.data !== undefined)
|
|
97
92
|
|
|
98
93
|
// The live streaming preview as a synthetic assistant turn, so the ChatPanel
|
|
@@ -163,12 +158,12 @@ export function useChat(address: WorkspaceTabAddress) {
|
|
|
163
158
|
// Validate effort and Fast mode against that same resolved row.
|
|
164
159
|
const pickedModel = sessionConfig?.model ?? layout.selectedModel
|
|
165
160
|
const pickedEffort = sessionConfig?.effort ?? layout.selectedEffort
|
|
166
|
-
const
|
|
167
|
-
const { model, effort,
|
|
161
|
+
const pickedSpeedMode = sessionConfig?.speedMode ?? layout.selectedSpeedMode
|
|
162
|
+
const { model, effort, speedMode, stream } = resolveChatRunOptions(
|
|
168
163
|
modelsData,
|
|
169
164
|
pickedModel,
|
|
170
165
|
pickedEffort,
|
|
171
|
-
|
|
166
|
+
pickedSpeedMode
|
|
172
167
|
)
|
|
173
168
|
sendMessage({
|
|
174
169
|
type: 'chat',
|
|
@@ -180,7 +175,7 @@ export function useChat(address: WorkspaceTabAddress) {
|
|
|
180
175
|
optimisticId,
|
|
181
176
|
model,
|
|
182
177
|
effort,
|
|
183
|
-
|
|
178
|
+
speedMode,
|
|
184
179
|
stream,
|
|
185
180
|
context: buildMoiContext(options),
|
|
186
181
|
...(attachments.length > 0 ? { attachments } : {})
|
|
@@ -198,11 +193,11 @@ export function useChat(address: WorkspaceTabAddress) {
|
|
|
198
193
|
qc,
|
|
199
194
|
layout.selectedModel,
|
|
200
195
|
layout.selectedEffort,
|
|
201
|
-
layout.
|
|
196
|
+
layout.selectedSpeedMode,
|
|
202
197
|
buildMoiContext,
|
|
203
198
|
sessionConfig?.model,
|
|
204
199
|
sessionConfig?.effort,
|
|
205
|
-
sessionConfig?.
|
|
200
|
+
sessionConfig?.speedMode,
|
|
206
201
|
selectSession,
|
|
207
202
|
collabEnabled,
|
|
208
203
|
modelsData
|
|
@@ -221,7 +216,7 @@ export function useChat(address: WorkspaceTabAddress) {
|
|
|
221
216
|
|
|
222
217
|
return {
|
|
223
218
|
view,
|
|
224
|
-
forkedFromSessionId,
|
|
219
|
+
forkedFromSessionId: fork?.fromSessionId,
|
|
225
220
|
chatLoaded,
|
|
226
221
|
previewTurn,
|
|
227
222
|
sessionId: selectedSessionId,
|
|
@@ -40,12 +40,7 @@ export function UserAvatar({
|
|
|
40
40
|
const name = user ? userDisplayName(user) : 'Unknown user'
|
|
41
41
|
|
|
42
42
|
return (
|
|
43
|
-
<Avatar
|
|
44
|
-
size={size}
|
|
45
|
-
aria-label={name}
|
|
46
|
-
data-collab-color={user?.color ?? 'unknown'}
|
|
47
|
-
className={cn('after:border-0', className)}
|
|
48
|
-
>
|
|
43
|
+
<Avatar size={size} aria-label={name} className={cn('after:border-0', className)}>
|
|
49
44
|
{user?.avatar && <AvatarImage src={user.avatar} alt="" />}
|
|
50
45
|
<AvatarFallback>
|
|
51
46
|
{user ? (
|
|
@@ -54,11 +49,10 @@ export function UserAvatar({
|
|
|
54
49
|
name={user.id}
|
|
55
50
|
animate="hover"
|
|
56
51
|
background="circle"
|
|
57
|
-
traits={{ 'eye.rx': 1 }}
|
|
58
52
|
palette={{
|
|
59
|
-
bg: 'var(--
|
|
60
|
-
head: 'var(--
|
|
61
|
-
eye: 'var(--
|
|
53
|
+
bg: 'color-mix(in srgb, var(--muted) 85%, var(--foreground))',
|
|
54
|
+
head: 'color-mix(in srgb, var(--muted) 85%, var(--foreground))',
|
|
55
|
+
eye: 'var(--foreground)'
|
|
62
56
|
}}
|
|
63
57
|
/>
|
|
64
58
|
) : (
|
|
@@ -60,7 +60,7 @@ export function WorkspaceUsersMenu({
|
|
|
60
60
|
.map(user => user.profile.id)
|
|
61
61
|
const [open, setOpen] = useState(false)
|
|
62
62
|
|
|
63
|
-
if (!enabled) return null
|
|
63
|
+
if (!enabled || workspaceUsers.length <= 1) return null
|
|
64
64
|
|
|
65
65
|
return (
|
|
66
66
|
<Popover open={open} onOpenChange={setOpen}>
|