From f146c939c00b2d5b2645eefac0edba5a6848c1c2 Mon Sep 17 00:00:00 2001 From: hyowons Date: Mon, 8 Jun 2026 16:37:10 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=A2=85=EB=AA=A9=EB=AA=85=20=EA=B8=80?= =?UTF-8?q?=EC=94=A8=20=EC=9E=90=EB=8F=99=EB=A7=9E=EC=B6=A4=20=EA=B9=9C?= =?UTF-8?q?=EB=B9=A1=EC=9E=84=20=EC=A0=9C=EA=B1=B0(=EA=B8=B8=EC=9D=B4?= =?UTF-8?q?=EA=B8=B0=EB=B0=98=20CSS)=20+=20=E2=98=85=20=EB=B3=B4=EC=9C=A0?= =?UTF-8?q?=20=EC=99=BC=EC=AA=BD=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit JS 폭측정 자동맞춤은 리셋→축소 플래시가 패널 swap/자동갱신마다 깜빡여서 제거. 대신 이름 길이로 글씨크기 클래스(stock-sm 10자+/stock-xs 14자+) 서버 렌더 시 확정 → 깜빡임 없음. 당일거래 마크(★)는 line2 보유 왼쪽으로 이동. Co-Authored-By: Claude Opus 4.8 --- agents/stock/workspace/scripts/behive_web.py | 29 +++++--------------- 1 file changed, 7 insertions(+), 22 deletions(-) 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} '''