Commit Graph

5 Commits

Author SHA1 Message Date
claude-owner
7312d0aadc feat(chart): Alt+Click removes nearest horizontal line
IPriceLine has no native click event, so use a coordinate-matching pattern:
  - On Alt+Click, compute candle.priceToCoordinate for each hline
  - Find the one whose y is closest to the click y
  - If within ±6px, remove it via removeLine

Complements the chips ✕ button — clicking the line itself on the chart is
more natural than aiming at a small ✕. Shift+Click for add still wins when
both modifiers are held (more frequent, checked first).

- StockChart toolbar title and ShortcutsHelp updated to surface the gesture
2026-05-29 00:42:31 +09:00
claude-owner
cab2ed13a3 feat(chart): Shift+Click adds horizontal line at clicked y-coordinate
H key and toolbar button use hover-or-last-close, so mouse users had no way
to drop a line at an arbitrary price they hadn't hovered. Shift+Click reads
the click's y via candle.coordinateToPrice — direct positional control.

- Plain click stays as native chart interaction (crosshair/drag)
- Only intercepts when shiftKey held; preventDefault to avoid text selection
- Honors the same 10-line cap as the H key / button
- ShortcutsHelp adds "Shift+클릭" entry next to H so it's discoverable
2026-05-29 00:39:45 +09:00
claude-owner
318eae67df feat(chart): horizontal line drawing tool + modal-open shortcut guards
리뷰어 093ac86 지적 처리:
- 종목 페이지 단축키 핸들러 (←/→/S) 에 modal 가드 추가.
  `document.querySelector('[role="dialog"][aria-modal="true"]')` 가 매치되면
  return — ShortcutsHelp 같은 모달이 열린 상태에서 close 버튼이 포커스를
  잡고 있어도 페이지 단축키가 뒤에서 동작하지 않도록.
- StockChart 의 F 단축키에도 동일한 modal 가드 — 동일 문제 (모달 위에서
  F 가 차트 전체화면 토글) 차단.

신규 슬라이스 — 차트 수평선 그리기 도구:
- `web/lib/lines.ts` — `hlines:<code>` 키 localStorage. id 단위 add/remove/clear,
  최대 10 개, 같은 가격 중복 추가 방지(부동소수 4 자리 비교), crypto.randomUUID
  폴백 포함.
- StockChart 툴바: `─ 수평선 (N/10)` 버튼 — hover 가격 또는 마지막 봉 종가에
  추가. 한도 도달 / 가격 없음이면 disabled.
- 추가된 라인은 chips 형태로 toolbar 아래 한 줄에 표시 — 각각 ✕ 로 제거,
  `전체 해제` 버튼 별도.
- H 키 단축키 — modifier/editable/modal 가드 일관 적용. 가격은 ref 로 들고
  있어 keydown effect 가 재구독되지 않음.
- 차트엔 `createPriceLine` 으로 zinc-400 solid 라인 (목표/손절의 점선과 톤
  분리). 종목 전환 시 자동 reload.
- ShortcutsHelp 에 H 단축키 등록.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 00:29:56 +09:00
claude-owner
093ac86d1a feat(symbol-page): keyboard navigation for period tabs and watchlist
- ←/→ : 기간 탭 이전/다음 (양끝 clamp — wrap-around 안 함, 사용자가
  끝에 갇혔는지 인지 가능).
- S : 관심종목 토글 (watchlist.toggle, StarButton 자동 동기화).
- 입력 필드 포커스 시 무시 — 검색창/메모 텍스트 편집 방해 금지.
- modifier(Ctrl/Cmd/Alt) 가 눌리면 단축키 양보 — 브라우저/OS 단축키
  보존 (ex. Cmd+→ 줄 끝 이동, Alt+← 뒤로가기 등).
- ShortcutsHelp 에 새 단축키 등록 → ? 키 헬프 오버레이에서 발견 가능.
- PeriodTabs 에 `periodNeighbor(id, dir)` 헬퍼 export — 페이지가
  PERIODS 순서를 직접 알 필요 없도록.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 00:24:03 +09:00
claude-owner
6f71aef451 feat(shortcuts): keyboard shortcuts help overlay + F modifier guard
- 글로벌 `ShortcutsHelp` 컴포넌트 추가 — `?` 키로 토글, ESC 또는 바깥
  클릭 / 닫기 버튼 / 우하단 floating ? 버튼으로 닫음. /, Ctrl+K, F,
  ESC, ↑↓, Enter 등 현재 사이트의 모든 단축키를 scope 별로 표시.
- 입력 필드 포커스 시 단축키 무시 가드 — `?` 입력 의도를 방해하지 않음.
- 열릴 때 닫기 버튼에 포커스 → 키보드 사용자 Tab 흐름 자연스럽게.
- 모달 click-outside → setOpen(false), aria-modal/role=dialog 로 접근성.
- 리뷰어 9f215ac 지적: StockChart F 단축키가 Ctrl+F/Cmd+F/Alt+F 도
  가로채던 것을 modifier guard 로 막음. shift/ctrl/meta/alt 어느 것도
  눌리지 않은 단순 F 일 때만 toggleFullscreen.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 00:21:07 +09:00