From 45341818af3b9ce80a1f863d65596e71b2f05d07 Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Mon, 10 Aug 2026 15:06:51 -0700 Subject: [PATCH] Fix static analysis page stuck in loading state - Bound check-details requests with 30s timeout, matching remote RPC budget - Track request IDs to discard stale responses when context changes - Propagate githubRepository through store and components for proper routing - Add retry button for failed check-details loads - Improve accessibility with ARIA labels for loading and error states --- .../src/components/GitHubItemDialog.tsx | 23 +-- .../src/components/PullRequestPage.tsx | 23 +-- .../editor/CheckRunDetailsPanel.tsx | 12 +- .../editor/check-run-details-tab.ts | 24 ++- ...github-item-dialog-source-boundary.test.ts | 3 + .../pull-request-page-host-boundary.test.ts | 3 + .../components/right-sidebar/ChecksPanel.tsx | 1 + .../FolderWorkspacePrChecksPanel.tsx | 2 +- .../FolderWorkspacePrChecksRow.tsx | 1 + .../checks-list-expanded-details.test.tsx | 136 ++++++++++++++- .../right-sidebar/checks-panel-content.tsx | 165 ++++++++++++++---- .../parent-pr-checks-refresh.test.ts | 5 +- .../right-sidebar/parent-pr-checks-refresh.ts | 2 +- .../parent-pr-checks-row-types.ts | 10 +- .../parent-pr-checks-rows.test.ts | 6 +- .../right-sidebar/parent-pr-checks-rows.ts | 3 +- src/renderer/src/i18n/locales/en.json | 7 +- .../github-check-details-timeout.test.ts | 33 ++++ .../runtime/github-check-details-timeout.ts | 25 +++ src/renderer/src/store/slices/editor.test.ts | 151 +++++++++++++++- src/renderer/src/store/slices/editor.ts | 45 ++++- src/renderer/src/store/slices/github.ts | 23 +-- src/shared/hosted-review-github.test.ts | 6 +- src/shared/hosted-review-github.ts | 1 + src/shared/hosted-review.ts | 10 +- 25 files changed, 629 insertions(+), 91 deletions(-) create mode 100644 src/renderer/src/runtime/github-check-details-timeout.test.ts create mode 100644 src/renderer/src/runtime/github-check-details-timeout.ts diff --git a/src/renderer/src/components/GitHubItemDialog.tsx b/src/renderer/src/components/GitHubItemDialog.tsx index 0e50c3bbc50..fc1f9505114 100644 --- a/src/renderer/src/components/GitHubItemDialog.tsx +++ b/src/renderer/src/components/GitHubItemDialog.tsx @@ -141,6 +141,7 @@ import { buildPRCommentConversationReplyBody } from '@/components/right-sidebar/ import { useAppStore } from '@/store' import { useAllWorktrees } from '@/store/selectors' import { callRuntimeRpc, getActiveRuntimeTarget } from '@/runtime/runtime-rpc-client' +import { withGitHubCheckDetailsTimeout } from '@/runtime/github-check-details-timeout' import { useRepoLabels, useRepoAssignees, useImmediateMutation } from '@/hooks/useIssueMetadata' import { useRepoLabelsBySlug, useRepoAssigneesBySlug } from '@/hooks/useGitHubSlugMetadata' import { GitHubMarkdownComposer } from '@/components/github/GitHubMarkdownComposer' @@ -3473,16 +3474,18 @@ function ChecksTab({ }, { timeoutMs: 30_000 } ) - : window.api.gh.prCheckDetails({ - repoPath: repoPath ?? '', - repoId: repoId ?? undefined, - sourceContext, - checkRunId: check.checkRunId, - workflowRunId: check.workflowRunId, - checkName: check.name, - url: check.url, - prRepo - }) + : withGitHubCheckDetailsTimeout( + window.api.gh.prCheckDetails({ + repoPath: repoPath ?? '', + repoId: repoId ?? undefined, + sourceContext, + checkRunId: check.checkRunId, + workflowRunId: check.workflowRunId, + checkName: check.name, + url: check.url, + prRepo + }) + ) void detailsRequest .then((details) => { if (!mountedRef.current) { diff --git a/src/renderer/src/components/PullRequestPage.tsx b/src/renderer/src/components/PullRequestPage.tsx index 4b46d0148e5..4ef21776947 100644 --- a/src/renderer/src/components/PullRequestPage.tsx +++ b/src/renderer/src/components/PullRequestPage.tsx @@ -134,6 +134,7 @@ import { buildPRCommentConversationReplyBody } from '@/components/right-sidebar/ import { useAppStore } from '@/store' import { useAllWorktrees } from '@/store/selectors' import { callRuntimeRpc, getActiveRuntimeTarget } from '@/runtime/runtime-rpc-client' +import { withGitHubCheckDetailsTimeout } from '@/runtime/github-check-details-timeout' import { useRepoLabels, useRepoAssignees, useImmediateMutation } from '@/hooks/useIssueMetadata' import { useRepoLabelsBySlug, useRepoAssigneesBySlug } from '@/hooks/useGitHubSlugMetadata' import { @@ -3557,16 +3558,18 @@ function ChecksTab({ }, { timeoutMs: 30_000 } ) - : window.api.gh.prCheckDetails({ - repoPath: repoPath ?? '', - repoId: repoId ?? undefined, - sourceContext, - checkRunId: check.checkRunId, - workflowRunId: check.workflowRunId, - checkName: check.name, - url: check.url, - prRepo - }) + : withGitHubCheckDetailsTimeout( + window.api.gh.prCheckDetails({ + repoPath: repoPath ?? '', + repoId: repoId ?? undefined, + sourceContext, + checkRunId: check.checkRunId, + workflowRunId: check.workflowRunId, + checkName: check.name, + url: check.url, + prRepo + }) + ) void detailsRequest .then((details) => { if (!mountedRef.current) { diff --git a/src/renderer/src/components/editor/CheckRunDetailsPanel.tsx b/src/renderer/src/components/editor/CheckRunDetailsPanel.tsx index 2a9a8c4ecd5..50350fb1b47 100644 --- a/src/renderer/src/components/editor/CheckRunDetailsPanel.tsx +++ b/src/renderer/src/components/editor/CheckRunDetailsPanel.tsx @@ -247,7 +247,11 @@ export function CheckRunDetailsPanel({