Skip to content

Comments

[fix] 모바일 카테고리 버튼 양쪽에 생기는 여백을 제거한다#904

Merged
suhyun113 merged 5 commits intodevelop-fefrom
feature/#890-remove-mobile-category-button-padding-MOA-392
Dec 7, 2025
Merged

[fix] 모바일 카테고리 버튼 양쪽에 생기는 여백을 제거한다#904
suhyun113 merged 5 commits intodevelop-fefrom
feature/#890-remove-mobile-category-button-padding-MOA-392

Conversation

@suhyun113
Copy link
Collaborator

@suhyun113 suhyun113 commented Nov 30, 2025

#️⃣연관된 이슈

ex) #890

📝작업 내용

핵심 변경사항

모바일 카테고리 버튼 양쪽에 생기는 여백 제거

변경 목적
image

모바일 화면에서 스크롤 시 카테고리 버튼 영역이 sticky로 상단에 고정될 때, 양쪽에 불필요한 좌우 여백(20px)이 생기는 문제가 있었습니다.

문제 원인
PageContainer는 페이지 내 모든 콘텐츠를 일정 패딩 안에 배치하기 위한 레이아웃 컨테이너
모바일에서도 이 패딩이 유지되기 때문에, 내부에 위치한 카테고리 버튼 영역도 패딩이 적용된 것입니다.
=> sticky가 적용될 때는 일반 콘텐츠처럼 안쪽으로 들어가지 않아야 자연스럽습니다.

해결
부모 컨테이너를 수정하거나, 카테고리 버튼만 예외를 두는 방식 중 고민했습니다.

  1. 부모 컨테이너(PageContainer)의 패딩을 건드리지 않기
    PageContainer는 공통 레이아웃이기 때문에 패딩을 제거하면 다른 컴포넌트(탭 버튼, 카드리스트 등)에 영향을 줍니다. 따라서 내부 컴포넌트들 각각에 패딩을 줘야하여 번거롭고 부모 패딩을 유지하는 것이 더 안전하다고 판단하였습니다.

  2. 카테고리 버튼 영역만 예외적으로 처리하기
    모바일에서만 PageContainer의 패딩을 제거하기 위해 자식 컴포넌트(CategoryButtonContainer)에서 가로 방향 음수 마진을 적용했습니다. 음수 마진을 지양하고 싶었지만, 모바일에서만 sticky 속성을 적용해야하는 특이한 경우였기 때문에, 음수 마진으로 제거 후, 패딩을 주는 것이 더 이해하기 편하다고 생각했습니다.

image => 부모 레이아웃에도 변동이 없기 때문에 다른 컴포넌트에 영향을 주지 않고, 카테고리 버튼 영역만 독립적으로 처리해주면 되기 때문에 2번 방식으로 진행했습니다.

그 외 수정사항

버튼 크기, 텍스트, 여백 조정
media 유틸 기반 리팩터링

image

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

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

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

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

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

🫡 참고사항

Summary by CodeRabbit

새로운 기능

  • 모바일 및 태블릿을 포함한 다양한 기기에 최적화된 반응형 디자인이 적용되어 향상된 사용자 경험을 제공합니다.

기타

  • 프로덕션 환경 감지 메커니즘이 개선되었습니다.
  • 내부 테스트 표준화 작업이 진행되었습니다.

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

@suhyun113 suhyun113 requested a review from seongje973 November 30, 2025 06:58
@suhyun113 suhyun113 self-assigned this Nov 30, 2025
@suhyun113 suhyun113 added 💻 FE Frontend 🛠Fix 기능이 의도한 대로 동작하지 않는 버그를 수정 labels Nov 30, 2025
@vercel
Copy link

vercel bot commented Nov 30, 2025

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

Project Deployment Preview Comments Updated (UTC)
moadong Ready Ready Preview Comment Nov 30, 2025 6:58am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 30, 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

Walkthrough

카테고리 버튼 스타일의 미디어 쿼리를 중앙화된 헬퍼로 리팩토링하고, 프로덕션 환경 감지 로직을 URL 기반에서 호스트명 배열 기반으로 변경하며, 모집 기간 테스트의 시간대 표기를 명시적 UTC로 업데이트했습니다.

Changes

