olsch01 86ad024252 Portfolio edit/sort + fix Setups tab showing no recommendations
Portfolio:
- Alphabetize list on every add/edit (sort by ticker after upsert)
- Add DataStore.updatePortfolioPosition() and PortfolioViewModel.update()
- Add EditPositionSheet: tap any row to edit shares, cost basis, or delete
  with a confirmation dialog; ticker is read-only in edit mode
- Swipe-to-delete still works as before

Setups tab (three bugs fixed):
1. Auto-refresh on first open — .task now triggers vm.refresh() when
   DataStore has tickers but no cached recommendations, so the tab
   populates immediately without requiring a manual ↻ tap
2. Loading state — replaced the never-set vm.isLoading check with
   vm.isRefreshing so the spinner actually shows during fetch
3. Strike selection used a hardcoded T=30 days for all time horizons,
   causing weekly/1DTE options to pick strikes too far OTM (near-zero
   delta at actual expiry → zero bid → filtered out → no results).
   selectBestContract() now receives real daysToExpiry, relaxes the
   delta floor for very short expirations (≤3 days: 0.05 min vs 0.10),
   and adds a closest-to-ATM fallback when the delta filter finds nothing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 08:43:43 -04:00
Description
No description provided
220 KiB
Languages
Swift 70%
Python 30%