Skip to content

feat: align swap k-line and same-chain token selection (OK-57650, OK-57751)#12436

Merged
originalix merged 7 commits into
release/v6.5.0from
feat/OK-57650
Jul 14, 2026
Merged

feat: align swap k-line and same-chain token selection (OK-57650, OK-57751)#12436
originalix merged 7 commits into
release/v6.5.0from
feat/OK-57650

Conversation

@zhaono1

@zhaono1 zhaono1 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

OK-57650 OK-57751


Summary

  • Enable the existing native chart-controls mode for the Swap K-line view.
  • Add a Same chain network shortcut to the Swap token selector based on the opposite token's network.
  • Keep the shortcut first in compact and full selectors, preserve disabled bridge-only states, recalculate N+, and align the new UI with the Figma dimensions.

Intent & Context

OK-57650 aligns the Swap K-line controls with the Market native control layer without changing chart data or trading behavior.

OK-57751 makes same-chain selection immediately visible in the combined Swap & Bridge token selector. When selecting the From token, the To token network is featured; when selecting the To token, the From token network is featured. This behavior is limited to the regular Swap selector.

Root Cause

  • The Swap TradingViewV2 adapter did not opt in to enableNativeChartControls, so the hosted chart rendered its legacy control UI.
  • The token selector rendered fixed slices of the network list and had no presentation model for a featured network. It could not pin the opposite token network without duplication, keep a disabled featured network visible, or calculate N+ from the rendered list.

Design Decisions

  • Enable the existing chart-control opt-in only at the ordinary Swap K-line adapter and preserve its data source, storage namespace, callbacks, and disabled features.
  • Derive sameChainNetwork as selector presentation data instead of mutating the underlying network order.
  • Keep Limit and Stock selectors unchanged.
  • Pass optional featured-network metadata through the generic chain selector without adding Swap dependencies to shared components.
  • Keep disabled non-featured networks filtered while allowing the disabled featured network to remain visible.
  • Use the exact Figma logical dimensions for the 36px compact controls, 1x24 divider, 48px featured row, and 9px full-list divider region.

Changes Detail

  • SwapKLineContent.tsx: enable native chart controls on the existing TradingViewV2 instance and hide the duplicate selector.
  • Extend the network filter item with optional badge, responsive image-size, and text props.
  • Add and test a Swap-only network view model that extracts the opposite token network and removes its duplicate.
  • Update the compact network row and full chain selector with featured-network ordering, badge, divider, disabled state, and responsive N+ behavior.
  • Update generated translations in a dedicated commit.

Issues

  • Fixes OK-57650
  • Fixes OK-57751

Risk Assessment

  • Risk Level: Medium
  • Affected Platforms: Mobile / Desktop / Web / Extension
  • Risk Areas: Hosted chart bridge compatibility, Swap From/To direction mapping, bridge-only disabled networks, and responsive compact-row counts.

Test plan

  • yarn agent:check --profile commit
  • yarn jest packages/kit/src/views/Swap/pages/modal/SwapTokenSelectModal.utils.test.ts --runInBand (13 tests)
  • Verify the mobile compact row, complete 28+ label, featured full-list row, and divider in the iOS simulator.
  • Verify the Swap K-line interval selector and chart updates on mobile, desktop, web, and extension.
  • Verify the 640px desktop compact row and N+ navigation at runtime.
  • Verify Swap From/To direction changes and bridge-only disabled states on mobile and desktop.

@zhaono1
zhaono1 changed the base branch from x to release/v6.5.0 July 13, 2026 10:18
@zhaono1
zhaono1 marked this pull request as ready for review July 13, 2026 10:18

@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: efd6f1d4fa

ℹ️ 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/Swap/pages/modal/SwapKLineContent.tsx
@zhaono1 zhaono1 changed the title feat: align swap k-line chart controls (OK-57650) feat: align swap k-line and same-chain token selection (OK-57650, OK-57751) Jul 14, 2026
Comment thread packages/shared/src/locale/json/zh_TW.json Outdated
@originalix originalix added release-ready This PR should be included in the next release and removed bundle-testing labels Jul 14, 2026
@originalix
originalix disabled auto-merge July 14, 2026 09:41
@originalix
originalix merged commit 9e8b172 into release/v6.5.0 Jul 14, 2026
31 of 32 checks passed
@originalix
originalix deleted the feat/OK-57650 branch July 14, 2026 09:41
"trade.privacy_mode": "Privatsphärenmodus",
"trade.privacy_mode_tooltips": "Der Privatsphärenmodus kann die direkte On-Chain-Verbindung zwischen Absender- und Empfängeradressen während Swaps oder Bridges verbergen.",
"trade.taking_longer_than_usual": "Dauert länger als gewöhnlich, überprüfen Sie den On-Chain-Status zur Bestätigung",
"trade.token_same_chain": "Same chain",

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.

当德语或法语用户打开普通 Swap 选币器并出现同链推荐时,这个 Badge 会分别显示英文 Same chain 和中英混合的 Même chain,因为对应 locale 尚未完成本地化。

