fix(desktop): render GitHub links in a stored cloud chat without a workspace host
Problem
When a cloud workspace's box is asleep, the workspace route shows its newest stored chat while the box wakes. If that chat has a GitHub pull request or issue link, the render throws "Unable to find tRPC Context", and the dashboard content boundary shows its error page instead of the chat. The event came from a canary build made after #9623.
Root cause
StoredCloudChat renders the chat transcript from the $workspaceId layout, outside WorkspaceProvider. This is by design (#9623): the box has no host address yet, and ChatPaneActions.workspaceId is absent to say so. #9623 gated the transcript's host reads on that signal (changes card, image attachments). WebsiteHoverCard already returns its children when workspaceId is absent. GithubWorkItemHoverCard did not: it called workspaceTrpc.github.getWorkItem.useQuery on every render. That hook reads the tRPC context first and throws when there is none, even with enabled: false. It is reached from assistant markdown links (ChatLink) and from user message link chips (MessageChip → LinkHoverCard).
Fix
GithubWorkItemHoverCard is now the gate: with no workspaceId it returns the link unchanged, the same as WebsiteHoverCard. The old body moves unchanged into HostGithubWorkItemHoverCard, except that it no longer checks workspaceId itself. This is the AttachmentImage → HostAttachmentImage split from #9623.
Behaviour change: a GitHub link in a chat with no workspace host now has no hover card. Before, it opened a card that could only say "unavailable". ChatLink already shows the URL as the link title in that case.
The existing no-host regression test StoredChatTranscript.test.tsx now includes an agent message with a GitHub PR link.
Verification
- Test before the fix (only the fixture change applied):
error: Unable to find tRPC Context. Did you forget to wrap your App inside \withTRPC` HoC?/0 pass 1 fail`. The same error as the event. bunx biome check <GithubWorkItemHoverCard dir> <StoredChatTranscript dir>:Checked 9 files in 30ms. No fixes applied.cd apps/desktop && bun run typecheck:tsc --noEmitfinished with no errors.bun test 'src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/':1158 pass, 0 fail.- Not verified in the running app: I could not put a cloud box to sleep from this sandbox.
Refs DESKTOP-1WB
Summary by cubic
Fixes a crash in the stored cloud chat render when a GitHub pull request or issue link appears while the workspace box is waking up.
The GitHub hover card called the workspace tRPC query even without a tRPC context, throwing "Unable to find tRPC Context". Now the hover card skips itself when no workspace host exists, exactly like WebsiteHoverCard. The card logic moved to a new HostGithubWorkItemHoverCard that only runs when a workspace host is present.
Summary by CodeRabbit
- Updates
- GitHub issue and pull request previews are available from linked items in chat. Hover or focus the link to view the preview, and click the link or open its context menu to dismiss it.
- Chat transcripts display the linked text associated with an agent message that references a pull request.