Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions apps/desktop/src/app/contrib/wiring.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ import { PetGenerateOverlay } from '../pet-generate/pet-generate-overlay'
import { FileActionDialogs } from '../right-sidebar/file-actions'
import { RemoteFolderPicker } from '../right-sidebar/files/remote-picker'
import { PersistentTerminal } from '../right-sidebar/terminal/persistent'
import { CRON_ROUTE, routeSessionId, sessionRoute, SETTINGS_ROUTE, syncWorkspaceIsPage } from '../routes'
import { appViewForPath, CRON_ROUTE, routeSessionId, sessionRoute, SETTINGS_ROUTE, syncWorkspaceIsPage } from '../routes'
import { SessionPickerOverlay } from '../session-picker-overlay'
import { SessionSwitcher } from '../session-switcher'
import { useBackgroundQueueDrain } from '../session/hooks/use-background-queue-drain'
Expand Down Expand Up @@ -750,10 +750,15 @@ export function ContribWiring({ children }: { children: ReactNode }) {
onRemoveAttachment: id => void composer.removeAttachment(id),
onRestoreToMessage: restoreToMessage,
// Already on screen (open tile, or the main session)? Jump to its tab;
// otherwise load it into main.
// otherwise load it into main. When we're on a non-Chat page (Plugins,
// Artifacts, etc.) the "already selected" path in focusOpenSession only
// focuses the workspace pane without navigating — force the route change
// so clicking the most-recent session actually switches back to Chat (#66875).
onResumeSession: sessionId => {
if (!focusOpenSession(sessionId)) {
navigate(sessionRoute(sessionId))
} else if (appViewForPath(location.pathname) !== 'chat') {
navigate(sessionRoute(sessionId))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For an already-open tile, this routes to the tile id after focusOpenSession has focused it. useRouteResume then resumes that id as the selected/main session, promoting the tile. Route through the selected main-session id here (with a no-main fallback) so this only reveals Chat while preserving the tile.

}
},
onRetryResume: sessionId => void resumeSession(sessionId, true),
Expand Down
Loading