moi-computer 0.10.1-next.0 → 0.10.1-next.1

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.
@@ -59,7 +59,7 @@ export function SidebarLayout({ children, showWorkspaces = true }: SidebarLayout
59
59
  })
60
60
 
61
61
  return (
62
- <div className={cn('flex h-dvh bg-muted')}>
62
+ <div className="flex h-dvh bg-muted transition-colors duration-100 ease-out motion-reduce:transition-none">
63
63
  <Sidebar workspaces={showWorkspaces ? (workspaces ?? []) : []} />
64
64
  <main className="flex min-w-0 flex-1 flex-col">{children}</main>
65
65
  </div>
@@ -166,7 +166,7 @@ function WorkspaceButton({ workspace, dragOverlay = false, dragState }: Workspac
166
166
  <div
167
167
  className={cn(
168
168
  buttonVariants({ variant: 'ghost', size: 'icon-lg' }),
169
- 'pointer-events-none size-12',
169
+ 'pointer-events-none size-12 transition-[border-radius,background-color,color] duration-100 ease-out motion-reduce:transition-none',
170
170
  dragOverlay
171
171
  ? 'bg-background shadow-lg'
172
172
  : 'group-hover:bg-accent group-hover:text-accent-foreground group-focus-visible:ring-3 group-focus-visible:ring-ring/50',
@@ -176,7 +176,7 @@ function WorkspaceButton({ workspace, dragOverlay = false, dragState }: Workspac
176
176
  <img
177
177
  src={workspace.icon ?? workspaceProviderIcon[workspace.type ?? 'claude-code']}
178
178
  alt=""
179
- className="size-7 shrink-0 rounded-xs"
179
+ className="size-7 shrink-0 rounded-xs transition-[border-radius] duration-100 ease-out motion-reduce:transition-none"
180
180
  />
181
181
  </div>
182
182
  )
@@ -105,6 +105,7 @@ const EMPTY_STATE_STYLES = cn('flex flex-1 flex-col items-center justify-center
105
105
 
106
106
  type ChatEmptyStateProps = {
107
107
  kind: ChatEmptyStateKind
108
+ hasWorkspaceApplets: boolean
108
109
  disabled?: boolean
109
110
  onSelectPrompt: (prompt: ChatPrompt) => void
110
111
  onNavigate: (destination: ChatWelcomeDestination) => void
@@ -112,6 +113,7 @@ type ChatEmptyStateProps = {
112
113
 
113
114
  export function ChatEmptyState({
114
115
  kind,
116
+ hasWorkspaceApplets,
115
117
  disabled = false,
116
118
  onSelectPrompt,
117
119
  onNavigate
@@ -121,7 +123,12 @@ export function ChatEmptyState({
121
123
  return <ViewBuilderChatEmptyState />
122
124
  case 'chat-welcome':
123
125
  return (
124
- <ChatWelcome disabled={disabled} onSelectPrompt={onSelectPrompt} onNavigate={onNavigate} />
126
+ <ChatWelcome
127
+ disabled={disabled}
128
+ showExamples={!hasWorkspaceApplets}
129
+ onSelectPrompt={onSelectPrompt}
130
+ onNavigate={onNavigate}
131
+ />
125
132
  )
126
133
  case 'workspace-welcome':
127
134
  return <ChatWorkspaceWelcome disabled={disabled} onSelectPrompt={onSelectPrompt} />
@@ -147,10 +154,16 @@ type WelcomeProps = {
147
154
  }
148
155
 
149
156
  type ChatWelcomeProps = WelcomeProps & {
157
+ showExamples?: boolean
150
158
  onNavigate: (destination: ChatWelcomeDestination) => void
151
159
  }
152
160
 
153
- export function ChatWelcome({ disabled = false, onSelectPrompt, onNavigate }: ChatWelcomeProps) {
161
+ export function ChatWelcome({
162
+ disabled = false,
163
+ showExamples = true,
164
+ onSelectPrompt,
165
+ onNavigate
166
+ }: ChatWelcomeProps) {
154
167
  return (
155
168
  <div className={cn(EMPTY_STATE_STYLES, '@container w-full max-w-md min-w-0')}>
156
169
  <div className="prose prose-sm min-w-0 wrap-anywhere prose-inherit">
@@ -177,13 +190,15 @@ export function ChatWelcome({ disabled = false, onSelectPrompt, onNavigate }: Ch
177
190
  </WelcomeTerm>{' '}
178
191
  for exploring and shaping ideas with your agent.
179
192
  </p>
180
- <p>Try an example:</p>
193
+ {showExamples && <p>Try an example:</p>}
181
194
  </div>
182
- <ChatPromptBubbles
183
- prompts={CHAT_WELCOME_PROMPTS}
184
- disabled={disabled}
185
- onSelect={onSelectPrompt}
186
- />
195
+ {showExamples && (
196
+ <ChatPromptBubbles
197
+ prompts={CHAT_WELCOME_PROMPTS}
198
+ disabled={disabled}
199
+ onSelect={onSelectPrompt}
200
+ />
201
+ )}
187
202
  </div>
188
203
  )
189
204
  }
@@ -47,6 +47,7 @@ type ChatPanelProps = {
47
47
  focusRequest?: number
48
48
  docked?: boolean
49
49
  chatLoaded: boolean
50
+ hasWorkspaceApplets: boolean
50
51
  view: ViewState
51
52
  // The live streaming preview as a synthetic assistant turn (or null). Merged
52
53
  // into the transcript through the same groupTurns pipeline so a thinking-only
@@ -75,6 +76,7 @@ export function ChatPanel({
75
76
  focusRequest = 0,
76
77
  docked = false,
77
78
  chatLoaded,
79
+ hasWorkspaceApplets,
78
80
  view,
79
81
  previewTurn,
80
82
  sessionId,
@@ -194,6 +196,7 @@ export function ChatPanel({
194
196
  {showEmptyState && (
195
197
  <ChatEmptyState
196
198
  kind={emptyStateKind}
199
+ hasWorkspaceApplets={hasWorkspaceApplets}
197
200
  disabled={promptDisabled}
198
201
  onSelectPrompt={handlePromptSelect}
199
202
  onNavigate={onNavigateFromWelcome}
@@ -1,4 +1,4 @@
1
- import { useCallback, useMemo } from 'react'
1
+ import { useCallback, useEffect, useMemo } from 'react'
2
2
 
3
3
  import { useQueryClient } from '@tanstack/react-query'
4
4
 
@@ -48,9 +48,17 @@ export function useChat(address: WorkspaceTabAddress) {
48
48
  const qc = useQueryClient()
49
49
  const { layout } = useWorkspaceLayoutCtx()
50
50
  const [selectedSession, selectSession] = useSelectedSession()
51
- const selectedSessionId = selectedSession ?? null
52
51
  const modelsData = useWorkspaceAgent(workspaceId).data
53
52
  const sessions = useWorkspaceSessions(workspaceId).data
53
+ const selectedSessionMissing =
54
+ Boolean(selectedSession) &&
55
+ sessions !== undefined &&
56
+ !sessions.some(session => session.sessionId === selectedSession)
57
+ const selectedSessionId = selectedSessionMissing ? null : (selectedSession ?? null)
58
+
59
+ useEffect(() => {
60
+ if (selectedSessionMissing) selectSession(null)
61
+ }, [selectSession, selectedSessionMissing])
54
62
  // Snapshot of the workspace's ambient UI state + queued one-shot
55
63
  // directives, taken when the message actually goes out.
56
64
  const buildMoiContext = useMoiUserMessageContext(address)
@@ -238,6 +238,7 @@ export function WorkspaceScreen({ widgets, views, builders }: WorkspaceScreenPro
238
238
  const openTabIds = effectiveOpenTabs(normalizeTabsState(layout.tabs), views, builders)
239
239
  const nonAgentOpenTabs = openTabIds.filter(tab => tab !== 'agent')
240
240
  const hasWorkspaceContent = nonAgentOpenTabs.length > 0
241
+ const hasWorkspaceApplets = widgets.length > 0 || views.length > 0
241
242
 
242
243
  // Effective layout mode. Split is only visible with workspace content and
243
244
  // enough row width; the saved mode remains the user's intent.
@@ -575,6 +576,7 @@ export function WorkspaceScreen({ widgets, views, builders }: WorkspaceScreenPro
575
576
  active={mode === 'split'}
576
577
  focusRequest={chatFocusRequest}
577
578
  chatLoaded={chatLoaded}
579
+ hasWorkspaceApplets={hasWorkspaceApplets}
578
580
  view={view}
579
581
  previewTurn={previewTurn}
580
582
  sessionId={sessionId}
@@ -596,6 +598,7 @@ export function WorkspaceScreen({ widgets, views, builders }: WorkspaceScreenPro
596
598
  active={mode === 'fullscreen' && activeTab === 'agent'}
597
599
  focusRequest={chatFocusRequest}
598
600
  chatLoaded={chatLoaded}
601
+ hasWorkspaceApplets={hasWorkspaceApplets}
599
602
  view={view}
600
603
  previewTurn={previewTurn}
601
604
  sessionId={sessionId}
@@ -610,7 +613,7 @@ export function WorkspaceScreen({ widgets, views, builders }: WorkspaceScreenPro
610
613
  const workspacePanel = (
611
614
  <div
612
615
  className={cn(
613
- '@container/workspace relative flex h-full min-h-0 min-w-0 flex-1 flex-col-reverse overflow-hidden bg-background shadow-md transition-[border-radius]',
616
+ '@container/workspace relative flex h-full min-h-0 min-w-0 flex-1 flex-col-reverse overflow-hidden bg-background shadow-md transition-[border-radius,background-color] duration-100 ease-out motion-reduce:transition-none',
614
617
  mode === 'split' && 'rounded-xl'
615
618
  )}
616
619
  >
@@ -619,7 +622,7 @@ export function WorkspaceScreen({ widgets, views, builders }: WorkspaceScreenPro
619
622
  ref={annotation.targetRef}
620
623
  inert={annotation.controls.active || undefined}
621
624
  aria-hidden={annotation.controls.active || undefined}
622
- className="flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background"
625
+ className="flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background transition-colors duration-100 ease-out motion-reduce:transition-none"
623
626
  >
624
627
  {activeTab === 'agent' ? (
625
628
  tabbedChat
@@ -752,6 +755,7 @@ export function WorkspaceScreen({ widgets, views, builders }: WorkspaceScreenPro
752
755
  active={floatingChatOpen}
753
756
  focusRequest={chatFocusRequest}
754
757
  chatLoaded={chatLoaded}
758
+ hasWorkspaceApplets={hasWorkspaceApplets}
755
759
  view={view}
756
760
  previewTurn={previewTurn}
757
761
  sessionId={sessionId}