diff --git a/agents/stock/workspace/scripts/behive_web.py b/agents/stock/workspace/scripts/behive_web.py index 6e37d0d..5829489 100644 --- a/agents/stock/workspace/scripts/behive_web.py +++ b/agents/stock/workspace/scripts/behive_web.py @@ -2517,6 +2517,9 @@ def _buy_rank_badge(buy_amount: int) -> str: def _render_holding_row(r: dict, total_value: int, show_day_change: bool = False, key_suffix: str = '') -> str: stock = html.escape(r['stock']) + # 종목명 길이 기반 글씨크기 — 길면 줄여서 한 줄에 맞춤(ellipsis 최소화, 렌더 시 확정이라 깜빡임 없음). + _nlen = len(r.get('stock', '') or '') + stock_cls = 'stock stock-xs' if _nlen >= 14 else ('stock stock-sm' if _nlen >= 10 else 'stock') code = html.escape(r.get('code', '') or '') accounts = html.escape('+'.join(r.get('accounts', []))) qty = r.get('qty', 0) @@ -2667,8 +2670,8 @@ def _render_holding_row(r: dict, total_value: int, show_day_change: bool = False return f'''
-
{_buy_rank_badge(buy_amount)}{stock}
-
보유 {qty:,}주{_pending_badges_html(r)}비중 {weight:.2f}%{star}
+
{_buy_rank_badge(buy_amount)}{stock}
+
{star}보유 {qty:,}주{_pending_badges_html(r)}비중 {weight:.2f}%
{tag_chip}{accounts}
{summary_journal_html}
@@ -4034,6 +4037,8 @@ details.row + .section-label { margin-top: 14px; padding-top: 24px; border-top-c /* 보유행 1줄: 뱃지+당일마크+종목명+계좌 한 줄 고정(nowrap). 이름 길면 .stock 이 ellipsis 로 줄어듦. */ .line1-held { flex-wrap: nowrap; } .stock { font-size: 14px; font-weight: 600; color: #f0f0f0; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; } +.stock.stock-sm { font-size: 12px; } /* 이름 10자+ */ +.stock.stock-xs { font-size: 10.5px; } /* 이름 14자+ */ .code { font-size: 11px; color: #5a5f6c; font-weight: 400; flex: none; } .line2 { display: flex; align-items: center; gap: 8px; font-size: 12px; min-width: 0; } @@ -9077,25 +9082,6 @@ window.openPinModal = openPinModal; })(); ''' - # 종목명 자동맞춤 — 길어서 잘릴 것 같으면 글씨를 줄여 한 줄에 맞춤(ellipsis 대신). 폭 실측 필요해 JS. - # 실시간 가격 갱신(1초)으로 재측정되면 레이아웃 부하 → MutationObserver는 '행 추가(패널 swap)'에만 반응하도록 필터. - stock_fit_script = r'''''' - return f''' @@ -9156,7 +9142,6 @@ window.openPinModal = openPinModal; {order_modal_script} {stock_name_tip_script} {realtime_script} - {stock_fit_script} '''