Skip to content

Refactor/useMarkdownGrammer 훅 모듈화 #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

Ludovico7
Copy link
Collaborator

📝 변경 사항

  • useMarkdownGrammer훅 내부 키입력별 핸들러 별도 모듈로 분리

🔍 변경 사항 설명

  • 기존 handleKeyDown 내 모든 키 이벤트 처리 로직(Enter, Backspace, Tab, Arrow 등)을 각각 독립적인 handler 함수로 모듈화하였습니다.
  • 각 handler는 기존 로직을 그대로 유지하며, 기능 변경 없이 코드 품질 개선 및 가독성 향상에 초점을 맞추었습니다.
  • 중복되는 updateEditorState, decreaseIndent, findBlockByIndex 등 유틸성 로직도 별도 모듈로 추출하였습니다.
  • handlerMap을 통한 key-handler 매핑으로 switch-case 제거 → 유지보수성 향상

🙏 질문 사항

테스트를 위한 PR입니다!

  • approve는 최종 테스트 이후에 부탁드립니다.
  • 핸들러별 로직 개선하기에는 건드리기가 너무 복잡해서 최대한 기존 로직 및 코드 그대로 분리하는 형식으로 리팩토링을 진행했습니다.
  • 현재 개인적으로 최대한 많은 케이스를 테스트를 해보긴 했지만, 아직 확실하진 않습니다. 나중에 같이 테스트해보고 문제가 있는 부분이 있거나, 적용하는데 문제가 있다면, PR close할 예정입니다!

📷 스크린샷 (선택)

  • UI 변경이 있는 경우 스크린샷이나 GIF를 첨부합니다.

✅ 작성자 체크리스트

  • Self-review: 코드가 스스로 검토됨
  • Unit tests 추가 또는 수정
  • 로컬에서 모든 기능이 정상 작동함
  • 린터 및 포맷터로 코드 정리됨
  • 의존성 업데이트 확인
  • 문서 업데이트 또는 주석 추가 (필요 시)

@Ludovico7 Ludovico7 added Refactor refactor codes FE Front End labels May 3, 2025
@Ludovico7 Ludovico7 self-assigned this May 3, 2025
Copy link
Collaborator

@minjungw00 minjungw00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고많으셨습니다!

Copy link
Member

@pipisebastian pipisebastian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다!!

@github-actions github-actions bot merged commit af3cdf6 into feature/온보딩_및_페이지_UX_개선 May 8, 2025
3 checks passed
Copy link
Collaborator

@hyonun321 hyonun321 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인했습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FE Front End Refactor refactor codes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants