Skip to content

fix(conversation): open cached perps actions locally#6452

Merged
crossle merged 3 commits into
masterfrom
fix/perps-action-local-navigation
Jun 16, 2026
Merged

fix(conversation): open cached perps actions locally#6452
crossle merged 3 commits into
masterfrom
fix/perps-action-local-navigation

Conversation

@SeniorZhai

Copy link
Copy Markdown
Member

No description provided.

Copilot AI 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.

Pull request overview

This PR improves how trade-related app-card actions are handled in conversations by attempting to open Perps/Spot trade actions directly in local screens when the needed market/token data is already cached, falling back to the existing URL/web handling otherwise.

Changes:

  • Add URL parsing helpers (toPerpsTradeAction, toSpotTradeAction) to identify Perps vs Spot trade actions and extract parameters.
  • Update ConversationFragment to open Perps/Spot trade actions locally when cache prerequisites are met.
  • Add unit tests covering the new parsing behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
app/src/test/java/one/mixin/android/ui/conversation/PerpsTradeActionTest.kt Adds JVM tests for Spot/Perps trade action parsing.
app/src/main/java/one/mixin/android/ui/conversation/PerpsTradeAction.kt Introduces Perps/Spot action models and URL parsing utilities.
app/src/main/java/one/mixin/android/ui/conversation/ConversationViewModel.kt Adds an IO-thread helper to query cached token data by asset id.
app/src/main/java/one/mixin/android/ui/conversation/ConversationFragment.kt Attempts local navigation for cached trade actions before falling back to openAsUrlOrWeb.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/src/main/java/one/mixin/android/ui/conversation/PerpsTradeAction.kt Outdated
Comment thread app/src/main/java/one/mixin/android/ui/conversation/ConversationFragment.kt Outdated
Comment thread app/src/main/java/one/mixin/android/ui/conversation/ConversationFragment.kt Outdated
@crossle crossle merged commit 0f0a3dd into master Jun 16, 2026
1 check passed
@crossle crossle deleted the fix/perps-action-local-navigation branch June 16, 2026 11:45
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.

3 participants