Repository navigation
fix(native-list): show cached Web row images immediately - #348
Conversation
A row image that is already complete when its source is set is a memory-cache hit, but createImage kept it at opacity 0 until its queued load event fired. While a modal mounts a list the main thread is busy, so cached network logos in the desktop aggregated token details stayed blank for 100 ms or more (OK-68237). Reveal such images synchronously; iOS and Android already do.
|
@codex review |
|
@codex security review |
|
Cursor review failed. Remote error: |
|
Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
A cache-hit image is shown during setup, but its queued load event still called revealWebImage. When that event ran more than 100 ms after creation (a busy modal mount) the image or its selector background faded in again from opacity 0. Remember the source shown during setup and skip the fade for it in both load handlers; a later retry or fallback source still fades.
Summary
Show NativeList Web row images right away when they are already cached.
createImagekept every new<img>at opacity 0 until itsloadevent fired. A memory-cache hit is alreadycompleteas soon assrcis set, but itsloadevent is a queued task. While a modal mounts a list the main thread is busy, so the event runs late and the image stays invisible.On the OneKey desktop app (6.8.0), reopening the aggregated token details modal (OK-68237) rendered the Asset allocation rows with every network logo already
complete=truebut at opacity 0 for about 117 ms, measured per frame over CDP. The user's recording shows longer gaps.createImagenow sets opacity to 1 at once for such images. Images that still have to load keep the existing fade. The source shown during setup is remembered, so its queuedloadevent does not fade it in again, even when it runs after the 100 ms threshold; this covers row images, thumbnails and selector backgrounds. A later retry or fallback source still fades.iOS and Android already show memory-cache hits synchronously (
OneKeyImage.identityDidChange/showMemoryCachedPreviewBeforeLayout) and skip the fade for them, so this brings Web in line. The spec now states this rule.Validation
loadevent and does not fade when that event arrives 500 ms later; the same holds for a selector-row background; a non-cached image that loads after 500 ms still fades. Both cache-hit cases fail without the guard.NativeList.web.test.ts: 210/210 passed.tsc -b, eslint (0 errors), prettier, test integrity andgit diff --checkpassed.NativeList.ref.test.tsx. They are identical with and without this change (compared via--json).🤖 Generated with Claude Code