Skip to content

feat: tables & event-feed polish (ui-ux 05, closes the epic)#163

Merged
ArthurBernard merged 2 commits into
developfrom
feat/ui-tables-polish
Jul 5, 2026
Merged

feat: tables & event-feed polish (ui-ux 05, closes the epic)#163
ArthurBernard merged 2 commits into
developfrom
feat/ui-tables-polish

Conversation

@ArthurBernard

Copy link
Copy Markdown
Owner

Summary

Implements leaf 05 (doc/dev/plans/ui-ux-overhaul/05-tables-polish.md), the last leaf of the ui-ux-overhaul epic:

  • No-flicker refresh — Strategies (3s poll), Overview (KPI/positions/open-orders) and Orders (orders/fills) tables cache the last payload (JSON.stringify compare) and skip the DOM rebuild when unchanged; a table never rebuilds while document.activeElement sits inside it (e.g. an open mode <select>), deferring the "updated" stamp too since the visible rows aren't verified current in that case. Shared via a new tbRefreshGuard() helper in base.html.
  • Order-status badges — Orders page + Overview open-orders render status as a colour-coded badge (muted for new/submitted/open, amber for partially_filled, green for filled, dimmed for cancelled, red for rejected), via a shared statusBadge() helper + .badge-status-* CSS in base.html. Covers the domain's actual OrderStatus values plus a few defensive synonyms.
  • History-cap caption — the Orders page's Orders/Fills tables show a muted "showing the most recent 200 — older rows are not displayed" caption when a history read comes back at exactly the server's default ?limit=200 cap.
  • Fills time — absolute YYYY-MM-DD HH:mm:ss visible, relative ("3m ago") on hover.
  • Logs page — lines are stamped with the event's own server ts (leaf 01), a muted strategy chip appears when the frame names the emitting unit, and All/Orders/Fills/Logs filter chips + a min-level select (info/warning/error) apply to both incoming and already-buffered events (a raw ring buffer, re-rendered on filter change; 500-line cap kept).
  • PnL page — the stats table gains a Return column (realised_pnl / v0 via tbFmt.pct, "—" when v0 isn't a non-zero finite number) and a muted starting-capital (v0) note. Y-axis money-formatted ticks were already in place from an earlier leaf.
  • Legacy dashboard.html/app.js untouched — already consistent with leaf 02's formatting, no new features added there per spec.

Closes the ui-ux-overhaul epic: doc/dev/plans/ui-ux-overhaul/00-plan.md flips to status: done, the roadmap's "Dashboard UX overhaul" line is removed, and doc/dev/06-status.md gains a summary paragraph. The plan tree itself is left in place (archived locally after merge, per the repo's workflow).

Test plan

  • python -m pytest — 1165 passed, 9 deselected (network E2E)
  • ruff check trading_bot/ — clean
  • ruff format --check trading_bot/ — clean
  • mypy trading_bot/ — clean
  • interrogate trading_bot/ — 100%
  • Extended template smoke tests: badge CSS + statusBadge helper present on every page, history-cap caption nodes + text, Logs filter chips (data-type=) + min-level select, PnL Return column header + v0 note
  • New server-side test proving /api/orders?history=true&limit=N caps to exactly N rows (the real payload shape the caption logic keys on)
  • Manual smoke: rendered all five pages via TestClient and grepped for the new markup

🤖 Generated with Claude Code

…n % (ui-ux 05)

Closes the ui-ux-overhaul epic: Strategies/Overview/Orders tables skip a DOM
rebuild when the polled payload is unchanged and never rebuild while a control
inside the table has focus; order statuses render as colour-coded badges
shared via base.html; a history read at the server's default cap shows a
muted "showing the most recent 200" caption; the Fills table gains a
seconds-precision timestamp with a relative tooltip; the Logs feed stamps
lines with the event's own server ts, tags them with the emitting strategy,
and gains type + min-level filters over a raw ring buffer; the PnL stats
table gains a Return column (realised PnL / v0) and a starting-capital note.
@ArthurBernard ArthurBernard merged commit 367617d into develop Jul 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant