Skip to content

fix: Earn banner glass bar, shadow clipping and list copy (OK-60299, OK-60300, OK-60303) - #12906

Merged
originalix merged 7 commits into
release/v6.5.0from
defi-fixissue
Aug 19, 2026
Merged

fix: Earn banner glass bar, shadow clipping and list copy (OK-60299, OK-60300, OK-60303)#12906
originalix merged 7 commits into
release/v6.5.0from
defi-fixissue

Conversation

@ezailWang

@ezailWang ezailWang commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

ezailWang and others added 2 commits August 17, 2026 11:31
(cherry picked from commit fa9228f)
…OK-60300, OK-60303)

Signed-off-by: ezailWang <jelly@onekey.so>
@sidmorizon

Copy link
Copy Markdown
Contributor

@codex review

@sidmorizon

Copy link
Copy Markdown
Contributor

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7e51bc579f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment thread packages/kit/src/views/Discovery/components/OuterTabPagerView.tsx
@originalix

originalix commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Automated code review found blocking issues

@ezailWang

Reviewed commit ae5a4067b072. This report always reflects the latest reviewed changes.

Review summary

This PR changes the main-runtime Discovery-to-Earn handoff by separating outer-pager visibility from committed-tab data activation, so the Earn page can paint during a swipe without immediately starting its background fetches. It also refreshes the native Earn banner presentation, simplifies several Earn list labels, and adds server-driven Protocol Tips rendering through the shared staking detail contract and rich-text parser. Signing, authentication, persistence, and background ownership boundaries stay unchanged, but the translation backport expands the release from one new Earn heading to a repo-wide locale snapshot.

What needs attention: Recheck the first native entry into Earn and shrink the locale backport to only the Protocol Tips key before merging.

Issues to address

  • P1 · First Earn entry loses banner placeholder state
    • Impact: In the main JS runtime, mounting Earn as a visible neighbor now returns earnPageBannerListRef.current while showContent === false, and EarnHomeBanner no longer receives any loading signal. On the first committed entry that cached value is just [], so the UI cannot distinguish "not requested yet" from "loaded empty". If the first real background response contains banners, the 248px banner area appears late and shifts the page after the swipe settles.
    • Suggested action: Keep an explicit first-request pending state for the banner path, or pass a loading flag until getEarnPageBannerList() completes once for the committed Earn tab; only reuse the cached list to avoid jumps on subsequent returns.
  • P1 · Locale backport pulls in unrelated product copy
    • Impact: This PR's new UI only needs protocol_tips__title, but the generated catalogs add 521 keys per locale and rewrite many existing strings. Because those locale bundles ship with the same release as the code, this backport would silently change unrelated Keyless, KYT, Perps, Prime, export-history, and market copy without matching feature review or validation.
    • Suggested action: Revert the broad locale snapshot and land a release-scoped translation backport that only introduces the keys actually used by this PR.

Validation gaps

  • git diff --check origin/release/v6.5.0...HEAD passed.
  • All changed locale JSON files parsed successfully.
  • Repository validation was not run because the workspace is missing install state needed for the standard Yarn checks.
  • Native pager, banner, BlurView, and Protocol Tips behavior was not exercised on device or simulator.
  • Existing GitHub review comments and threads were not fetched here, so duplicate inline-comment coverage was not checked.

Signed-off-by: ezailWang <jelly@onekey.so>

@originalix originalix left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ezailWang

Automated code review found blocking issues

Reviewed commit f5f17e845fcf.

  • P1 · Empty banner responses still flash a skeleton on re-entry
  • P2 · Earn visibility is published one commit after unfreezing
  • P2 · Protocol Tips header bypasses localization
  • P3 · New comments violate the English-only source policy

View the full review report

@sidmorizon

Copy link
Copy Markdown
Contributor

@cursoragent review

@cursor

cursor Bot commented Aug 18, 2026

Copy link
Copy Markdown

Taking a look!

Open in Web Open in Cursor 

Comment thread packages/kit/src/views/Earn/EarnHome.tsx
…low-ups

Signed-off-by: ezailWang <jelly@onekey.so>

@originalix originalix left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ezailWang

Automated code review found blocking issues

Reviewed commit c19b9b137aa1.

  • P1 · Banner load state suppresses the first-entry placeholder
  • P1 · Generated locale sync changes unrelated release copy

View the full review report

@sidmorizon sidmorizon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review


Generated by Claude Code

Comment thread packages/kit/src/views/Earn/EarnHome.tsx Outdated
Comment thread packages/kit/src/views/Discovery/components/OuterTabPagerView.tsx Outdated
…99, OK-60602, OK-60606)

Signed-off-by: ezailWang <jelly@onekey.so>
Comment thread packages/kit/src/views/Discovery/components/OuterTabPagerView.tsx

@originalix originalix left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ezailWang

Automated code review found blocking issues

Reviewed commit ae5a4067b072.

  • P1 · First Earn entry loses banner placeholder state
  • P1 · Locale backport pulls in unrelated product copy

