Skip to content

feat: add strategy selector with cards, comparison table, and confirm…#58

Open
TomikeDS wants to merge 6 commits intoNeurowealth:mainfrom
TomikeDS:feat/strategy-selector
Open

feat: add strategy selector with cards, comparison table, and confirm…#58
TomikeDS wants to merge 6 commits intoNeurowealth:mainfrom
TomikeDS:feat/strategy-selector

Conversation

@TomikeDS
Copy link
Copy Markdown

Summary

  • Strategy cards — three equal-width cards (Conservative 4–6%, Balanced 7–10%, Growth 11–18%) on a 3-column responsive grid. Selected state uses border-2 border-sky-500 bg-sky-500/8 per spec. Each card shows title, APY range, risk badge, ≤140-char description, and a primary action button.
  • Risk badges — Conservative bg-sky-400/15 text-sky-400 (accent), Balanced bg-amber-500/15 text-amber-500 (warning), Growth bg-red-500/15 text-red-500 (danger).
  • Comparison table — six rows (APY, risk, rebalance frequency, liquidity, drawdown, horizon). Horizontally scrollable on mobile; sticky thead on desktop. Active strategy column is highlighted.
  • Confirmation modal — triggered on card selection, shows from→to strategy, APY/risk summary, disclaimer note. Has loading spinner, error alert, and closes on Escape or backdrop click.
  • Success banneraria-live="polite" region confirms the save and explains the rebalance cycle.
  • APIGET /api/strategy and PUT /api/strategy. Forwards to NEUROWEALTH_API_BASE_URL/strategy/preference when set; falls back to an in-memory mock that is also mirrored to localStorage for cross-refresh persistence.
  • Protected route at /dashboard/strategy wrapped in ProtectedRoute + Suspense.

Design spec compliance

Requirement Implementation
3 cards equal visual weight CSS grid-cols-3 with flex-col cards
Selected: 2px primary border + tint border-2 border-sky-500 bg-sky-500/8
Conservative → accent badge bg-sky-400/15 text-sky-400
Balanced → warning badge bg-amber-500/15 text-amber-500
Growth → danger badge bg-red-500/15 text-red-500
≤140-char descriptions All three verified (116 / 121 / 118 chars)
Comparison table mobile scroll overflow-x-auto with min-w-[480px] table
Sticky comparison header desktop sticky top-0 z-10 on thead

closes #32
closes #33

…ation UX

Implements the full strategy selection flow at /dashboard/strategy:

- Three equal-weight cards (Conservative, Balanced, Growth) with selected
  state using 2px primary border + sky-500/8 background tint per spec
- Risk badges: Conservative → accent (sky-400), Balanced → warning (amber-500),
  Growth → danger (red-500)
- Card content: title, APY range, risk badge, ≤140-char description, primary CTA
- Comparison table (APY, risk, rebalance, liquidity, drawdown, horizon)
  with horizontal scroll on mobile and sticky header on desktop
- Confirmation modal: from→to summary, APY/risk preview, cancel/confirm with
  loading state, error banner, and Escape-to-dismiss
- Success banner with aria-live region after preference is saved
- Loading skeleton while initial preference is fetched
- GET /api/strategy + PUT /api/strategy endpoints; tries real backend via
  NEUROWEALTH_API_BASE_URL, falls back to in-memory mock + localStorage
- Passes lint, tsc --noEmit, and npm run build (frontend-ci.yml)
@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 26, 2026

@TomikeDS Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Abidoyesimze
Copy link
Copy Markdown
Contributor

kindly fix your conflict and i'll merge

@TomikeDS
Copy link
Copy Markdown
Author

TomikeDS commented Apr 1, 2026

@Abidoyesimze conflict resolved

@Abidoyesimze
Copy link
Copy Markdown
Contributor

Kindly fix the failing CI

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.

Build transaction history and activity timeline Build strategy selection and risk profile screen

2 participants