Skip to content

feat: 차트의 바 삭제 시 해당 원 잠금 해제 기능 구현#78

Merged
shubug1015 merged 2 commits into
mainfrom
feat/delete-bar-circle
May 21, 2026
Merged

feat: 차트의 바 삭제 시 해당 원 잠금 해제 기능 구현#78
shubug1015 merged 2 commits into
mainfrom
feat/delete-bar-circle

Conversation

@shubug1015

@shubug1015 shubug1015 commented May 20, 2026

Copy link
Copy Markdown
Contributor

🌱 PR 포인트

  • 차트에서 바를 삭제할 시 바에 해당되는 원의 잠금이 해제되는 기능을 구현하는 작업을 완료했습니다.

❗ 이슈사항 / 기타사항 / 에러슈팅

  • 원을 선택할 수 있는 영역을 원의 하이라이트 네모 박스에서 원으로 되돌렸습니다.

Summary by CodeRabbit

  • 버그 수정

    • 원형 객체의 마우스 호버(충돌) 판정 로직을 개선해 경계 인식이 원형 기준으로 더 정확해졌습니다.
  • 새로운 기능

    • 차트 삭제 이벤트가 실시간으로 처리되며, 삭제에 따른 원형 항목의 연동 상태가 즉시 갱신됩니다.

Review Change Stack

@shubug1015 shubug1015 self-assigned this May 20, 2026
@shubug1015 shubug1015 added the enhancement New feature or request label May 20, 2026
@coderabbitai

coderabbitai Bot commented May 20, 2026

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

이 PR은 원형 영역의 충돌 감지 알고리즘을 기하학적으로 정확하게 개선하고, 차트 바 삭제 이벤트를 소켓 메시지로 처리하는 기능을 추가합니다. 호버 판정 로직을 제곱거리 기반으로 변경하며, 새로운 소켓 액션 타입과 핸들링 로직을 구현합니다.

Changes

원 충돌 감지 및 소켓 메시지 처리

Layer / File(s) Summary
원 충돌 감지 로직 개선
src/canvas/tools/collision.ts
getHoveredCircleIndex에서 원의 포함 여부 판정을 축 정렬 사각형 범위(Math.abs(deltaX) <= radius && Math.abs(deltaY) <= radius)에서 제곱거리 기반(deltaX^2 + deltaY^2 <= radius^2)으로 변경하여 원형 경계에 대한 충돌 판정을 일관되게 합니다.
차트 바 삭제 소켓 메시지 처리
src/sockets/chartSocketHandler.ts
CircleResponse 타입을 import하고, ChartSocketMessage 유니온에 CHART_BAR_DELETED 액션을 추가한 뒤, handleChartSocketMessage의 switch에 해당 케이스를 구현하여 수신된 메시지에서 payload.idcircleStore.updateCircleChartId를 호출합니다.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • thinkfree-2026/thinkchart-fe#67: 메인 PR이 src/sockets/chartSocketHandler.ts에서 차트 관련 소켓 액션을 추가하며 payload.idcircleStore.updateCircleChartId를 호출/처리 흐름을 바꾸는 점이, 검색 PR #67의 chartSocketHandler.ts에서 CHART_DELETED 처리 로직을 updateCircleChartId로 전환한 변경과 같은 코드 경로를 직접 다룹니다.

Suggested reviewers

  • 10hajin15
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목은 변경사항의 주요 기능을 명확하게 설명합니다. 차트 바 삭제 시 원 잠금 해제라는 핵심 기능이 잘 드러나 있습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/delete-bar-circle

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@shubug1015 shubug1015 requested a review from 10hajin15 May 20, 2026 23:50
@shubug1015 shubug1015 force-pushed the feat/delete-bar-circle branch from 15f8efd to 03039fb Compare May 21, 2026 06:26
@shubug1015 shubug1015 merged commit fcc6e54 into main May 21, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant