Skip to content

Comments

[refactor] 중복된 디바이스 감지 훅을 통합한다#921

Merged
seongwon030 merged 1 commit intodevelop-fefrom
refactor/#920-unify-device-detection-MOA-414
Dec 17, 2025
Merged

[refactor] 중복된 디바이스 감지 훅을 통합한다#921
seongwon030 merged 1 commit intodevelop-fefrom
refactor/#920-unify-device-detection-MOA-414

Conversation

@seongwon030
Copy link
Member

@seongwon030 seongwon030 commented Dec 8, 2025

#️⃣연관된 이슈

ex) #920

📝작업 내용

  • useIsMobile 훅 삭제 (useDevice와 중복)
  • 동일한 브레이크포인트(500px) 사용으로 기능 동일

중점적으로 리뷰받고 싶은 부분(선택)

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?

논의하고 싶은 부분(선택)

논의하고 싶은 부분이 있다면 작성해주세요.

🫡 참고사항

Summary by CodeRabbit

릴리스 노트

이 업데이트는 내부 코드 개선 사항만 포함하고 있습니다. 사용자가 인지할 수 있는 새로운 기능이나 변경 사항은 없습니다.

  • 리팩토링
    • 내부 기능 호출 구조를 최적화했습니다.

✏️ Tip: You can customize this high-level summary in your review settings.

- useIsMobile 훅 삭제 (useDevice와 중복)
- 동일한 브레이크포인트(500px) 사용으로 기능 동일
@seongwon030 seongwon030 self-assigned this Dec 8, 2025
@seongwon030 seongwon030 requested a review from oesnuj December 8, 2025 15:49
@vercel
Copy link

vercel bot commented Dec 8, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
moadong Ready Ready Preview Comment Dec 8, 2025 3:49pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 8, 2025

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: Invalid regex pattern for base branch. Received: "**" at "reviews.auto_review.base_branches[0]"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

개요

useIsMobile 훅을 useDevice 훅으로 통합하고, QuestionTitle 컴포넌트를 새로운 훅으로 마이그레이션했습니다. 기존 useIsMobile.ts 파일을 제거하고 중복된 디바이스 감지 로직을 통합했습니다.

변경 사항

코호트 / 파일(들) 변경 요약
훅 마이그레이션
frontend/src/components/application/QuestionTitle/QuestionTitle.tsx
useIsMobile에서 useDevice 훅으로 변경하고, 반환값에서 isMobile 속성을 구조 분해로 추출. useEffect import 제거, 기존 레이아웃 동작 유지
훅 제거
frontend/src/hooks/useIsMobile.ts
전체 파일 삭제. 기존의 window.innerWidth 기반 모바일 감지 로직 및 resize 이벤트 리스너 제거

예상 코드 리뷰 소요 시간

🎯 1 (사소함) | ⏱️ ~3분

  • 단일 훅 교체로 인한 간단한 변경
  • 기존 동작 유지 확인
  • 다른 파일에서 useIsMobile 사용 여부 확인

관련 이슈

추천 레이블

💻 FE, 🛠Fix

추천 리뷰어

  • seongje973
  • suhyun113

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목이 주요 변경사항을 명확하게 요약하고 있으며, 중복된 디바이스 감지 훅을 통합한다는 내용이 변경셋과 완벽하게 일치합니다.
Linked Issues check ✅ Passed PR 변경사항이 연결된 이슈 MOA-414의 요구사항을 충족합니다. useIsMobile 훅이 제거되고 useDevice로 통합되었습니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 연결된 이슈의 범위 내에 있으며, 디바이스 감지 훅 통합이라는 목표에 직접적으로 관련되어 있습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/#920-unify-device-detection-MOA-414

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 3dcf13d and 222c373.

📒 Files selected for processing (2)
  • frontend/src/components/application/QuestionTitle/QuestionTitle.tsx (2 hunks)
  • frontend/src/hooks/useIsMobile.ts (0 hunks)
💤 Files with no reviewable changes (1)
  • frontend/src/hooks/useIsMobile.ts
🧰 Additional context used
📓 Path-based instructions (3)
frontend/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (frontend/.cursorrules)

