docs: add stock name display design

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
ayuriel 2026-02-16 12:44:54 +09:00
parent 98d8c1115e
commit c836c133dd

View File

@ -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
<span title={item.ticker}>{item.name || item.ticker}</span>
```
## 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 |