Skip to content

fix: stabilize swap tab loading states - #12913

Draft
huhuanming wants to merge 2 commits into
xfrom
codex/fix-ios-swap-ui-flicker
Draft

fix: stabilize swap tab loading states#12913
huhuanming wants to merge 2 commits into
xfrom
codex/fix-ios-swap-ui-flicker

Conversation

@huhuanming

Copy link
Copy Markdown
Contributor

Summary

  • keep the Pro token/network badge tree stable and resolve built-in network logos synchronously before using the background fallback
  • coordinate cold Stock header, amount input, and positions content until the Stock channel finishes initialization while preserving warm cached content
  • render unavailable Pro statistics as -- without collapsing real zero values

Runtime and root cause

This is scoped to iOS Native, where main and bg run in isolated JS heaps and initialize independently.

  • Tab switching remounts the active subtree. The token component previously changed from a bare Image branch to an Image plus network-badge container after the async network logo arrived, which remounted the image state.
  • Stock identity, market status, pay token, and positions become ready on separate clocks, so their local skeleton conditions exposed multiple replacement phases on a cold entry.
  • Pro value renderers treated unavailable values as numeric zero before the real market response arrived.

Verification

  • 3 focused Jest suites passed: 35 tests
  • yarn agent:check --profile commit passed
  • yarn agent:check --profile pr passed
  • manually verified first entry and repeated Swap / Stock / Pro switching on iOS Native, including a 10-round audit recording

Scope

  • 7 implementation files and 2 focused test files
  • no NativeLogger diagnostic instrumentation
  • no recordings, slide assets, dependencies, or unrelated worktree changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant