Files
vgearenandClaude Opus 4.6 592ad90f61 v1.2.5: Add watchlist (观察仓) feature with virtual portfolio support
- New Watchlist model: named virtual portfolios with per-stock cost/shares
- Watchlists persisted to watchlists.json, active ID in settings
- AppState: effective cost/shares/PnL methods that respect active watchlist
- Settings: create/delete/switch watchlists, edit writes to active watchlist
- ProfitSummaryView shows active watchlist name
- UI alignment fixes for toggle and text field padding

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 11:31:59 +08:00

13 lines
284 B
Swift

import Foundation
struct WatchlistEntry: Codable {
var costPrice: Double
var holdingShares: Double
}
struct Watchlist: Identifiable, Codable {
var id: String = UUID().uuidString
var name: String
var entries: [String: WatchlistEntry] = [:] // stockId -> entry
}