frontend/**/*.{ts,tsx,js,jsx}: Replace magic numbers with named constants for clarity
Replace complex/nested ternaries with if/else or IIFEs for readability
Assign complex boolean conditions to named variables for explicit meaning
Avoid hidden side effects; functions should only perform actions implied by their signature (Single Responsibility Principle)
Use unique and descriptive names for custom wrappers/functions to avoid ambiguity
Define constants near related logic or ensure names link them clearly to avoid silent failures
Break down broad state management into smaller, focused hooks/contexts to reduce coupling

Files:

  • frontend/src/components/application/QuestionTitle/QuestionTitle.tsx
frontend/**/*.{tsx,jsx}

📄 CodeRabbit inference engine (frontend/.cursorrules)

frontend/**/*.{tsx,jsx}: Abstract complex logic/interactions into dedicated components/HOCs
Separate significantly different conditional UI/logic into distinct components
Colocate simple, localized logic or use inline definitions to reduce context switching
Choose field-level or form-level cohesion based on form requirements when using form libraries like react-hook-form
Use Component Composition instead of Props Drilling to reduce coupling

Files:

  • frontend/src/components/application/QuestionTitle/QuestionTitle.tsx
frontend/**/*.{ts,tsx}

📄 CodeRabbit inference engine (frontend/.cursorrules)

Use consistent return types for similar functions/hooks

Files:

  • frontend/src/components/application/QuestionTitle/QuestionTitle.tsx
🧠 Learnings (3)
📚 Learning: 2025-11-25T14:08:23.253Z
Learnt from: CR
Repo: Moadong/moadong PR: 0
File: frontend/.cursorrules:0-0
Timestamp: 2025-11-25T14:08:23.253Z
Learning: Applies to frontend/**/*.{tsx,jsx} : Separate significantly different conditional UI/logic into distinct components

Applied to files:

  • frontend/src/components/application/QuestionTitle/QuestionTitle.tsx
📚 Learning: 2025-11-25T14:08:23.253Z
Learnt from: CR
Repo: Moadong/moadong PR: 0
File: frontend/.cursorrules:0-0
Timestamp: 2025-11-25T14:08:23.253Z
Learning: Applies to frontend/**/*.{tsx,jsx} : Use Component Composition instead of Props Drilling to reduce coupling

Applied to files:

  • frontend/src/components/application/QuestionTitle/QuestionTitle.tsx
📚 Learning: 2025-11-25T14:08:23.253Z
Learnt from: CR
Repo: Moadong/moadong PR: 0
File: frontend/.cursorrules:0-0
Timestamp: 2025-11-25T14:08:23.253Z
Learning: Applies to frontend/**/*.{ts,tsx,js,jsx} : Break down broad state management into smaller, focused hooks/contexts to reduce coupling

Applied to files:

  • frontend/src/components/application/QuestionTitle/QuestionTitle.tsx
🔇 Additional comments (1)
frontend/src/components/application/QuestionTitle/QuestionTitle.tsx (1)

3-4: useDevice 기반 모바일 감지 변경 문제 없어 보입니다

useDevice에서 isMobile만 구조 분해해서 쓰는 방식으로 잘 교체되었고, 사용처도 !isMobile && id && … 한 곳이라 변경 영향 범위가 명확합니다. 기존 useIsMobile 대비 동작 차이만 없다면 그대로 머지해도 될 것 같습니다.

PR 설명대로 useDeviceisMobile 기준(특히 500px 브레이크포인트)이 이전 훅과 완전히 동일한지만 한 번만 더 확인해 주세요. 이 컴포넌트 외에 남아 있는 useIsMobile 사용처가 없는지도 전체 PR 차원에서 한 번 훑어보면 좋겠습니다.

Also applies to: 21-21


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.

@seongwon030 seongwon030 added 🔨 Refactor 코드 리팩토링 💻 FE Frontend labels Dec 8, 2025
Copy link
Contributor

@lepitaaar lepitaaar left a comment

Choose a reason for hiding this comment

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

불필요한 코드 삭제 좋습니다 수고하셨어요

@seongwon030 seongwon030 merged commit 1f9562c into develop-fe Dec 17, 2025
3 checks passed
@seongwon030 seongwon030 deleted the refactor/#920-unify-device-detection-MOA-414 branch December 17, 2025 05:12
@seongwon030 seongwon030 linked an issue Dec 17, 2025 that may be closed by this pull request
1 task
@coderabbitai coderabbitai bot mentioned this pull request Dec 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FE Frontend 🔨 Refactor 코드 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[refactor] MOA-414 중복 디바이스 감지 훅 통합

2 participants