fix: Macro panel manage-only (not auto-open), Trump-only auto-trade copy, store docs
SystemControl was rendered as two per-system panels (Trump / Macro) that both flipped the SAME global auto_trade, and its copy claimed a "qualifying Macro Vibes signal auto-opens a trade". Both are wrong: bot_engine.process_post early-returns for System 2, so the auto_trade gate only ever fires for Trump (System 1). Macro Vibes is manage-only — it never auto-opens. - Macro (`system="btc"`) panel: replaced the misleading Auto-Trade ON/OFF toggle with a manage-only explainer (open on HL → /adopt via Telegram → bot manages exits) and a note that the Trump-page switch has no effect here. - Trump (`system="trump"`) panel: relabeled the switch "TRUMP (System 1)" and rewrote all copy/status lines to say Trump-only auto-open (was "GLOBAL (Trump + BTC)" / "both Trump & BTC"). - CLAUDE.md: corrected "No global store (no Redux/Zustand)" — the app DOES use a small Zustand store (store/dashboard.ts / useDashboardStore); documented what it holds and the guidance to keep it small. Note (not a bug): dashboard adopt/release is intentionally Telegram-only — there are no positions/adopt|hl|release client calls and the UI correctly points to the Telegram /adopt command. No dashboard wiring is "broken". tsc + next build clean. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -138,7 +138,11 @@ mutate the subscription.
|
||||
|
||||
## State management
|
||||
|
||||
- **No global store** (no Redux/Zustand). Tree-local state + props.
|
||||
- **One small global store** — `store/dashboard.ts` (Zustand, `useDashboardStore`).
|
||||
Holds cross-page UI/session state: selected post, chart asset/timeframe,
|
||||
wallet address, subscription + bot-readiness flags, masked HL key hint, and
|
||||
the live-price map. Everything else stays tree-local (state + props) — don't
|
||||
grow this store into a catch-all; page-specific data belongs in the page.
|
||||
- **SWR-style cache** in `lib/cache.ts` for the API-heavy pages.
|
||||
- **WebSocket** singleton via `WsProvider` — used by `SignalMonitor` and
|
||||
live price tickers.
|
||||
|
||||
Reference in New Issue
Block a user