Skip to content

Feat/perps add position#6400

Open
SeniorZhai wants to merge 41 commits into
masterfrom
feat/perps-add-position
Open

Feat/perps add position#6400
SeniorZhai wants to merge 41 commits into
masterfrom
feat/perps-add-position

Conversation

@SeniorZhai
Copy link
Copy Markdown
Member

No description provided.

SeniorZhai and others added 13 commits May 20, 2026 16:22
- Replace PerpsPositionShareActivity with PerpsPositionShareBottomFragment
- Add share poster layouts (classic/minimal profit/loss)
- Add share card background drawables
- Add PerpsAddBottomSheetDialogFragment (add position UI)
- Add OpenOrderRequest and update RouteService for add position API
- Add PerpsDatabase migration v3→v4, PerpsOrderDao, PerpsOrderItem
- Remove PerpsPositionHistory and PerpsPositionHistoryDao
- Update PerpetualViewModel with add position logic
- Update PerpsMarketDetailPage with add position entry
- Update ClosedPositionItem for PerpsOrderItem model
- Update PositionDetailFragment/Page for share bottom sheet
- Update DI module (PerpsModule)
@SeniorZhai SeniorZhai force-pushed the feat/perps-add-position branch from 6d38899 to 37dbc01 Compare May 21, 2026 06:59
…list

- Remove WHERE order_type='close' filter from PerpsOrderDao queries
- Add OpenedOrderItem composable for open/increase_position order display
- Update AllPositionsPage to differentiate close vs opened orders by orderType
- Update PerpsMarketDetailPage ClosedPositionsSection for opened orders
- Add perps_opened/perps_added string resources (en + zh)
- Filter out orders with status='opening' from activity queries
- Unify activity list titles as 'Opened/Closed Long/Short'
- Center PnL vertically in ClosedPositionItem; drop time from OpenedOrderItem
- Add OpenedOrderDetailPage with View Market and Share actions
- Route opened orders to new detail page in PositionDetailFragment
- Use accent color and 'Close Position' label for market detail close button
@SeniorZhai SeniorZhai force-pushed the feat/perps-add-position branch from 8bfd503 to db21032 Compare May 21, 2026 16:11
The confirm sheet never reset errorInfo, so a successful retry still
showed the stale error subtitle instead of the success message. Clear
it when sending starts.

In the add-position sheet the Compose context is a Hilt
FragmentContextWrapper, so `context as? FragmentActivity` was always
null and the guide dialog never opened. Use findFragmentActivityOrNull
to unwrap it, and apply the same fix to the add-fee action.
- Replace 'opening' with 'processing' status to match backend semantics
- Exclude 'processing' orders from activity and history SQL queries
- Update trading strings and Chinese translations for better clarity
- Dim leverage colors in PositionDetailPage based on order status
- Handle and display failure states for open, close, and increase orders
@SeniorZhai SeniorZhai force-pushed the feat/perps-add-position branch from d162fa4 to c990b0d Compare May 22, 2026 07:30
@SeniorZhai SeniorZhai marked this pull request as ready for review May 22, 2026 10:14
@SeniorZhai
Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts in this pull request

Co-authored-by: SeniorZhai <5416585+SeniorZhai@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented May 22, 2026

@copilot resolve the merge conflicts in this pull request

Resolved and pushed. I merged origin/master, fixed all conflicts, and finalized the merge in commit e2b5e9c.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED -XX:&#43;UseParallelGC -Xmx10g -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

SeniorZhai and others added 10 commits May 22, 2026 18:30
generateQRCode's qrSize only derives the integer module scale factor,
so without outputSize the produced bitmap size depended on QR content
length and integer truncation. Pass outputSize to lock the bitmap to
the requested dimension, and resize the share QR to 72dp (72dp
container, 16dp logo) to match the perps share card.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The market and perps share card footers used fixed heights, leaving
inconsistent spacing around the QR code. Switch both footers to
wrap_content so they grow with the QR container and keep a uniform
12dp top/bottom padding.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
A merge from master reintroduced the position history share path into
the share and detail fragments, but PerpsPositionHistory and its DAO
were deprecated and deleted on this branch, so the branch no longer
compiled. Restore both fragments to their pre-merge state, dropping
the PerpsPositionHistoryItem references.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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