From 8c891a820ae6d94e7307f2d861b629566f8ebb37 Mon Sep 17 00:00:00 2001 From: hyowons Date: Wed, 10 Jun 2026 10:57:40 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EC=B0=A8=ED=8A=B8=20=EA=B8=B0?= =?UTF-8?q?=EA=B0=84=20'=EC=97=B0=EB=8F=84=EB=B3=84/=EC=9B=94=EB=B3=84'=20?= =?UTF-8?q?=E2=86=92=20'=EC=A7=80=EC=A0=95=EA=B8=B0=EA=B0=84'=20+=20?= =?UTF-8?q?=EC=9C=A0=ED=98=95=20=ED=95=98=EC=9C=84=20=EB=93=9C=EB=A1=AD?= =?UTF-8?q?=EB=8B=A4=EC=9A=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 기간 드롭다운의 연도별·월별 2옵션을 '지정기간' 1옵션으로 통합. 지정기간 선택 시 보조 드롭다운 노출: 유형(연도별/월별) → 연도 → 월(월별일 때만). - _render_chart_controls: custom 옵션 + data-nw-ymtype 유형 select 추가, 가시성 재구성 - JS: range='custom' 진입·data-nw-ymtype 핸들러(ymSet/curYear/curType 헬퍼) chart_ym 인코딩·서버 로직은 그대로(YYYY/YYYY-MM). Co-Authored-By: Claude Opus 4.8 --- agents/stock/workspace/scripts/behive_web.py | 42 +++++++++++--------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/agents/stock/workspace/scripts/behive_web.py b/agents/stock/workspace/scripts/behive_web.py index a306e9d..7895d2c 100644 --- a/agents/stock/workspace/scripts/behive_web.py +++ b/agents/stock/workspace/scripts/behive_web.py @@ -5141,8 +5141,8 @@ def _owner_full_title(owner: str) -> str: def _render_chart_controls(selected_days: int, selected_unit: str, selected_mode: str = NET_WORTH_CHART_MODE, chart_ym: str = '', avail: dict | None = None) -> str: """차트용 공통 컨트롤 — 기간 / 단위 / 모드(순자산·손익누적·기간손익) select. - 기간에 '연도별'(연도 선택→월별집계)·'월별'(연도+월 선택→일별) 추가. period(chart_ym) 활성 시 단위는 강제·비활성. - 의미없는 단위(이번주+월별 등)는 disabled.""" + 기간에 '지정기간' 추가 → 유형(연도별/월별) + 연도 + 월(월별일 때) 보조 드롭다운. + period(chart_ym) 활성 시 단위는 강제·비활성. 의미없는 단위(이번주+월별 등)는 disabled.""" avail = avail or {'years': [], 'months': {}} period = (chart_ym or '').strip() is_year = len(period) == 4 @@ -5158,8 +5158,13 @@ def _render_chart_controls(selected_days: int, selected_unit: str, selected_mode f'' for lbl, d in NET_WORTH_CHART_PRESETS ) - range_opts += f'' - range_opts += f'' + range_opts += f'' + + # 유형: 연도별(year) / 월별(month) — period_active 일 때만 노출. + type_opts = ( + f'' + f'' + ) cur_year = period[:4] if period_active else (years[0] if years else '') cur_month = period[5:7] if is_month else '' @@ -5171,7 +5176,7 @@ def _render_chart_controls(selected_days: int, selected_unit: str, selected_mode f'' for m in months_map.get(cur_year, []) ) - _yhide = '' if period_active else ' hidden' + _customhide = '' if period_active else ' hidden' _mhide = '' if is_month else ' hidden' months_json = html.escape(json.dumps(months_map, ensure_ascii=False), quote=True) @@ -5191,8 +5196,10 @@ def _render_chart_controls(selected_days: int, selected_unit: str, selected_mode f'
' f'' - # 연도별/월별 선택 시 노출되는 연·월 드롭다운 (데이터 있는 기간만). - f'