Conversation
- WhiskyList 카테고리 서브라벨이 필터값을 표시하던 버그 수정 (getCategoryGroup 사용) - 배럴 파일 import를 직접 모듈 import로 변경 (CLAUDE.md 준수) - CategoryReference.categoryGroup을 optional로 수정 및 타입 단언 제거 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
위스키 카테고리 선택 UX를 2단계(그룹 → 서브카테고리)로 확장하기 위한 기반으로, 카테고리 그룹 상수/매핑 유틸을 추가하고 목록/테스트/목 데이터를 정리한 PR입니다.
Changes:
- 카테고리 그룹 라벨/목록 상수 및
korCategory → categoryGroup매핑 함수(getCategoryGroup) 추가 - 위스키 목록에서 카테고리 옵션을 상수 기반으로 생성하고, 테이블에 카테고리 그룹 서브라벨 표시
CategoryReference.categoryGroup을 optional로 변경하고 관련 mock/test 보강
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/types/api/alcohol.api.ts | 카테고리 그룹 라벨/목록/매핑 유틸 추가 및 CategoryReference.categoryGroup optional 반영 |
| src/test/mocks/data.ts | categoryGroup 없는 실제 API 형태에 맞춘 category reference mock 데이터 추가 |
| src/pages/whisky/WhiskyList.tsx | 카테고리 옵션 생성 로직을 상수 기반으로 중앙화하고 목록에 그룹 서브라벨 표시 |
| src/hooks/tests/useAdminAlcohols.test.ts | useCategoryReferences와 getCategoryGroup에 대한 테스트 케이스 추가 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR 제목 (Title)
위스키 카테고리를 2단계(그룹 → 서브카테고리) 선택 방식으로 개편하여 카테고리 관리 UX 개선
변경 사항 (Changes)
CATEGORY_GROUP_LABELS,getCategoryGroup,GROUP_TO_CATEGORY)WhiskyBasicInfoCard: 단일 카테고리 드롭다운 → 카테고리 그룹 Select + 서브카테고리 조건부 입력 UI로 변경WhiskyList: 카테고리 옵션을 중앙화된 상수에서 생성, 테이블에 카테고리 그룹 서브라벨 표시CategoryReference.categoryGroup을 optional로 수정 (실제 API 응답에 포함되지 않음)useCategoryReferences훅 및getCategoryGroup함수 테스트 추가변경 이유 (Reason for Changes)
기존에는 CategoryReference API 응답의 flat한 카테고리 목록을 그대로 드롭다운에 표시했으나, 카테고리가 많아지면서 메인 그룹(싱글몰트, 버번 등)과 기타 카테고리를 구분할 필요가 생김. 2단계 선택 방식으로 개편하여 메인 그룹은 빠르게 선택하고, 기타 카테고리는 기존 목록에서 선택하거나 자유 입력할 수 있도록 UX를 개선함.
테스트 방법 (Test Procedure)
pnpm test:run— 전체 136개 테스트 통과 확인참고 사항 (Additional Information)
CategoryReferenceAPI가categoryGroup필드를 내려주지 않으므로, 프론트엔드에서getCategoryGroup()함수로korCategory→categoryGroup매핑을 수행CATEGORY_GROUP_LABELS(UI 라벨)와GROUP_TO_CATEGORY(API 값)는 의도적으로 다른 값 사용 (예: 싱글몰트 vs 싱글 몰트)🤖 Generated with Claude Code