From 9c830f58f663259013deaa763eb592b40b841923 Mon Sep 17 00:00:00 2001 From: hyowons Date: Wed, 10 Jun 2026 14:01:33 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=B6=84=EB=B4=89=20=EC=A0=84=EC=9D=BC?= =?UTF-8?q?=EB=8C=80=EB=B9=84%=20=ED=95=AD=EC=83=81=20=ED=91=9C=EC=8B=9C?= =?UTF-8?q?=20+=20=EB=B3=B4=EC=9C=A0=20=EC=83=81=EC=84=B8=20=EC=A2=85?= =?UTF-8?q?=EB=AA=A9=EB=AA=85=20+=20=EC=9C=A0=ED=98=95=20=ED=8F=AD=20?= =?UTF-8?q?=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 분봉 차트(1/5/15m): prev_close를 일봉 캐시에서 못 찾으면 ka10095(현재가−전일대비)로 보강 → 모든 종목에 '전일대비 +X%'(오늘 하루 등락) 항상 표시. - 보유종목 자세히 보기 상단에 종목명+코드(.detail-name) 추가. - 차트 컨트롤 2번째 줄: 연도/월은 내용 크기, 유형은 기간과 동일 폭(글씨 크기 유지). Co-Authored-By: Claude Opus 4.8 --- agents/stock/workspace/scripts/behive_web.py | 29 +++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/agents/stock/workspace/scripts/behive_web.py b/agents/stock/workspace/scripts/behive_web.py index d623915..ef81292 100644 --- a/agents/stock/workspace/scripts/behive_web.py +++ b/agents/stock/workspace/scripts/behive_web.py @@ -2745,6 +2745,7 @@ def _render_holding_row(r: dict, total_value: int, show_day_change: bool = False {candle_summary}
+
{stock}{f'{code}' if code else ''}
{f'
{tag_chip}
' if tag_chip else ''}
{dl_inner}
{pl_dl_inner}
@@ -4212,6 +4213,8 @@ details.row + .section-label { margin-top: 14px; padding-top: 24px; border-top-c .tag-chip { display: inline-block; padding: 0 4px; border-radius: 3px; font-size: 8.5px; font-weight: 500; line-height: 1.4; color: #d6b34a; background: rgba(214,179,74,0.10); border: 1px solid rgba(214,179,74,0.30); white-space: nowrap; flex: none; letter-spacing: 0.01em; font-family: inherit; pointer-events: none; user-select: none; } .tag-chip.tag-leader { color: #ff6b78; background: rgba(255,77,94,0.12); border-color: rgba(255,77,94,0.42); font-weight: 600; } /* 펼친 detail의 태그는 크게 (미리보기·관심행 칩은 작게 유지). */ +.detail-name { font-size: 15px; font-weight: 700; color: #f0f0f0; margin: 0 0 8px; display: flex; align-items: baseline; gap: 8px; } +.detail-name .detail-code { font-size: 11px; font-weight: 500; color: #8b8f9a; font-variant-numeric: tabular-nums; } .detail-tag { margin: 0 0 8px; } .detail-tag .tag-chip { font-size: 11px; padding: 2px 8px; border-radius: 4px; } .btn-add-tag { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 500; line-height: 1.5; color: #5a5f6c; background: transparent; border: 1px dashed rgba(120,124,135,0.30); white-space: nowrap; flex: none; cursor: pointer; font-family: inherit; } @@ -4993,6 +4996,10 @@ table.market-adr td.adr-breakdown { font-size: 11px; color: #8b8f9a; } min-width: 96px; } .chart-controls .nw-select:focus { outline: 1px solid #4a4f5a; outline-offset: 0; } +/* 2번째 줄(유형/연도/월) — 연도/월은 내용 크기로(월 줄바뀜 방지), 유형은 기간과 동일 폭. 글씨는 1번째 줄과 동일. */ +.chart-controls .cc-line-ym { gap: 8px; } +.chart-controls .cc-line-ym .nw-select { min-width: 0; } +.chart-controls .cc-line-ym .nw-select[data-nw-ymtype] { min-width: 96px; } /* 유형 = 기간 select 와 동일 폭 */ @media (max-width: 600px) { nav.tabs .tab-label { padding: 10px 12px; font-size: 12px; } @@ -10028,7 +10035,27 @@ class Handler(BaseHTTPRequestHandler): 'sma20': sa.sma(closes, 20), 'sma60': sa.sma(closes, 60), } - svg = sa.render_svg_chart(snap, range_key='1Y') + # 전일종가 — 일봉 캐시에서 오늘 이전 마지막 종가 → 기준선+전일대비 등락률 표시 + prev_close = None + try: + import daily_candles_cache as dcc + _today = datetime.now(KST).strftime('%Y%m%d') + for b in dcc._select_latest(code, 3): + if b.get('date') and str(b['date']) < _today and b.get('close'): + prev_close = b['close'] + break + except Exception: + prev_close = None + if not prev_close: + # 일봉 캐시 미스 → ka10095(현재가−전일대비)로 전일종가 보강. 모든 종목에 전일대비 % 표시. + try: + _q = kc.get_watchlist_quotes([code]).get(code) or {} + _pc = (_q.get('price') or 0) - (_q.get('change') or 0) + if _pc > 0: + prev_close = _pc + except Exception: + pass + svg = sa.render_svg_chart(snap, range_key='1Y', ref_price=prev_close) body = svg.encode('utf-8') body, enc = _maybe_gzip(body, self.headers.get('Accept-Encoding')) self.send_response(200)