Adding Market.krStock cascades into several exhaustive switches that must all
update together: ExchangeRates.convert, DisplayCurrency, StockChartView ranges
and labels. Bundles tasks 2/3/4/5/14 into one build-passing landing.
- Market enum: add krStock case + kr_ prefix routing in Market.from
- ExchangeRates: add usdToKrw (fallback 1380), krwToCny derived, KRW path in convert
- DisplayCurrency: add .krw (₩), display name 韩元
- CurrencyService.fetchRates: include fx_susdkrw in Sina FX batch URL
- StockChartView: KR fullDayRange 0...389 (KST 09:00-15:30, 390 min); KR axis labels
09:00/10:30/12:00/13:30/15:30
Tests: +5 Stock cases for KR, +8 CurrencyKRWTests covering all KR↔CNY/USD/HKD/KRW
conversion paths and fallback constant.
- Add Quote.isToday: compare updateTime date with today in Beijing timezone
- effectiveDailyPnl returns nil when quote data is stale (not from today)
- Prevents showing yesterday's change as today's daily PnL on closed markets
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- 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>
- New setting: "持仓股单独分组置顶" toggle
- When enabled, stocks with holdings are grouped into a "持仓" section at top
- Remaining non-held stocks still grouped by A/HK/US market as usual
- StockGroupView supports custom title for holdings group
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix "daily + total" PnL mode only showing daily: use single Text concatenation
- Move PnL options into status bar picker (daily / total / both), hide icon in PnL mode
- Add rounded corners to app icon for macOS consistency
- Add LaunchAgent plist fallback for launch-at-login on Intel Macs
- Remove StatusBarPnL enum, use statusBarStockId special values instead
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add setting to choose status bar PnL: none / daily / total / both
- Fix launch-at-login: remove unconditional register() on every launch
- Add error logging for SMAppService register/unregister
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Show floating PnL percentage for each stock and portfolio summary
- Show daily/total PnL percentage in profit summary view
- Replace manual GitHub download with in-app auto-update (download DMG, mount, replace, relaunch)
- Disable app sandbox for Process support (non-App Store distribution)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- AppState.init: use _stocks = Published(wrappedValue:) to bypass didSet,
preventing empty array from overwriting disk on decode failure
- AppState.saveStocks: guard against overwriting non-empty file with []
- Stock: explicit Codable extension using decodeIfPresent for optional fields,
so missing fields in old JSON use defaults instead of failing the whole decode
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- CurrencyService: fetch USD/CNY and USD/HKD from Sina Finance forex
- DisplayCurrency enum (CNY/HKD/USD) with symbol and display name
- AppState: fetch rates on every refresh, convert totalPnL/totalDailyPnL
- Settings: add 持仓汇总货币 segmented picker
- ProfitSummaryView: show currency symbol in P&L display
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>