diff --git a/docs/plans/2026-02-16-stock-name-display-design.md b/docs/plans/2026-02-16-stock-name-display-design.md new file mode 100644 index 0000000..a390b60 --- /dev/null +++ b/docs/plans/2026-02-16-stock-name-display-design.md @@ -0,0 +1,52 @@ +# Stock Name Display Design + +## Problem + +Portfolio-related menus display stock codes (e.g., "095570") instead of stock names (e.g., "AJ네트웍스"), making them hard to read. Stock names should be the primary display, with codes available via tooltip on hover. + +## Decision + +- Display stock name as primary text everywhere +- Show stock code via browser-native tooltip (`title` attribute) on hover +- Fallback to stock code when name is unavailable: `name || ticker` + +## Display Pattern + +```tsx +{item.name || item.ticker} +``` + +## Backend Changes + +### Schemas to Update + +| Schema | Change | +|--------|--------| +| `SnapshotHoldingResponse` | Add `name: str \| None = None` | +| `TransactionResponse` | Add `name: str \| None = None` | + +### API Endpoints to Update + +| Endpoint | Change | +|----------|--------| +| `GET /snapshots/{snapshot_id}` | Call `get_stock_names()`, populate holdings name | +| `GET /transactions` | Call `get_stock_names()`, populate transactions name | + +### Already Has Name (No Change) + +- `HoldingWithValue`, `RebalanceItem`, `RebalanceCalculateItem` +- Strategy API responses (all 3 strategies) +- Backtest holdings (`BacktestHolding.name` column exists) + +## Frontend Changes + +| File | Change | +|------|--------| +| `portfolio-card.tsx` | Add `name` to Holding, show name in badges with ticker tooltip | +| `history/page.tsx` | Add `name` to snapshot holdings, show name in table | +| `[id]/page.tsx` | Transactions tab: add name display. Holdings already uses name. | +| `rebalance/page.tsx` | Swap: name as primary in price inputs and results table | +| `strategy/multi-factor/page.tsx` | Swap: name as primary, ticker as tooltip | +| `strategy/quality/page.tsx` | Swap: name as primary, ticker as tooltip | +| `strategy/value-momentum/page.tsx` | Swap: name as primary, ticker as tooltip | +| `backtest/[id]/page.tsx` | Swap: name as primary for holdings, add name for transactions |