Skip to content

feat: CategoryModal 중앙정렬 및 뒷 배경 딤드처리 방식으로 변경#145

Merged
unanbb merged 1 commit intomainfrom
fix/category-modal-121
Jun 21, 2025
Merged

feat: CategoryModal 중앙정렬 및 뒷 배경 딤드처리 방식으로 변경#145
unanbb merged 1 commit intomainfrom
fix/category-modal-121

Conversation

@unanbb
Copy link
Copy Markdown
Owner

@unanbb unanbb commented Jun 21, 2025

📋 작업 세부 사항

  • CategoryModal 겉에 div 하나 추가하여 중앙정렬 및 뒷배경 생성
    • 해당 div에 onClick을 걸어 뒷배경 클릭시에도 모달이 꺼지도록 구현
  • 이벤트 버블링 방지를 위해 바로 하위 div에 onClick={e => e.stopPropagation} 적용

🔧 변경 사항 요약

CategoryModal 중앙정렬 및 뒷 배경 딤드처리 방식으로 변경

category-modal-dimmed

Summary by CodeRabbit

  • New Features
    • 카테고리 모달에서 모달 바깥(오버레이 영역)을 클릭하면 모달이 닫히도록 개선되었습니다. 모달 내부를 클릭할 경우에는 닫히지 않습니다.

@unanbb unanbb self-assigned this Jun 21, 2025
@unanbb unanbb added the feature New feature or request label Jun 21, 2025
@vercel
Copy link
Copy Markdown

vercel bot commented Jun 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
memoji ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2025 5:39am

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jun 21, 2025

Walkthrough

모달 컨테이너가 뷰포트 전체를 덮는 반투명 검정색 오버레이 div로 감싸졌으며, 오버레이를 클릭하면 모달이 닫히도록 onClick 핸들러가 추가되었습니다. 모달 내부 클릭 시에는 이벤트 전파가 중단되어 모달이 닫히지 않습니다. 모달 내부 구조와 로직은 변경되지 않았습니다.

Changes

파일 경로 변경 요약
src/components/category/CategoryModal.tsx 오버레이 div 추가, 오버레이 클릭 시 모달 닫기, 내부 클릭 시 이벤트 전파 중단

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Overlay
    participant CategoryModal

    User->>Overlay: 클릭(오버레이 영역)
    Overlay->>CategoryModal: closeModal() 호출

    User->>CategoryModal: 클릭(모달 내부)
    CategoryModal-->>Overlay: 이벤트 전파 중단(모달 닫기 동작 없음)
Loading

Possibly related PRs

Suggested labels

design

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error https://github.com/npm/cli/issues
npm error A complete log of this run can be found in: /.npm/_logs/2025-06-21T05_40_31_511Z-debug-0.log

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/components/category/CategoryModal.tsx (1)

265-375: 접근성 개선을 위한 선택적 개선사항들을 고려해보세요.

현재 구현도 잘 동작하지만, 더 나은 사용자 경험을 위해 다음 개선사항들을 고려해볼 수 있습니다:

  1. 오버레이에 적절한 역할과 aria 속성 추가
  2. 모달이 열릴 때 body 스크롤 방지
  3. 모달 열림 시 첫 번째 포커서블 요소에 자동 포커스

예시 개선사항:

  return (
    <div
-     className="fixed inset-0 z-50 flex items-center justify-center bg-black/50"
+     className="fixed inset-0 z-50 flex items-center justify-center bg-black/50"
+     role="dialog"
+     aria-modal="true"
+     aria-labelledby="modal-title"
      onClick={onClose}
    >
      <div
        className="bg-white flex flex-col w-[300px] h-auto min-h-[200px] max-h-[400px] p-4 pr-0 border border-gray-300 rounded-xs overflow-y-auto"
        onClick={e => e.stopPropagation()}
      >
        {isLoading ? (
          <div>Loading...</div>
        ) : (
          <>
            <div className="flex justify-between mb-2  pr-4">
-             <h1 className="text-lg font-semibold">Category List</h1>
+             <h1 id="modal-title" className="text-lg font-semibold">Category List</h1>
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 22d57ef and 9f0a1a5.

📒 Files selected for processing (1)
  • src/components/category/CategoryModal.tsx (1 hunks)
🔇 Additional comments (2)
src/components/category/CategoryModal.tsx (2)

265-268: 모달 오버레이 구현이 잘 되어있습니다!

표준적인 모달 패턴을 잘 따라 구현되었습니다. fixed positioning, 전체 뷰포트 덮기, 중앙 정렬, 반투명 배경 처리가 모두 적절하게 구현되어 있습니다.


269-272: 이벤트 전파 차단 로직이 올바르게 구현되었습니다.

e.stopPropagation()을 사용하여 모달 내부 클릭 시 모달이 닫히지 않도록 하는 것이 정확한 구현입니다.

@unanbb unanbb merged commit 89631fa into main Jun 21, 2025
5 checks passed
@unanbb unanbb deleted the fix/category-modal-121 branch June 21, 2025 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] CategoryModal 중앙정렬 및 뒷 배경 딤드처리 방식으로 변경

1 participant