Cohort / File(s) 변경 요약
반응형 스타일 리팩토링
frontend/src/pages/MainPage/components/CategoryButtonList/CategoryButtonList.styles.ts
하드코딩된 미디어 쿼리를 @/styles/mediaQuery의 중앙화된 미디어 쿼리 헬퍼(${media.mobile}, ${media.mini_mobile}, ${media.tablet})로 대체. 패딩, 마진, 크기, 폰트 크기 등을 다양한 중단점에서 조정
프로덕션 호스트명 검증
frontend/src/utils/initSDK.ts
단일 프로덕션 URL 확인을 PRODUCTION_HOSTNAMES 배열 기반 호스트명 검증으로 변경. isProductionHost 플래그를 사용하여 Mixpanel 비활성화 여부 결정
테스트 시간대 표기 정규화
frontend/src/utils/parseRecruitmentPeriod.test.ts, frontend/src/utils/recruitmentPeriodParser.test.ts
테스트 예상값의 ISO 날짜 문자열에 UTC 표시(Z)를 추가하여 명시적 UTC 타임스탬프로 업데이트 (예: 2024-03-20T14:00:002024-03-20T14:00:00Z)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • CategoryButtonList.styles.ts: 미디어 쿼리 헬퍼로의 일관된 패턴 대체 검토
  • initSDK.ts: 호스트명 배열 구성 및 조건 로직 검증
  • 테스트 파일들: UTC 형식 변경 유효성 확인

Possibly related issues

Possibly related PRs

Suggested labels

✨ Feature

Suggested reviewers

  • seongje973
  • lepitaaar
  • seongwon030
  • oesnuj

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning initSDK.ts와 테스트 파일들의 변경 사항이 모바일 카테고리 버튼 여백 제거라는 linked issue 목표와 직접적인 관련이 없습니다. initSDK.ts의 hostname 검증 로직 변경과 테스트 파일의 UTC 타임스탐프 변경 사항은 별도 이슈로 분리하거나, 해당 변경이 필요한 이유를 문서화해야 합니다.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed 변경 사항이 MOA-392 이슈의 목표인 모바일 카테고리 버튼의 좌우 여백 제거 요구사항을 충족하고 있습니다.
Title check ✅ Passed PR 제목이 변경 사항의 주요 목적과 일치합니다. 모바일 카테고리 버튼의 양쪽 여백 제거라는 핵심 변경 내용을 명확하게 요약합니다.
✨ 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 feature/#890-remove-mobile-category-button-padding-MOA-392

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.

@suhyun113 suhyun113 changed the title [feature] 모바일 카테고리 버튼 양쪽에 생기는 여백을 제거한다 [fix] 모바일 카테고리 버튼 양쪽에 생기는 여백을 제거한다 Nov 30, 2025
Copy link
Contributor

@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 (2)
frontend/src/pages/MainPage/components/CategoryButtonList/CategoryButtonList.styles.ts (2)

10-24: 네거티브 마진 기법으로 PR 목표를 달성했지만, 매직 넘버를 상수로 추출하세요.

부모 컨테이너 패딩을 상쇄하는 네거티브 마진 접근법은 올바르지만, 20px10px 값이 여러 곳에서 반복됩니다. 코딩 가이드라인에 따라 이러한 값을 명명된 상수로 추출하면 유지보수성과 명확성이 향상됩니다.

파일 상단에 상수를 정의하세요:

const PARENT_PADDING_MOBILE = 20;
const PARENT_PADDING_MINI_MOBILE = 10;

그런 다음 스타일에 적용하세요:

   ${media.mobile} {
     background-color: white;
     position: sticky;
     top: 56px;
     z-index: 1;

-    margin: 0px -20px;
-    padding: 6px 20px 12px;
+    margin: 0px -${PARENT_PADDING_MOBILE}px;
+    padding: 6px ${PARENT_PADDING_MOBILE}px 12px;
   }

   ${media.mini_mobile} {
-    margin: -10px -10px;
-    padding: 16px 10px 12px;
+    margin: -${PARENT_PADDING_MINI_MOBILE}px -${PARENT_PADDING_MINI_MOBILE}px;
+    padding: 16px ${PARENT_PADDING_MINI_MOBILE}px 12px;
   }

Based on learnings, 매직 넘버를 명명된 상수로 교체해야 합니다.


67-70: 태블릿 미디어 쿼리에서 중복된 font-size 선언을 제거하세요.

Line 68의 font-size: 14px는 Line 60의 기본값과 동일하여 불필요합니다.

다음과 같이 수정하세요:

   ${media.tablet} {
-    font-size: 14px;
     margin-top: 10px;
   }
📜 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 f7c7411 and 5c0f5d4.