View the full review report

@ezailWang ezailWang added the release-ready This PR should be included in the next release label Aug 19, 2026
@ezailWang
ezailWang enabled auto-merge (squash) August 19, 2026 07:20
@originalix
originalix disabled auto-merge August 19, 2026 07:40
@originalix
originalix merged commit 51ace8a into release/v6.5.0 Aug 19, 2026
18 checks passed
@originalix
originalix deleted the defi-fixissue branch August 19, 2026 07:41
originalix pushed a commit that referenced this pull request Aug 19, 2026
…OK-60300, OK-60303) (#12906)

* Feat/protocol tips OK-58972 (#12715)

(cherry picked from commit fa9228f)

* fix: Earn banner glass bar, shadow clipping and list copy (OK-60299, OK-60300, OK-60303)

Signed-off-by: ezailWang <jelly@onekey.so>

* fix: lint

Signed-off-by: ezailWang <jelly@onekey.so>

* fix: dark glass banner bar, rich-text protocol tips and PR review follow-ups

Signed-off-by: ezailWang <jelly@onekey.so>

* fix: DeFi home swipe, banner tap target and first-load height (OK-60299, OK-60602, OK-60606)

Signed-off-by: ezailWang <jelly@onekey.so>

---------

Signed-off-by: ezailWang <jelly@onekey.so>
(cherry picked from commit 51ace8a)
originalix added a commit that referenced this pull request Aug 19, 2026
…12935)

* fix: inject jpush key into native bundle builds (#12872)

(cherry picked from commit 12a7b65)

* fix: sync stock token metadata for max amount (OK-58721) (#12901)

(cherry picked from commit 7e00c69)

* fix: align perp dex source labels(OK-59905) (#12907)

(cherry picked from commit 6c7cf53)

* fix: keep the perps deeplink target over the cold-start restore (OK-60543) (#12918)

* fix: keep the perps deeplink target over the cold-start restore

A banner or push deeplink writes the coin from a context-less handler, so
the switch event it emits lands before the Perp page mounts and is dropped.
The page then restores activeTradeInstrumentAtom, whose cold-start cache
still holds the previous session's coin, and passes it as preferredInstrument
— which outranks the background atoms unconditionally and forces the market
back. The first tap after a cold start therefore never switched.

The deeplink now records a short-lived intent in ServiceHyperliquid, which
the initial symbol select consumes ahead of the restore. The restore keeps
winning when no intent is pending, so the pair flip it was added to prevent
stays fixed.

* perf: collapse the perps initial symbol select into one background hop

The claim, deeplink intent, instrument target and trading universe were
four sequential proxy calls sitting between the first Perp frame and the
symbol it should show. Each is nearly free when the background is idle and
around 220ms when it is not, which is the cold start the user actually
waits on: one device trace spent 470ms of a 1.3s wait in the last three.

They now resolve in a single background method, in the same order. The
universe read stays behind the claim flag, so a non-claiming run does no
more work than before, and initial_symbol_prepare records the combined
hop so the remaining wait can be attributed.

* chore: derive the perps deeplink intent type from its actual source

* fix: apply the perps deeplink intent only on the claiming run

Review catch. The intent was consumed on every initial-select run but also
applied on every one, so a notification handled by the already-mounted page
stayed live on the background singleton for its whole TTL. Any later blur to
focus then forced that coin back over a market the user had picked since —
overriding a current, explicit choice on a leveraged screen.

A mounted page already switches through the event bus, and the non-claiming
run resyncs from the background atoms when the UI and background diverge, so
it never needed the intent. Consumption stays unconditional so nothing
lingers; only the one claiming run per process acts on it.

* fix: survive unlock and cover the perps deeplink intent gate

Three review findings on the intent lifecycle.

The 30s TTL was wall-clock, but with app lock on the whole unlock flow sits
between the tap and the first Perp frame; a failed biometric falling back to
a password expires the intent, the persisted restore wins again and the
original defect returns with nothing in the log to tell expiry from absence.
The bound is now 5 minutes and expiry is marked.

The non-claiming resync passed an intent that is undefined by construction,
which read as if that branch took deeplinks into account and would revive the
override the moment the gate was loosened.

The gate itself had no coverage: deleting it left every case green. It now
lives in a pure helper with a test that fails when it is dropped.

* fix: remember the target market for every context-less perps entry

The desktop tray, universal search, the Home perps card, the market banner
and the market list all jump into Perps the same way the notification path
did: write the background atom, then emit PerpSwitchActiveInstrument. When
the Perp tab mounts for the first time in a launch that listener does not
exist yet, and the claiming initial-select then restores the coin from the
cold-start cache over the one the user asked for.

Each now records the intent before the atom write, so that first mount
restores the tapped market. The Home card passes its own mode through, since
it can open a spot pair.

* fix: record the perps intent before navigation and off the tap path

Two review findings on the entry points added in the previous commit.

Four of the five recorded the intent after switchTab, so closing the window
rested on React scheduling the mount effect a macrotask later, and on the
market list an await import() of a cold chunk could push it past the claiming
run entirely. Each now records before the navigation that mounts the tab, and
the market list hoists its import for the same reason, which makes the
ordering structural instead of incidental.

The write also sat inside the same try as changeActiveAsset. On the Home card
that try catches into a return placed before switchTab, so a rejected proxy
call — a cold MV3 worker, a bridge timeout — left the tap doing nothing at
all; elsewhere it swallowed the switch event too. It is bookkeeping whose
absence only costs the first-mount restore, so it now has its own catch.

* refactor: make the perps first-mount market a one-shot background value

Codex review of the accumulated fix. The behaviour was right but carried
four mechanisms where one does the job.

The pending market now reuses the existing preferredInstrument slot instead
of a parallel deeplinkIntent parameter, so buildInitialTradeInstrumentSwitchParams
and its ten tests return to their original state — the restore semantics
#12680 established are untouched rather than re-argued.

The setter no-ops once the latch is taken. That single line replaces the
claimed gate at the call site, the resolveAppliedDeeplinkIntent helper and
its tests, and the wall-clock TTL: after the claim the page is live and
switches through the event bus, so nothing recorded later could be anything
but an override of a market the user picked since. The TTL it replaces had
its own defect, discarding the target when app lock kept the user past five
minutes.

Also isolates the notification setter, which was the one entry left where a
rejected bookkeeping call skipped the asset write, the mode write and the
event; and moves the Home card's record after its writes, so a bail-out no
longer strands a pending pair for the next launch to consume.

334 insertions become 182.

* docs: record the perps cold-start market case study

Required by the repository's bug-fix case recording rule; pure append.

* fix: keep a failed chunk load from swallowing a market tap, and cover the pick

Two review findings.

Hoisting the lazy backgroundApiProxy import above the try in usePerpsNavigation
put it outside any error handling, so a chunk that fails to load — stale
deployment, offline, CSP — skipped the tab switch as well and escaped as an
unhandled rejection. Before this PR the tab still opened. The import now sits
inside the same catch as the record it serves, and the navigation runs either
way; only the switch that genuinely needs the proxy is skipped.

The pick-versus-restore decision moves into resolveInitialPreferredInstrument
so it can be tested, which the repository's self-testing rule requires for a
bug fix. Verified by mutation: reversing the precedence fails two of the four
cases. buildInitialTradeInstrumentSwitchParams and its ten cases stay
untouched, so #12680's restore path is still guarded by its original tests.

* fix: read the restored perps instrument at switch time, not before the wait

Review catch. Extracting the pick-versus-restore decision moved the read of
activeTradeInstrumentRef to right after prepareInitialSymbolSelect, but the
claiming run can await a trading-meta fetch between that point and the switch.
A pair the user picked during that wait was then overwritten by the one open
before it, with force: true clearing the order form — and the surrounding log
still read the fresh ref, so logs and behaviour disagreed.

The resolution moves back to the call that consumes it, which is where the
ref was read before this PR. The pending market is unaffected: it is taken
once at the claim and cannot change underneath.

* style: format the perps cold-start changes with the pinned prettier

CI's oxlint prettier check failed on ten spots across four of the touched
files. The local toolchain resolves prettier 2.8.8 while the workspace pins
3.8.1, so neither agent:check nor a local --check could see them.

(cherry picked from commit c4b545f)

* fix: sync sidebar theme switching (#12887)

* fix: sync sidebar theme switching

* fix: stabilize theme switching

* fix: sync embedded themes after reload OK-54061

(cherry picked from commit 929f05a)

* fix: Earn banner glass bar, shadow clipping and list copy (OK-60299, OK-60300, OK-60303) (#12906)

* Feat/protocol tips OK-58972 (#12715)

(cherry picked from commit fa9228f)

* fix: Earn banner glass bar, shadow clipping and list copy (OK-60299, OK-60300, OK-60303)

Signed-off-by: ezailWang <jelly@onekey.so>

* fix: lint

Signed-off-by: ezailWang <jelly@onekey.so>

* fix: dark glass banner bar, rich-text protocol tips and PR review follow-ups

Signed-off-by: ezailWang <jelly@onekey.so>

* fix: DeFi home swipe, banner tap target and first-load height (OK-60299, OK-60602, OK-60606)

Signed-off-by: ezailWang <jelly@onekey.so>

---------

Signed-off-by: ezailWang <jelly@onekey.so>
(cherry picked from commit 51ace8a)

---------

Signed-off-by: ezailWang <jelly@onekey.so>
Co-authored-by: huhuanming <huanming@onekey.so>
Co-authored-by: Zhao <Charon.Dian@gmail.com>
Co-authored-by: Kahn <0xkahnchan@gmail.com>
Co-authored-by: Zen <mingzhen.fang@onekey.so>
Co-authored-by: JellyWang <38491708+ezailWang@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-ready This PR should be included in the next release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants