diff --git a/agents/stock/workspace/scripts/behive_web.py b/agents/stock/workspace/scripts/behive_web.py index 7895d2c..d623915 100644 --- a/agents/stock/workspace/scripts/behive_web.py +++ b/agents/stock/workspace/scripts/behive_web.py @@ -4979,9 +4979,10 @@ table.market-adr td.adr-breakdown { font-size: 11px; color: #8b8f9a; } .holdings-toggle-wrap { margin-top: 4px; } /* 차트 컨트롤 — 자산정보 탭 상단의 공통 기간·단위 select 묶음. */ -.chart-controls { display: flex; gap: 10px; margin: 10px 14px 4px; flex-wrap: wrap; } +.chart-controls { display: flex; flex-direction: column; gap: 6px; margin: 10px 14px 4px; } +.chart-controls .cc-line { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; } +.chart-controls .cc-line-ym[hidden] { display: none; } /* 지정기간 아닐 때 2번째 줄 숨김 ([hidden] UA 스타일이 flex에 가려지지 않도록 명시) */ .chart-controls .cc-field { display: flex; align-items: center; gap: 6px; } -.chart-controls .cc-ym[hidden] { display: none; } /* 연도별/월별 아닐 때 연·월 드롭다운 숨김 ([hidden] UA 스타일이 flex에 가려지지 않도록 명시) */ .chart-controls .cc-label { color: #8b8f9a; font-size: 11px; } .chart-controls .nw-select { appearance: none; -webkit-appearance: none; @@ -5172,14 +5173,20 @@ def _render_chart_controls(selected_days: int, selected_unit: str, selected_mode f'{html.escape(y)}년' for y in years ) - month_opts = ''.join( - f'{int(m)}월' - for m in months_map.get(cur_year, []) - ) + # 월 — 월별일 때만 실제 월 목록(활성), 연도별이면 '-' 한 칸 비활성. + if is_month: + month_opts = ''.join( + f'{int(m)}월' + for m in months_map.get(cur_year, []) + ) + _month_dis = '' + else: + month_opts = '-' + _month_dis = ' disabled' _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) + # 지정기간은 단위 일별 고정 → 단위 select 비활성, '일별' 선택 표시. unit_opts = ''.join( f'' + # 1번째 줄: 기간 / 단위 / 차트타입(모드). 2번째 줄(지정기간일 때만): 유형 / 연도 / 월. + line1 = ( + f'' f'기간' f'{range_opts}' - # 지정기간 선택 시 노출: 유형(연도별/월별) → 연도 → 월(월별일 때만). 데이터 있는 기간만. - f'유형' - f'{type_opts}' - f'연도' - f'{year_opts}' - f'월' - f'{month_opts}' - # 단위·모드 한 cc-field 묶음. period 활성 시 단위 강제(disabled). f'단위' f'{unit_opts}' f'{mode_opts}' - '' + f'' ) + line2 = ( + f'' + f'유형' + f'{type_opts}' + f'연도' + f'{year_opts}' + f'월' + f'{month_opts}' + f'' + ) + return f'{line1}{line2}' def _format_signed_billion(v: int | None) -> tuple[str, str]: @@ -5765,7 +5776,7 @@ def _render_summary_panel(ordered_owners: list[str], owner_data: dict, balances: # 연도별/월별 절대 선택 — chart_ym('YYYY'=연도별·월별집계 / 'YYYY-MM'=월별·일별) 있으면 단위 강제 + period 필터. period = (chart_ym or '').strip() - eff_unit = ('day' if len(period) > 4 else 'month') if period else chart_unit + eff_unit = 'day' if period else chart_unit # 지정기간(연도별·월별)은 단위 일별 고정. # 절대 선택이 과거 기간(이번달·올해가 아님)이면 오늘 라이브 점·라이브 갱신을 끈다 — # 과거 차트(예: 4월)에 today 순자산이 마지막 점·델타·하단값으로 섞이는 것 방지. 프리셋은 항상 today 포함. _now_dt = datetime.now(KST)