Skip to content

feat: 부위별 항목 분리 UX 개선#17

Merged
changchanghwang merged 5 commits into
mainfrom
codex/part-based-food-items
Feb 15, 2026
Merged

feat: 부위별 항목 분리 UX 개선#17
changchanghwang merged 5 commits into
mainfrom
codex/part-based-food-items

Conversation

@changchanghwang

Copy link
Copy Markdown
Contributor

배경(Why)

현재 구조는 같은 음식 안에서 부위(과육/씨앗)를 상세 진입 후에만 확인할 수 있어, 검색 단계 UX가 불편했습니다.
사용자가 검색 결과에서 바로 부위별 위험도를 인지할 수 있도록 항목을 분리했습니다.

변경사항(What)

  • 데이터 로딩 시 safetyConditions 기반으로 부위별 항목 생성
    • 예: 사과 -> 사과 (과육), 사과 (씨앗)
    • 파생 ID: foodApple__flesh, foodApple__seeds
  • 신규 변환기 추가
    • lib/data/transform/food_part_variant_builder.dart
  • 리포지토리 로드 경로에서 변환 적용
    • lib/data/repositories/asset_food_repository.dart
  • 조건 모델 확장: sourceIndexes(옵션)
    • 부위/조건별로 출처를 세분화해 매핑 가능
    • lib/data/models/safety_condition.dart
  • 상세/응급 UX 보정
    • 선택지가 1개인 경우 자동 고정값으로 계산
    • 불필요한 미완성 경고 제거

테스트 결과

  • flutter analyze 통과
  • flutter test 전체 통과
  • 추가 테스트
    • test/data/food_part_variant_builder_test.dart
    • test/data/asset_food_repository_test.dart

리스크 및 롤백 포인트

  • 리스크: 항목 수 증가로 검색 결과 개수가 늘어날 수 있음
  • 롤백: AssetFoodRepository의 변환 호출 제거 시 기존 단일 항목 구조로 즉시 복귀 가능

PRD 매핑

  • 검색 UX 개선(검색 결과에서 즉시 위험도 인지)
  • 유지보수성/테스트 가능 구조 강화(변환 레이어 + 단위 테스트)

후속 PR 범위

  • JSON 원본 자체를 부위별 물리 분리할지 여부 결정
  • sourceIndexes를 실제 데이터에 단계적으로 반영해 출처 세분화 완성

@vercel

vercel Bot commented Feb 15, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
avium Ready Ready Preview, Comment Feb 15, 2026 10:19am

@changchanghwang
changchanghwang merged commit c833c1f into main Feb 15, 2026
3 checks passed
@changchanghwang
changchanghwang deleted the codex/part-based-food-items branch February 15, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant