Skip to content

fix(desktop): render GitHub links in a stored cloud chat without a workspace host - #9698

Merged
superset-home merged 1 commit into
mainfrom
sentry/desktop-1wb-github-hover-no-host
Nov 13, 2026
Merged

superset-home merged 1 commit into
mainfrom
sentry/desktop-1wb-github-hover-no-host

Conversation

@superset-home

@superset-home superset-home commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

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 --noEmit finished 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.

Written for commit af6cd84. Summary will update on new commits.

View guided diff Turn on auto-fix

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.

…rkspace host

The stored cloud chat shown while a box wakes has no workspace tRPC
provider. GithubWorkItemHoverCard called workspaceTrpc.useQuery
unconditionally, which throws without a provider even when disabled.
Gate it on ChatPaneActions.workspaceId, as WebsiteHoverCard does.

Refs DESKTOP-1WB
@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The GitHub work-item hover card now runs in a host-side component. The workspace component delegates to it when a workspace ID exists. A stored transcript test checks that linked agent-message text renders.

Changes: GitHub Work-Item Hover Card

Layer / File(s) Summary
Host hover-card behavior
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/ChatSession/components/GithubWorkItemHoverCard/components/HostGithubWorkItemHoverCard/*
The host component fetches GitHub work-item data, maps query results to card states, and handles hover, focus, click, and context-menu actions. The module exports the component.
Workspace delegation and transcript coverage
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/ChatSession/components/GithubWorkItemHoverCard/GithubWorkItemHoverCard.tsx, apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/StoredChatTranscript/StoredChatTranscript.test.tsx
The workspace component delegates rendering to the host component when workspaceId exists and returns children otherwise. The stored transcript test checks that “the fix” from an agent message appears.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: avipeltz, harshithmullapudi, kitenite

Merge Risk: Minimal · up to af6cd

Stored cloud chats rendered while the workspace box wakes no longer trigger a missing tRPC context error from GitHub links. A regression test covers the change. Merge risk is minimal; the one gap is that running-app behavior was not verified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: GitHub links in a stored cloud chat now render without a workspace host. It follows conventional commit format with the fix(desktop) scope and matches the raw summary,…
Description check Passed The description follows the template. It has a Problem and Root cause section, a Fix section, and a Verification section that covers the template's How I tested it purpose with commands and results. I…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: GitHub links in a stored cloud chat now render without a workspace host. It follows conventional commit format with the fix(desktop) scope and matches the raw summary, which shows GithubWorkItemHoverCard gated on workspaceId and the test fixture updated with a GitHub PR link.

Full details: Description check

Explanation

The description follows the template. It has a Problem and Root cause section, a Fix section, and a Verification section that covers the template's How I tested it purpose with commands and results. It links the issue reference DESKTOP-1WB and the related PR #9623. The checklist items are not ticked, and no screenshots are included. The author states the running app was not verified, so the user-visible behavior is untested by screenshot. Those gaps are minor against the required content.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4aef5326-d8ec-41cd-8970-28873fa845d1
Commits

Reviewing files that changed from the base of the PR and between 515135f and af6cd84.

Files selected for processing: 4

  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/StoredChatTranscript/StoredChatTranscript.test.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/ChatSession/components/GithubWorkItemHoverCard/GithubWorkItemHoverCard.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/ChatSession/components/GithubWorkItemHoverCard/components/HostGithubWorkItemHoverCard/HostGithubWorkItemHoverCard.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/ChatSession/components/GithubWorkItemHoverCard/components/HostGithubWorkItemHoverCard/index.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ✅ Neon database branch

Thank you for your contribution! 🎉

@superset-home
superset-home merged commit 9c2ed27 into main Nov 13, 2026
18 checks passed

This branch was previously deployed

1 inactive deployment
preview — af6cd849 Deployed Nov 13, 2026 by superset-home via Cleanup Preview Resources #5566
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant