Skip to content

Move Trading CRUD from Beta sidebar to Settings, consolidate Portfolio#214

Merged
luokerenx4 merged 2 commits into
masterfrom
claude/dreamy-volta-6f0W6
May 25, 2026
Merged

Move Trading CRUD from Beta sidebar to Settings, consolidate Portfolio#214
luokerenx4 merged 2 commits into
masterfrom
claude/dreamy-volta-6f0W6

Conversation

@luokerenx4
Copy link
Copy Markdown
Contributor

Summary

Reorganizes the Trading Accounts UI surface: moves broker connection CRUD (add/edit/delete) from a dedicated Beta sidebar into Settings → Trading, and removes portfolio-level aggregates (equity banner, sparklines, 24h deltas) from the Trading page. Those aggregates now live exclusively in Portfolio, where they belong as state/analytics surfaces rather than configuration surfaces.

Key Changes

  • Settings integration: Trading Accounts CRUD now lives under Settings → Trading (alongside General, AI Provider, etc.) instead of a separate Beta sidebar entry. The TradingAccountsBetaSidebar component is removed.

  • EditUTADialog promotion: The edit dialog is now the primary CRUD surface for the Trading settings category, mounted directly from TradingPage when a user clicks a card. Adds an optional "View in Portfolio" link to switch context to the Portfolio drill-in for that account.

  • Portfolio consolidation: Removes PortfolioBanner (hero equity + 24h delta), Sparkline rendering, and per-UTA equity curves from TradingPage. These now live only in PortfolioPage, which is the correct home for aggregate state and trend visualization.

  • Simplified equity polling: TradingPage now fetches equity() on a 60s cadence (down from 30s) purely as a liveness signal — to show "this connection returned a real account balance" on each card. Trend data, sparklines, and aggregate PnL are Portfolio's responsibility.

  • URL/sidebar alignment: UrlAdopter now maps uta-detail specs to the Portfolio sidebar (not a new Trading sidebar), and sets the correct sidebar context on URL-driven navigation (fresh load, deep link, back-forward). Adds a redirect from /trading-accounts to /settings/trading for backward compatibility.

  • Empty state UX: Portfolio's "no accounts" empty state now includes a button that navigates directly to Settings → Trading to add a broker connection.

Implementation Details

  • The EditUTADialog now accepts an optional onViewInPortfolio callback; when provided (from Settings), it renders a header link to switch to the Portfolio detail view for that account.
  • Removed summarizeCurve() and related curve-aggregation logic; equity curves are now computed only in PortfolioPage.
  • Removed imports of Metric, Sparkline, fmtPnl, fmtPctSigned from TradingPage; these are Portfolio-only concerns.
  • Settings category list now includes Trading as a regular category (no special alsoActiveFor logic needed).
  • ActivityBar no longer imports or references the Landmark icon or trading-accounts section.

This change clarifies the responsibility split: Settings is for configuration (CRUD), Portfolio is for state and analytics (read-heavy, trend-focused).

https://claude.ai/code/session_01G5pNede6j7HjyaXkhQRVUy

claude added 2 commits May 25, 2026 16:23
Trading Accounts (Beta) and Portfolio displayed the same five-account
list under two top-level entries, with Trading Accounts re-rendering an
aggregate equity banner + per-card sparklines that duplicated Portfolio.
Clicking a Trading Accounts card sent users to Portfolio drill-in
instead of broker config, blurring the "manage connections" vs "view
financial state" line.

Disentangle along verbs:

- Settings → Trading: broker connection CRUD. UTACard click opens
  EditUTADialog (was: nav to /uta/:id). Drops PortfolioBanner +
  sparkline + curve polling; keeps a single per-card equity number
  as a connection-liveness signal (60s poll vs old 30s).
- Portfolio (Beta): aggregate equity + per-UTA drill-in unchanged.
  Empty state now points to Settings → Trading with an explicit
  jump button.
- Trading-as-Git (Beta): unchanged — orthogonal ops surface.

EditUTADialog gains an optional onViewInPortfolio link rendered in
the header, so users in config-mode can jump to financial state for
the same account without going back through the sidebar.

Subsection-header rule for sidebars codified in sections.tsx jsdoc:
use headers only when listing items of more than one shape (Portfolio's
aggregate + per-instance), not for symmetry across sidebars.

Removes the `trading-accounts` ActivitySection / Page / sidebar entry;
adds /trading-accounts → /settings/trading redirect. No persistence
compat — bump and clear.
Before: fresh-load / deep-link / back-forward to a deep URL only
opened the tab; selectedSidebar stayed at whatever was persisted
(or null on first run), leaving the secondary sidebar column blank.
First-time users landing on /inbox saw ActivityBar + main panel
with empty middle space — no left-rail context. This got more
visible after Portfolio became a more common bookmark target post-IA-
refactor.

Add specToSection(spec) and call setSidebar inside useAdopt so URL-
driven navigation lands with the matching sidebar already open. Only
fires from real URL events (mount + popstate); silent UrlSync writes
via replaceState don't re-trigger it, so explicit user sidebar choices
still win.

uta-detail maps to portfolio (not settings) — its URL lives under
/settings/uta/:id for historical reasons but the page is a Portfolio
drill-in.
@luokerenx4 luokerenx4 merged commit 7c476be into master May 25, 2026
1 check 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.

2 participants