📒 Files selected for processing (4)
  • frontend/src/pages/MainPage/components/CategoryButtonList/CategoryButtonList.styles.ts (4 hunks)
  • frontend/src/utils/initSDK.ts (3 hunks)
  • frontend/src/utils/parseRecruitmentPeriod.test.ts (1 hunks)
  • frontend/src/utils/recruitmentPeriodParser.test.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
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/pages/MainPage/components/CategoryButtonList/CategoryButtonList.styles.ts
  • frontend/src/utils/initSDK.ts
  • frontend/src/utils/parseRecruitmentPeriod.test.ts
  • frontend/src/utils/recruitmentPeriodParser.test.ts
frontend/**/*.{ts,tsx}

📄 CodeRabbit inference engine (frontend/.cursorrules)

Use consistent return types for similar functions/hooks

Files:

  • frontend/src/pages/MainPage/components/CategoryButtonList/CategoryButtonList.styles.ts
  • frontend/src/utils/initSDK.ts
  • frontend/src/utils/parseRecruitmentPeriod.test.ts
  • frontend/src/utils/recruitmentPeriodParser.test.ts
🧠 Learnings (1)
📚 Learning: 2025-11-25T14:08:23.234Z
Learnt from: CR
Repo: Moadong/moadong PR: 0
File: frontend/.cursorrules:0-0
Timestamp: 2025-11-25T14:08:23.234Z
Learning: Applies to frontend/**/*.{ts,tsx,js,jsx} : Replace magic numbers with named constants for clarity

Applied to files:

  • frontend/src/pages/MainPage/components/CategoryButtonList/CategoryButtonList.styles.ts
🧬 Code graph analysis (2)
frontend/src/pages/MainPage/components/CategoryButtonList/CategoryButtonList.styles.ts (1)
frontend/src/styles/mediaQuery.ts (1)
  • media (8-14)
frontend/src/utils/recruitmentPeriodParser.test.ts (1)
frontend/src/utils/recruitmentPeriodParser.ts (1)
  • parseRecruitmentDateString (3-17)
🔇 Additional comments (7)
frontend/src/utils/recruitmentPeriodParser.test.ts (1)

6-6: LGTM! 테스트 기대값이 UTC 타임존을 명시적으로 표현합니다.

ISO 8601 형식의 'Z' 접미사를 추가하여 파서가 UTC로 반환하는 Date 객체와 정확히 일치하도록 테스트 기대값을 개선했습니다.

Also applies to: 12-12

frontend/src/utils/parseRecruitmentPeriod.test.ts (1)

8-9: LGTM! UTC 타임존 표기가 명시적입니다.

다른 테스트 파일과 일관되게 'Z' 접미사를 사용하여 UTC 타임존을 명확히 표현했습니다.

frontend/src/utils/initSDK.ts (2)

15-18: LGTM! 호스트명 기반 프로덕션 감지 로직이 명확합니다.

URL 전체가 아닌 호스트명만 확인하는 방식으로 개선되어 더 명확하고 유지보수가 용이합니다.


5-5: No changes needed. The PRODUCTION_HOSTNAMES constant correctly lists the production domains where Mixpanel should be active. No other subdomains (api, app, admin, etc.) are used in the production environment.

frontend/src/pages/MainPage/components/CategoryButtonList/CategoryButtonList.styles.ts (3)

2-2: LGTM! 중앙화된 미디어 쿼리 헬퍼를 사용합니다.

하드코딩된 미디어 쿼리를 중앙화된 유틸리티로 교체하여 일관성과 유지보수성을 개선했습니다.


36-38: LGTM! 모바일에서 버튼 패딩을 제거합니다.

모바일 화면에서 공간 효율성을 위해 버튼 패딩을 적절히 제거했습니다.


49-56: LGTM! 이미지 크기가 반응형으로 조정됩니다.

화면 크기에 따라 이미지 크기를 점진적으로 줄이는 것은 적절한 반응형 디자인 접근법입니다.

@suhyun113 suhyun113 changed the base branch from main to develop-fe November 30, 2025 12:28
Copy link
Collaborator

@seongje973 seongje973 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!

@suhyun113 suhyun113 merged commit 671d59a into develop-fe Dec 7, 2025
3 checks passed
@suhyun113 suhyun113 deleted the feature/#890-remove-mobile-category-button-padding-MOA-392 branch December 7, 2025 07:36
@coderabbitai coderabbitai bot mentioned this pull request Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FE Frontend 🛠Fix 기능이 의도한 대로 동작하지 않는 버그를 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants