Uh oh!
There was an error while loading. Please reload this page.
fix(mobile): stop spinning forever on failed asset previews - #7683
fix(mobile): stop spinning forever on failed asset previews#7683shubhxho wants to merge 3 commits into
Conversation
Null from the asset URL hook meant loading, disconnected, and error. Previews now show the failure and a retry instead of Preparing forever. Fixespingdotgg#7630
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
Uh oh!
There was an error while loading. Please reload this page.
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This bug fix adds proper error handling for mobile asset preview loading failures. Changes are self-contained to mobile preview UI, maintain backward compatibility, and include comprehensive unit tests for the new state resolution logic. You can add or adjust custom eligibility rules. Learn more. |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 020efc6. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
randroid88
commented
Aug 30, 2026
Reporter of #7630 here — I reviewed this and ran it locally. Summary: The fix is the right shape. The The failing CI check looks like an infra flake, not this PR — the job log shows it died ~30s in during toolchain install (vite+/rustup) with no test/lint/type failure anywhere; teardown follows immediately. A re-run should clear it. The real blocker is bitrot against main. Two days after this was opened, #6433 landed a simpler Machine-verified on a Pixel 8 Pro dev client (rebased-onto-main build): the Success path delivers URLs into the preview components correctly. I was not able to cleanly capture the Disconnected UI on device due to test-rig issues on my side — not evidence against the PR, just honestly unverified. Would love to see this rebased and landed; it fixes a real daily annoyance. — verified with Claude Fable 5 via Claude Code |

Asset preview URLs returning null meant loading, disconnected, and error. The preview screens treated every null as Preparing and spun until you left.
The hook now distinguishes those states. Previews show a short failure and a retry. Favicons still stay quiet when they don't have a URL.
Fixes#7630
Note
Cursor Bugbot is generating a summary for commit 31b552b. Configure here.
Note
Fix mobile asset preview spinning forever on failed asset URLs
AssetUrlStatediscriminated union andresolveAssetUrlStatein assetUrlState.ts to map connection + request state into Loading/Disconnected/Failure/SuccessuseAssetUrlStatehook in assets.ts exposing status and retry; reimplementsuseAssetUrlon top of it for backward compatibilityWorkspaceFileImagePreview,WorkspaceFileWebPreview, andFileContentto renderWorkspaceFileAssetPreviewPlaceholderwith contextual empty state and retry on non-success states;ThreadFilesRouteScreenheader Refresh now triggersassetPreview.retry()and appends a revision query param for cache-bustingresolveAssetUrlStateacross unrequested/loading/disconnected/failure/success/waiting cases in assetUrlState.test.tsstatus: AssetUrlState+onRetryinstead of a nullable URL string; callers passing the old props will not compileMacroscope summarized 6af0d59.