refactor(checkout-diff): rely solely on subscription for data

Drop the one-shot getCheckoutDiff query and use skipToken; the
subscribe_checkout_diff flow populates the cache on subscribe response
and updates. Derive isLoading from the presence of cached payload and
remove the now-unused isError/error fields from git-diff-pane.
This commit is contained in:
Mohamed Boudra
2026-04-20 10:45:59 +07:00
parent 67eddbd6a9
commit 53baa16bee
2 changed files with 8 additions and 29 deletions
@@ -681,8 +681,6 @@ export function GitDiffPane({ serverId, workspaceId, cwd, hideHeaderRow }: GitDi
files,
payloadError: diffPayloadError,
isLoading: isDiffLoading,
isError: isDiffError,
error: diffError,
} = useCheckoutDiffQuery({
serverId,
cwd,
@@ -1071,9 +1069,7 @@ export function GitDiffPane({ serverId, workspaceId, cwd, hideHeaderRow }: GitDi
);
const hasChanges = files.length > 0;
const diffErrorMessage =
diffPayloadError?.message ??
(isDiffError && diffError instanceof Error ? diffError.message : null);
const diffErrorMessage = diffPayloadError?.message ?? null;
const prErrorMessage = githubFeaturesEnabled ? (prPayloadError?.message ?? null) : null;
const branchLabel =
gitStatus?.currentBranch && gitStatus.currentBranch !== "HEAD"