Skip to content

Commit c4f3fdf

Browse files
Melly-999claude
andauthored
feat(frontend): polish paper sim read-only labels (#306)
Add a display-only safety caption to IBKRBrokerCard (the broker card rendered on the terminal dashboard and the /brokers route): "Paper / simulated — read-only preview. No live execution, no credentials, not live trading." Reuses the existing panel-note style for consistency with the adjacent Alpaca paper card. The other rendered demo surfaces (AlpacaPaperReadOnlyCard, PaperRunPreviewPanel, SafetyBadges) were reviewed and already clearly labelled. BrokerCard (components/BrokerCard.tsx) is left unchanged because its host DashboardPage is not routed (/dashboard redirects to /terminal), so it is not rendered. Add docs/tasks/paper_sim_ui_polish_001.md documenting the review and change. Display-only: no backend/API/workflow/package changes, no new controls, no mutating calls, no Buy/Sell/Order/Execute UI. Safety posture unchanged. Co-authored-by: Melly <Melly-999@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent a10b76a commit c4f3fdf

2 files changed

Lines changed: 124 additions & 0 deletions

File tree

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# Paper-Sim UI Polish 001
2+
3+
SOURCE STATUS: Public-safe, frontend display-only polish. No secrets, no
4+
credentials, no account IDs. This task only clarifies read-only / simulated /
5+
demo labelling. It adds no controls and changes no backend behavior.
6+
7+
## 1. Purpose
8+
9+
Make it immediately obvious to a demo viewer that the broker / paper surfaces are
10+
**read-only, simulated/demo, and not live trading**. Closes the one labelling gap
11+
found on the rendered broker surface.
12+
13+
## 2. Scope
14+
15+
Frontend display/copy polish only. No backend/API, no endpoints, no scripts, no
16+
workflows, no package changes. No new controls or mutating calls.
17+
18+
## 3. Components reviewed
19+
20+
Rendered broker / paper surfaces (via `App.tsx` routes → `TerminalShell`):
21+
22+
- **`IBKRBrokerCard`** — rendered on the terminal dashboard view and the
23+
dedicated `/brokers` route. **Gap found:** showed status flags + permissions
24+
but no plain-language "simulated / not live" caption. **Polished.**
25+
- **`AlpacaPaperReadOnlyCard`** — already clearly labelled ("PAPER ONLY",
26+
"Advisory / demo status only — not live trading", fallback note). No change.
27+
- **`PaperRunPreviewPanel`** (`/terminal/paper-run-preview`) — already strongly
28+
labelled (READ ONLY / DRY RUN / LIVE ORDERS BLOCKED / HUMAN REVIEW REQUIRED /
29+
EXECUTION OFF chips; "GET-only · display-only"; "No broker execution, no order
30+
placement, no persistence"; `Load Preview` button is GET-only). No change.
31+
- **`SafetyBadges`** — global safety posture chips. No change.
32+
- **`BrokerCard`** (`components/BrokerCard.tsx`) — the canonical read-only broker
33+
card, but its only host (`DashboardPage`) is **not routed** (`/dashboard`
34+
redirects to `/terminal`), so it is not rendered in the live app. Intentionally
35+
**left unchanged** to keep this polish scoped to verifiable, rendered surfaces.
36+
37+
## 4. UI changes
38+
39+
- `IBKRBrokerCard`: added a single display-only caption below the diagnostics
40+
list:
41+
42+
> Paper / simulated — read-only preview. No live execution, no credentials,
43+
> not live trading.
44+
45+
Reuses the existing `panel-note` class already used by the adjacent
46+
`AlpacaPaperReadOnlyCard`, so styling is consistent.
47+
48+
No other UI changes.
49+
50+
## 5. Safety labels added or confirmed
51+
52+
- **Added** (IBKRBrokerCard): "Paper / simulated — read-only preview. No live
53+
execution, no credentials, not live trading."
54+
- **Confirmed present** elsewhere: PAPER ONLY; READ ONLY / DRY RUN / LIVE ORDERS
55+
BLOCKED / EXECUTION OFF / HUMAN REVIEW REQUIRED chips; "Advisory / demo status
56+
only"; "No broker execution, no order placement, no persistence".
57+
58+
## 6. Forbidden controls check
59+
60+
Confirmed the change adds none of, and the reviewed surface contains none of:
61+
62+
- Buy / Sell / Order / Execute buttons — none added.
63+
- connect-live CTA — none.
64+
- broker-credential input UI — none.
65+
- order-placement / trade-submission logic — none.
66+
- new mutating frontend calls (POST/PUT/PATCH/DELETE) — none.
67+
68+
The change is a static `<p>` caption only — no buttons, forms, inputs, or
69+
handlers.
70+
71+
## 7. Validation
72+
73+
- `npm run build` (`tsc -b && vite build`) → **success** (typecheck clean; caption
74+
ships in the built bundle).
75+
- `python scripts/validate_safety_config.py`**OVERALL: PASS**.
76+
- `git diff --check` → clean.
77+
- No unit-test runner is configured (only Playwright e2e; no `test` script), so a
78+
unit test was not added (would require a new test runner / package changes,
79+
which are out of scope). Build + validator + static scan were run instead.
80+
81+
## 8. Static scan
82+
83+
Changed file (`IBKRBrokerCard.tsx`):
84+
85+
- No secrets / tokens / DB URLs / API keys / credentials / account IDs / emails /
86+
phones / Neon identifiers.
87+
- No `placeOrder` / `submitOrder` / `executeTrade` / `cancelOrder` /
88+
`enableAutotrade` / "connect live"; no `<button>` / `<form>` / `<input>` /
89+
`onClick`.
90+
- No profit / ROI / win-rate / live-trading assertions.
91+
- buy/sell/order/execution terms appear only in read-only permission/flag
92+
displays (pre-existing) and the new prohibition-context caption.
93+
94+
## 9. Safety confirmation
95+
96+
- no backend/API changes ✅
97+
- no workflows ✅
98+
- no package changes ✅ (deps reused via a temporary, gitignored junction for the
99+
build only)
100+
- no broker credentials ✅
101+
- no env vars touched ✅
102+
- no broker API calls ✅
103+
- no order/execution routes added ✅
104+
- no Buy/Sell/Order/Execute UI added ✅
105+
- no secrets ✅
106+
- no live-trading claims ✅
107+
- no profit/ROI/win-rate claims ✅
108+
- safety posture unchanged (autotrade=false, dry_run=true, read_only=true,
109+
live_orders_blocked=true, max risk ≤ 1%) ✅
110+
111+
## 10. Recommended next step
112+
113+
**PAPER-SIM-UI-POLISH-001-PUBLISH** (push + Draft PR), or
114+
**BROKER-SIM-SCREENSHOT-EVIDENCE-001** to capture the labelled surfaces as demo
115+
evidence.
116+
117+
---
118+
119+
*MellyTrade is a read-only, dry-run, paper-only portfolio project. It is not a
120+
commercial platform, not a live trading system, and not financial advice.*

frontend/src/components/terminal/IBKRBrokerCard.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ export function IBKRBrokerCard({ broker }: IBKRBrokerCardProps) {
5050
<li key={diagnostic}>{diagnostic}</li>
5151
))}
5252
</ul>
53+
<p className="panel-note">
54+
Paper / simulated — read-only preview. No live execution, no credentials,
55+
not live trading.
56+
</p>
5357
</section>
5458
);
5559
}

0 commit comments

Comments
 (0)