From 175ed536099d1fc1b50f7f3735ea93f522def6e7 Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Mon, 10 Aug 2026 17:12:55 -0700 Subject: [PATCH] Fix static analysis page stuck in loading state When an open check-details tab's repository is removed, the loading state would continue indefinitely because the fetch was still being triggered. Prevent the fetch call in this scenario to unblock the UI. Also migrates translation keys to obfuscated identifiers. --- .../src/components/right-sidebar/checks-panel-content.tsx | 4 ++-- src/renderer/src/i18n/locales/en.json | 4 ++-- src/renderer/src/i18n/locales/es.json | 2 +- src/renderer/src/i18n/locales/ja.json | 2 +- src/renderer/src/i18n/locales/ko.json | 2 +- src/renderer/src/i18n/locales/zh.json | 2 +- src/renderer/src/store/slices/editor.test.ts | 4 +++- 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/renderer/src/components/right-sidebar/checks-panel-content.tsx b/src/renderer/src/components/right-sidebar/checks-panel-content.tsx index d4fd6ece571..72403dbd2e8 100644 --- a/src/renderer/src/components/right-sidebar/checks-panel-content.tsx +++ b/src/renderer/src/components/right-sidebar/checks-panel-content.tsx @@ -828,7 +828,7 @@ function CheckRunDetails({ > {translate( - 'auto.components.right.sidebar.checks.panel.content.retryCheckDetails', + 'auto.components.right.sidebar.checks.panel.content.dcb3c546fe', 'Retry' )} @@ -1207,7 +1207,7 @@ export function ChecksList({ err instanceof Error ? err.message : translate( - 'auto.components.right.sidebar.checks.panel.content.checkDetailsLoadFailed', + 'auto.components.right.sidebar.checks.panel.content.e45324fbed', 'Failed to load check details.' ) if (resolvedWorktreeId) { diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json index f36d61e25ff..3c693dfc7eb 100644 --- a/src/renderer/src/i18n/locales/en.json +++ b/src/renderer/src/i18n/locales/en.json @@ -11130,7 +11130,7 @@ "checksUnresolvedChip": "unresolved", "checksUnresolvedStripHint": "These checks finished without a pass or fail verdict.", "e15a8b77ef": "No inline details are available for this check.", - "retryCheckDetails": "Retry", + "dcb3c546fe": "Retry", "679bf2093c": "Copy log excerpt", "d713f500b2": "Log excerpt", "a916648574": "Open details", @@ -11197,7 +11197,7 @@ "actionRequiredHint": "This check needs a manual action on GitHub (for example, approving the workflow run) before merging is unblocked.", "b3195cba33": "Unmark author as bot", "f588b46a6c": "Mark author as bot", - "checkDetailsLoadFailed": "Failed to load check details." + "e45324fbed": "Failed to load check details." }, "empty": { "state": { diff --git a/src/renderer/src/i18n/locales/es.json b/src/renderer/src/i18n/locales/es.json index d84aa89b132..c0a5ccf5910 100644 --- a/src/renderer/src/i18n/locales/es.json +++ b/src/renderer/src/i18n/locales/es.json @@ -10760,7 +10760,7 @@ "actionRequiredHint": "Este check requiere una acción manual en GitHub (por ejemplo, aprobar la ejecución del workflow) antes de que el merge quede desbloqueado.", "b3195cba33": "Desmarcar autor como bot", "f588b46a6c": "Marcar autor como bot", - "checkDetailsLoadFailed": "No se pudieron cargar los detalles del check." + "e45324fbed": "No se pudieron cargar los detalles del check." }, "empty": { "state": { diff --git a/src/renderer/src/i18n/locales/ja.json b/src/renderer/src/i18n/locales/ja.json index 76f154d39e8..16118042ddc 100644 --- a/src/renderer/src/i18n/locales/ja.json +++ b/src/renderer/src/i18n/locales/ja.json @@ -10760,7 +10760,7 @@ "actionRequiredHint": "マージのブロックが解除されるまでに、このチェックには GitHub 上での手動操作(例: ワークフロー実行の承認)が必要です。", "b3195cba33": "作成者のボット指定を解除", "f588b46a6c": "作成者をボットとして指定", - "checkDetailsLoadFailed": "チェック詳細の読み込みに失敗しました。" + "e45324fbed": "チェック詳細の読み込みに失敗しました。" }, "empty": { "state": { diff --git a/src/renderer/src/i18n/locales/ko.json b/src/renderer/src/i18n/locales/ko.json index c86caa3e852..82b49d649d0 100644 --- a/src/renderer/src/i18n/locales/ko.json +++ b/src/renderer/src/i18n/locales/ko.json @@ -10760,7 +10760,7 @@ "actionRequiredHint": "이 검사는 병합 차단이 해제되기 전에 GitHub에서 수동 작업(예: 워크플로 실행 승인)이 필요합니다.", "b3195cba33": "작성자의 봇 지정 해제", "f588b46a6c": "작성자를 봇으로 지정", - "checkDetailsLoadFailed": "체크 세부 정보를 불러오지 못했습니다." + "e45324fbed": "체크 세부 정보를 불러오지 못했습니다." }, "empty": { "state": { diff --git a/src/renderer/src/i18n/locales/zh.json b/src/renderer/src/i18n/locales/zh.json index 62090dd10ea..ccf7f6cc57f 100644 --- a/src/renderer/src/i18n/locales/zh.json +++ b/src/renderer/src/i18n/locales/zh.json @@ -10780,7 +10780,7 @@ "actionRequiredHint": "此检查需要在 GitHub 上执行手动操作(例如批准工作流运行)后才能解除合并阻止。", "b3195cba33": "取消将作者标记为机器人", "f588b46a6c": "将作者标记为机器人", - "checkDetailsLoadFailed": "加载检查详细信息失败。" + "e45324fbed": "加载检查详细信息失败。" }, "empty": { "state": { diff --git a/src/renderer/src/store/slices/editor.test.ts b/src/renderer/src/store/slices/editor.test.ts index c02b660e8d1..b63a9d16e1a 100644 --- a/src/renderer/src/store/slices/editor.test.ts +++ b/src/renderer/src/store/slices/editor.test.ts @@ -3112,12 +3112,13 @@ describe('createEditorSlice conflict status reconciliation', () => { }) it('stops loading when an open check-details tab loses its repository', async () => { + const fetchPRCheckDetails = vi.fn() // eslint-disable-next-line @typescript-eslint/no-explicit-any const store = createStore()((...args: any[]) => ({ activeWorktreeId: 'wt-1', repos: [], worktreesByRepo: {}, - fetchPRCheckDetails: vi.fn(), + fetchPRCheckDetails, ...createEditorSlice(...(args as Parameters)) })) as unknown as StoreApi const check = { @@ -3135,6 +3136,7 @@ describe('createEditorSlice conflict status reconciliation', () => { }) await store.getState().reloadOpenCheckRunDetailsTab('wt-1::check-details::check-run:42') + expect(fetchPRCheckDetails).not.toHaveBeenCalled() expect(store.getState().openFiles).toContainEqual( expect.objectContaining({ id: 'wt-1::check-details::check-run:42',