这会让新功能的核心标签直接出现语言回退。请在 Lokalise 中补全 trade::token_same_chaindefr_FR 翻译,再通过 i18n pull 流程重新生成 locale 文件。

This was referenced Jul 16, 2026
originalix added a commit that referenced this pull request Jul 16, 2026
* fix: consolidate pending issue fixes (OK-57753, OK-57836, OK-57752, OK-57547, OK-57451, OK-54672, OK-57787, OK-56469, OK-56028) (#12461)

* fix: stabilize Swap Pro account warning (OK-57753)

* fix: center editable DeFi percentage value (OK-57836)

* fix: keep Market network labels unshrunk (OK-57547)

* fix: keep Limit history available when disconnected (OK-57451)

* fix: use decimal keyboards for trading inputs (OK-54672)

* fix: prepare Swap Pro before navigation (OK-57752)

* fix: clear stale Stock balance on Swap exit (OK-57787)

* fix: align Earn provider header breakpoint (OK-56469)

* fix: expand Private Send quote toggle target (OK-56028)

* fix: handle Stock market data failures

* fix: preserve stock balance and swap pro account scope

* feat: align swap k-line and same-chain token selection (OK-57650, OK-57751) (#12436)

* feat: align swap k-line chart controls (OK-57650)

* fix: hide duplicate swap chart interval selector OK-57650

* chore: update translations

* feat: support same-chain token selection (OK-57751)

* chore: update translations

* fix: resolve Jira UI issues(OK-57565, OK-52118, OK-56004, OK-55516, OK-56209, OK-57648, OK-57924) (#12468)

* fix: honor Pendle tooltip text styles OK-57565

* fix: make borrow detail tabs scrollable OK-52118

* fix: deduplicate same-symbol K-line tokens OK-56004

* fix: hide estimated swap savings OK-55516

* fix: hide swap keyboard accessory on iPad OK-56470

* fix: keep extension side panel on Trade OK-57350

* fix: guard swap derive selector by network OK-56209

* fix: align swap slippage boundaries OK-54577

* fix: preserve WebDapp route through modals OK-57648

* fix: use OneKey token metadata for limits OK-57550

* revert: restore iPad swap keyboard accessories OK-56470

* revert: restore extension Perps home navigation OK-57350

* revert: restore previous swap slippage rules OK-54577

* fix: align limit order metadata with Market detail OK-57550

* fix: avoid blocking limit order status refresh

* fix: keep borrow detail tab visible OK-52118

* revert: remove OK-57550 from PR scope

* fix: stabilize Earn protocol balances OK-57924

* fix: preserve supported K-line side OK-56004

* fix: tighten WebDapp route fallback OK-57648

* fix: address route and K-line edge cases OK-57648

OK-56004

* fix: ignore network filter for market stocks(OK-57973) (#12490)

* fix: adjust market chart height(OK-56353, OK-57794) (#12180)

* fix: adjust market chart height(OK-56353, OK-57794)

* fix: limit market sub indicators on mobile only

* fix: remove perps mobile chart touch bridge

* fix: tune mobile chart scroll sensitivity

* fix: translate Perps fallback strings (#12499)

* feat: add attempt-level firmware update tracking(OK-57543) (#12481)

* feat: add attempt-level firmware update tracking(OK-57543)

- add firmwareUpdateFailedAttempt event: report each real update-task
  failure (before user retry) with deviceType/transportType/updateFlow/
  firmwareVersions/attempt/errorCode, so attempt-level failure rate is
  measurable even when a later retry succeeds
- add retryCount & durationMs to firmwareUpdateResult (v1 UI flow and
  v2 service flow), enabling retry-recovery-rate and USB-vs-BLE
  duration analysis
- user exit (FirmwareUpdateExit/FirmwareUpdateTasksClear) is not
  counted as a failed attempt

* fix: make tracking-info reading in UI never reject to avoid flipping a successful update into failed state

* fix: exclude retry wait from firmware duration

* fix: track every firmware update attempt

* fix: isolate firmware update tracking workflows

---------

Co-authored-by: Leon <lixiao.dev@gmail.com>

* fix: correct Swap and Market display states (OK-57526, OK-57987, OK-57998) (#12494)

* fix: align Swap K-line toolbar spacing (OK-57526)

* fix: hide unavailable token audit UI (OK-57987)

* fix: enrich Swap history network metadata (OK-57998)

* chore: simplify Swap and DeFi readiness checks

* fix: align swap k-line skeleton layout OK-57526

* fix: show unavailable mobile audit state (OK-57987)

* fix: prevent incorrect swap recipient fallback

* fix: refine Japanese Perps translations (#12505)

* fix: prevent mobile isolated label clipping

* fix: widen mobile margin mode selector

* fix: refine Japanese Perps translations

---------

Co-authored-by: Zhao <Charon.Dian@gmail.com>
Co-authored-by: limichange <limichange@hotmail.com>
Co-authored-by: Kahn <0xkahnchan@gmail.com>
Co-authored-by: LeoShang <biubiu520520@gmail.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.

2 participants