fix: conversation not showing (empty state)#2111
Conversation
Greptile SummaryThis PR fixes a bug where the "No conversations yet" empty state was incorrectly shown even when a conversation exists but its
Confidence Score: 4/5The change is safe to merge; it correctly eliminates the stale empty-state flash and the unneeded dimension pre-measurement. The core fix is sound and well-scoped. The two concerns are: (1) removing the empty-state CTA leaves a blank panel when no conversation has been started yet, which may surprise first-time users; (2) the resolvedTabs[0] fallback in pane-renderer.ts can briefly switch the view to a file/diff tab while a conversation is loading when mixed tabs are open. pane-renderer.ts deserves a second look around the fallback logic on line 24; conversations-panel.tsx should be verified to confirm there is another discoverable way to create a first conversation.
|
| Filename | Overview |
|---|---|
| src/renderer/features/tasks/conversations/conversations-panel.tsx | Removes the empty-state guard (hasConversationTabs) and the "Create conversation" inline UI; the panel now always renders a plain wrapper and shows the PTY terminal only when a session is ready. |
| src/renderer/features/tasks/conversations/create-conversation-modal.tsx | Removes the getConversationsPaneSize helper and the initialSize field from the conversation creation call. Clean removal with no outstanding issues. |
| src/renderer/features/tasks/view/pane-renderer.ts | Switches from activeDescriptor (raw entries map) to resolvedTabs as the source of truth; falls back to resolvedTabs[0] when no tab is marked active — see comment about the implicit tab-switch side-effect. |
Sequence Diagram
sequenceDiagram
participant User
participant TabManager
participant resolvePaneRenderer
participant ConversationsPanel
Note over TabManager: Conversation tab open,<br/>ConversationStore loading
TabManager->>resolvePaneRenderer: resolvedTabs (conversation filtered out if store not ready)
resolvePaneRenderer->>resolvePaneRenderer: "find(t => t.isActive) undefined"
resolvePaneRenderer->>resolvePaneRenderer: fallback to resolvedTabs[0] OR return null
alt resolvedTabs is empty
resolvePaneRenderer-->>User: null (nothing rendered)
else resolvedTabs has file/diff tabs
resolvePaneRenderer-->>User: file / diff renderer (unexpected switch)
else resolvedTabs has conversation (store ready)
resolvePaneRenderer-->>ConversationsPanel: "kind = pty-agent"
ConversationsPanel->>ConversationsPanel: "activeSessionId = null"
ConversationsPanel-->>User: empty div (no terminal, no CTA)
end
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 2
src/renderer/features/tasks/view/pane-renderer.ts:24
**Unexpected view switch when active conversation tab is still loading**
When the active tab is a conversation whose `ConversationStore` isn't ready yet, it is filtered out of `resolvedTabs`, so `resolvedTabs.find((t) => t.isActive)` returns `undefined`. The fallback `resolvedTabs[0]` then picks the first *other* resolved tab — which may be a file or diff tab — causing the pane to momentarily render a file editor even though the user's intent was to view the conversation. In the old code this scenario would have produced `{ kind: 'pty-agent' }`, keeping the conversation panel visible. The impact is a transient but perceptible UI jump during conversation load when mixed tabs are open.
### Issue 2 of 2
src/renderer/features/tasks/conversations/conversations-panel.tsx:119-143
**No affordance when the panel is genuinely empty**
The old empty-state UI (icon + "No conversations yet" label + "Create conversation" button) has been removed entirely. Now, when `ConversationsPanel` is rendered but no session is ready, users see a blank container with no guidance and no action to take. This will affect new tasks where no conversation has been created yet — the panel is visible but gives no signal about what to do next. If conversation creation is reachable exclusively from the sidebar or a toolbar shortcut, this may be fine, but it's worth confirming there's at least one discoverable entry point for first-time users.
Reviews (1): Last reviewed commit: "fix: conversation not showing (empty sta..." | Re-trigger Greptile
| if (resolvedTabs.length === 0) return null; | ||
| // Fall back to the first resolved tab when no tab is marked active (e.g. the | ||
| // raw activeTabId points to a conversation entry that was filtered out). | ||
| const activeTab = resolvedTabs.find((t) => t.isActive) ?? resolvedTabs[0]; |
There was a problem hiding this comment.
Unexpected view switch when active conversation tab is still loading
When the active tab is a conversation whose ConversationStore isn't ready yet, it is filtered out of resolvedTabs, so resolvedTabs.find((t) => t.isActive) returns undefined. The fallback resolvedTabs[0] then picks the first other resolved tab — which may be a file or diff tab — causing the pane to momentarily render a file editor even though the user's intent was to view the conversation. In the old code this scenario would have produced { kind: 'pty-agent' }, keeping the conversation panel visible. The impact is a transient but perceptible UI jump during conversation load when mixed tabs are open.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/renderer/features/tasks/view/pane-renderer.ts
Line: 24
Comment:
**Unexpected view switch when active conversation tab is still loading**
When the active tab is a conversation whose `ConversationStore` isn't ready yet, it is filtered out of `resolvedTabs`, so `resolvedTabs.find((t) => t.isActive)` returns `undefined`. The fallback `resolvedTabs[0]` then picks the first *other* resolved tab — which may be a file or diff tab — causing the pane to momentarily render a file editor even though the user's intent was to view the conversation. In the old code this scenario would have produced `{ kind: 'pty-agent' }`, keeping the conversation panel visible. The impact is a transient but perceptible UI jump during conversation load when mixed tabs are open.
How can I resolve this? If you propose a fix, please make it concise.| <div className="flex min-h-0 flex-1 flex-col"> | ||
| {activeSessionId && activeSession?.status === 'ready' && activeSession.pty ? ( | ||
| <div ref={terminalContainerRef} className="relative flex h-full min-h-0 flex-1"> | ||
| <TerminalSearchOverlay | ||
| isOpen={isSearchOpen} | ||
| fullWidth | ||
| searchQuery={searchQuery} | ||
| searchStatus={searchStatus} | ||
| searchInputRef={searchInputRef} | ||
| onQueryChange={handleSearchQueryChange} | ||
| onStep={stepSearch} | ||
| onClose={closeSearch} | ||
| /> | ||
| <PtyPane | ||
| ref={terminalRef} | ||
| sessionId={activeSessionId} | ||
| pty={activeSession.pty} | ||
| className="h-full w-full" | ||
| onEnterPress={onEnterPress} | ||
| onInterruptPress={onInterruptPress} | ||
| mapShiftEnterToCtrlJ | ||
| remoteConnectionId={remoteConnectionId} | ||
| /> | ||
| </div> | ||
| ) : null} |
There was a problem hiding this comment.
No affordance when the panel is genuinely empty
The old empty-state UI (icon + "No conversations yet" label + "Create conversation" button) has been removed entirely. Now, when ConversationsPanel is rendered but no session is ready, users see a blank container with no guidance and no action to take. This will affect new tasks where no conversation has been created yet — the panel is visible but gives no signal about what to do next. If conversation creation is reachable exclusively from the sidebar or a toolbar shortcut, this may be fine, but it's worth confirming there's at least one discoverable entry point for first-time users.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/renderer/features/tasks/conversations/conversations-panel.tsx
Line: 119-143
Comment:
**No affordance when the panel is genuinely empty**
The old empty-state UI (icon + "No conversations yet" label + "Create conversation" button) has been removed entirely. Now, when `ConversationsPanel` is rendered but no session is ready, users see a blank container with no guidance and no action to take. This will affect new tasks where no conversation has been created yet — the panel is visible but gives no signal about what to do next. If conversation creation is reachable exclusively from the sidebar or a toolbar shortcut, this may be fine, but it's worth confirming there's at least one discoverable entry point for first-time users.
How can I resolve this? If you propose a fix, please make it concise.
No description provided.