Skip to content

Merge porfolio#151

Merged
gemdev111 merged 15 commits intomainfrom
merge-porfolio
Apr 16, 2026
Merged

Merge porfolio#151
gemdev111 merged 15 commits intomainfrom
merge-porfolio

Conversation

@gemdev111
Copy link
Copy Markdown
Contributor

@gemdev111 gemdev111 commented Apr 15, 2026

Merge the separate portfolio and perpetual portfolio scenes into a single unified PortfolioScene, with a segmented control in the navigation toolbar to switch between wallet and perpetual views.

  • Add shared portfolio types (PortfolioChartData, PortfolioData, PortfolioStatistic, PortfolioMarginUsage, PortfolioType) in core, Kotlin, and Swift
  • Replace WalletPortfolioScene / PerpetualPortfolioScene with one PortfolioScene + PortfolioSceneViewModel and PortfolioDataService
  • Move PortfolioType picker into the navigation toolbar (principal placement) and drop the outer VStack
  • Add Equatable/Hashable conformances across portfolio types; rename PerpetualPortfolioChartTypePortfolioChartType
  • Delete PerpetualPortfolioScene + its view model and tests; add PortfolioSceneViewModel tests and TestKit helpers
  • Remove unused inviteExisting RewardEventType case; bump core submodule

images:

image image

Close: #136

Introduce new portfolio data models and types used by the portfolio feature: PortfolioChartData, PortfolioData, PortfolioStatistic (sealed enum variants), PortfolioMarginUsage and PortfolioType in Kotlin. Rename PerpetualPortfolioChartType to PortfolioChartType on Android. In Swift, add Equatable/Hashable conformances to ChartPeriod, PortfolioChartType, PortfolioChartData, PortfolioStatistic and PortfolioType and make PortfolioData Equatable so these types can be used in sets/dictionaries and compared. Remove the "inviteExisting" case from RewardEventType and update the core submodule reference.
Relocate the PortfolioType segmented Picker from the view body into the navigation toolbar (principal placement) and remove the enclosing VStack so ChartListView becomes the root content. Also make the navigation title conditional (empty when the segmented control is shown) to avoid duplicate/overlapping UI. Changes apply to PortfolioScene.swift and PortfolioSceneViewModel.swift.
@gemdev111 gemdev111 self-assigned this Apr 15, 2026
@gemdev111 gemdev111 marked this pull request as ready for review April 15, 2026 16:31
import Primitives
import PriceService

public enum PortfolioRequest: Sendable {
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.

Could you rethink the name? *Request might be a bit misleading

self.priceService = priceService
}

func getData(request: PortfolioRequest) async throws -> PortfolioData {
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.

check the protection level, the service is public but the method is internal

}
}

public enum PortfolioStatistic: Codable, Equatable, Hashable, Sendable {
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.

should be Codable?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

typeshare always derives Codable from serde - that is core

Rename the portfolio request type and update related APIs for clarity. Changes: PortfolioRequest -> PortfolioDataInput; PortfolioDataService.getData(request:) renamed to getPortfoliData(input:) and made public; internal helpers walletData -> getWalletData and perpetualData -> getPerpetualData. PortfolioSceneViewModel updated to call the new service API and renamed getPortfolioRequest() to getDataInput(). A straightforward refactor to align naming between service and view model.
@gemdev111 gemdev111 requested a review from DRadmir April 16, 2026 10:45
@gemdev111 gemdev111 merged commit 5ae3835 into main Apr 16, 2026
3 checks passed
@gemdev111 gemdev111 deleted the merge-porfolio branch April 16, 2026 11:58
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.

Merge Portfolio + Perpetual Portoflio into one screen divided by segment

2 participants