Commit Graph

6 Commits

Author SHA1 Message Date
徐翔宇
278199911f Merge remote-tracking branch 'origin/main' into feat/v0.3.0-toast-confirm-feedback 2026-05-20 16:34:53 +08:00
徐翔宇
0d28e9e9d4 fix(add): surface search failure with error toast
Catch block previously set hits = [] silently, so a 15s network
timeout looked like "no funds matched". Now an error toast tells
the user it's a network issue, distinct from "no results."

P0 from 2026-05-19 code review.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 17:52:33 +08:00
徐翔宇
b5f0d2d660 fix(etf): exclude LOF prefixes from ETF code routing
Prior `150...199` range caught 161/162/163/165/166/167/168/169
which are LOF (open-end fund traded on-exchange but priced by
1-day NAV, not intraday ticks). Routing LOF codes through
ETFClient pulled stale/wrong-shape data from the Sina sz endpoint.

Explicit-deny LOF prefixes; preserve legacy range for everything else.

P0 from 2026-05-19 code review.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 17:51:49 +08:00
徐翔宇
a4a747bc77 fix(toast): correct sleep duration — 2.0s → 2.6s
UInt64(durationSeconds) truncated the Double 2.6 to 2 before
multiplying by 1e9 ns, so toasts vanished 0.6s early. Move the
multiplication inside the cast.

Caught in 2026-05-19 code review, swift-verified.

Bump CFBundleVersion 3 → 4.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 17:49:29 +08:00
徐翔宇
63c7c0bc60 feat(ui): toast + confirm dialog + list animations
Add operation feedback across the three interactive paths in 看盘侠:
- Toast: ObservableObject + view modifier, lime/red/yellow palette
  matching FundTheme. Auto-dismiss after 2.6s, click to dismiss.
- ConfirmDialog: programmatic ask() returning async Bool via a
  captured CheckedContinuation. Danger flag flips the confirm button
  to a red palette.
- HoldingsView: row remove now asks for confirmation (the trash UI
  is a hover-only ✕ — easy to misclick); on confirm, row slides out
  to the leading edge with a spring + a success toast lands.
- HoldingsView: position edit Save / Clear surface the right
  semantic toast (success for save, info for clear).
- AddView: adding a fund toasts the name; tapping an already-added
  row toasts an info reminder rather than silently no-op'ing.

Bump version 0.2.0 → 0.3.0 (Info.plist + FundPlugin.version).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 20:29:00 +08:00
徐翔宇
e5a72bcf42 v0.2.0: initial 看盘侠 — Fund & Gold plugin for MioIsland
Real-time OTC fund and gold tracker for the macOS notch. Three tabs:
- 持仓: live intraday estimates from 天天基金, hero card with
  total value / today P&L / cumulative P&L, per-row 当日 + 累计.
- 黄金: SHFE 沪金 realtime + daily K-line + 伦敦金 reference.
- 添加: search 26k+ public funds via 东方财富 suggest API.

No API keys, no Python, no servers. All data comes from public
endpoints (天天基金, 东方财富, 新浪财经).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 20:20:15 +08:00