1.9 KiB
1.9 KiB
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 (
titleattribute) on hover - Fallback to stock code when name is unavailable:
name || ticker
Display Pattern
<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.namecolumn 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 |