Skip to content

fix: 결과 페이지 - 상단 취향 요약 섹션, 하단 투표 결과 선호 카테고리 노출 순서 로직 수정#117

Merged
youngminss merged 6 commits intodevelopfrom
fix/result-page
Feb 25, 2026
Merged

fix: 결과 페이지 - 상단 취향 요약 섹션, 하단 투표 결과 선호 카테고리 노출 순서 로직 수정#117
youngminss merged 6 commits intodevelopfrom
fix/result-page

Conversation

@youngminss
Copy link
Member

@youngminss youngminss commented Feb 25, 2026

🎯 PR 제목

fix: 결과 페이지 - 상단 취향 요약 섹션, 하단 투표 결과 선호 카테고리 노출 순서 로직 수정

📑 작업 상세 내역

  • 버그 수정
    • 결과 페이지 - 투표 결과 선호 카테고리 bar/dot 목록을 투표 수 기준 내림차순으로 정렬합니다 (ANY는 항상 마지막)
    • 결과 페이지 - 취향 조합 요약(subtitle) 로직 및 노출 순서를 수정합니다

🙏 리뷰 요청 사항

  • 동률인 경우 foodCategoryOrder 고정 순서가 tiebreaker로 적용되는 로직을 확인해주세요.
  • ANY 카테고리가 항상 마지막에 위치하는지 검토해주세요.

📃 참고 자료

  • 변경된 파일: src/pageComponents/gathering/opinion/result/VoteSummarySection.tsx

🖼️ 작업 결과물

@youngminss youngminss added the 🐞 Fix 버그 수정 및 이슈 해결 label Feb 25, 2026
@youngminss youngminss self-assigned this Feb 25, 2026
@youngminss youngminss requested a review from RookieAND February 25, 2026 17:23
@github-actions github-actions bot added 🐞 Fix 버그 수정 및 이슈 해결 and removed 🐞 Fix 버그 수정 및 이슈 해결 labels Feb 25, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @youngminss, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 투표 결과 페이지의 사용자 경험을 개선하기 위해 선호 카테고리 및 취향 조합 요약의 표시 로직을 수정합니다. 주요 변경 사항은 카테고리 정렬 기준을 투표 수로 변경하고, 'ANY' 카테고리의 일관된 위치를 보장하며, 선호/불호 요약 텍스트의 논리적 흐름과 시각적 순서를 조정하는 것입니다. 이를 통해 사용자는 투표 결과를 더 직관적이고 정확하게 이해할 수 있습니다.

Highlights

  • 투표 결과 선호 카테고리 정렬 로직 개선: 투표 결과 페이지에서 선호 카테고리 바(bar) 및 점(dot) 목록의 노출 순서를 투표 수 기준 내림차순으로 정렬하도록 수정되었습니다. 'ANY' 카테고리는 항상 마지막에 위치합니다.
  • 취향 조합 요약 로직 및 노출 순서 변경: 투표 결과의 취향 조합 요약(subtitle)을 생성하는 로직이 개선되었으며, 선호/불호 항목의 표시 순서가 변경되었습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/pageComponents/gathering/opinion/result/TasteSummaryCard.tsx
    • 카테고리 정의를 문자열 리터럴에서 CATEGORY enum으로 변경했습니다.
    • computeTasteSummary 함수 내에서 선호 및 불호 카테고리를 처리하는 로직을 리팩토링하여 'ANY' 카테고리 및 충돌 상황을 더 정확하게 반영하도록 했습니다.
    • 선호 및 불호 요약 텍스트의 표시 순서를 선호 항목이 먼저 오도록 변경하고, 관련 아이콘 및 색상을 조정했습니다.
  • src/pageComponents/gathering/opinion/result/VoteSummarySection.tsx
    • 선호 카테고리 프로그레스 바(barCategories)와 점 목록(listCategories)의 정렬 로직을 투표 수 내림차순으로 변경했습니다.
    • 정렬 시 'ANY' 카테고리가 항상 마지막에 오도록 예외 처리를 추가했습니다.
    • 동률인 경우 foodCategoryOrder 고정 순서가 유지되도록 정렬 로직을 적용했습니다.
Activity
  • PR 작성자(youngminss)는 투표 결과의 선호 카테고리 노출 순서 로직 수정에 대한 변경 사항을 제출했습니다.
  • 작성자는 동률인 경우 foodCategoryOrder 고정 순서가 tiebreaker로 적용되는 로직과 ANY 카테고리가 항상 마지막에 위치하는지 검토를 요청했습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@youngminss youngminss changed the title fix: 투표 결과 - 선호 카테고리 노출 순서 로직 수정 fix: 결과 페이지 - 상단 취향 요약 섹션, 하단 투표 결과 선호 카테고리 노출 순서 로직 수정 Feb 25, 2026
@github-actions github-actions bot added 🐞 Fix 버그 수정 및 이슈 해결 and removed 🐞 Fix 버그 수정 및 이슈 해결 labels Feb 25, 2026
@youngminss youngminss merged commit f5c4a1c into develop Feb 25, 2026
13 checks passed
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

이번 PR은 투표 결과 페이지의 선호 카테고리 노출 순서와 취향 요약 로직을 수정하는 것을 목표로 합니다. 전반적으로 코드 가독성과 유지보수성을 향상시키는 좋은 변경입니다. 다만, 중복되는 로직을 통합하고 불필요한 조건을 제거하여 코드를 더 간결하게 만들 수 있는 부분이 있어 몇 가지 개선 사항을 제안합니다.

Comment on lines +73 to +76
} else if (
!isAllAnyPreferences &&
votedPreferencesWithoutAny.length === 1
) {
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

조건문 !isAllAnyPreferences는 중복 확인으로 보입니다. isAllAnyPreferencesvotedPreferencesWithoutAny.length === 0으로 정의되어 있으므로, else if 블록에 도달했다는 것은 이미 votedPreferencesWithoutAny.length가 0이 아니라는 의미를 내포합니다. 따라서 해당 조건을 제거하여 코드를 더 간결하게 만들 수 있습니다.

	} else if (votedPreferencesWithoutAny.length === 1) {

Comment on lines +219 to +239
// progress bar 세그먼트 (투표 수 내림차순, ANY 마지막, 동률은 고정 순서 유지)
const barCategories = foodCategoryOrder
.filter((c) => (preferences[c] ?? 0) >= 1)
.sort((a, b) => {
if (a === CATEGORY.ANY) return 1;
if (b === CATEGORY.ANY) return -1;
return (preferences[b] ?? 0) - (preferences[a] ?? 0);
});
const totalVotes = barCategories.reduce(
(sum, c) => sum + (preferences[c] ?? 0),
0,
);

// 카테고리 dot 목록 (ANY 포함, 순서 유지, count > 0만)
const listCategories = foodCategoryOrder.filter(
(c) => (preferences[c] ?? 0) >= 1,
);
// 카테고리 dot 목록 (투표 수 내림차순, ANY 마지막, 동률은 고정 순서 유지)
const listCategories = foodCategoryOrder
.filter((c) => (preferences[c] ?? 0) >= 1)
.sort((a, b) => {
if (a === CATEGORY.ANY) return 1;
if (b === CATEGORY.ANY) return -1;
return (preferences[b] ?? 0) - (preferences[a] ?? 0);
});
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

barCategorieslistCategories를 생성하는 로직이 동일하게 중복되고 있습니다. 공통 로직을 sortedVotedCategories 변수로 추출하여 중복을 제거하고, 주석을 정리하여 코드 가독성과 유지보수성을 높이는 것이 좋습니다. 이는 스타일 가이드의 DRY(Don't Repeat Yourself) 원칙(493번 라인)에도 부합합니다.

	// progress bar 및 dot 목록에 사용할 카테고리 (투표 수 내림차순, ANY 마지막, 동률은 고정 순서 유지)
	const sortedVotedCategories = foodCategoryOrder
		.filter((c) => (preferences[c] ?? 0) >= 1)
		.sort((a, b) => {
			if (a === CATEGORY.ANY) return 1;
			if (b === CATEGORY.ANY) return -1;
			return (preferences[b] ?? 0) - (preferences[a] ?? 0);
		});
	const barCategories = sortedVotedCategories;
	const totalVotes = barCategories.reduce(
		(sum, c) => sum + (preferences[c] ?? 0),
		0,
	);

	const listCategories = sortedVotedCategories;
References
  1. 스타일 가이드 493번 라인에서는 코드 중복을 피하도록 권장하고 있습니다 (DRY 원칙). (link)

github-actions bot pushed a commit that referenced this pull request Feb 25, 2026
## [2.0.0-beta.6](v2.0.0-beta.5...v2.0.0-beta.6) (2026-02-25)

### Bug Fixes

* 결과 페이지 - 상단 취향 요약 섹션, 하단 투표 결과 선호 카테고리 노출 순서 로직 수정 ([#117](#117)) ([f5c4a1c](f5c4a1c))
github-actions bot pushed a commit that referenced this pull request Feb 27, 2026
## [2.0.0](v1.5.1...v2.0.0) (2026-02-27)

### ⚠ BREAKING CHANGES

* OpinionForm field names changed

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* refactor: update schema field names and exports

- foodCategorySchema → categorySchema
- dislikedFoodSchema → dislikedCategoriesSchema
- preferredMenusSchema → preferredCategoriesSchema
- Update opinionFormSchema with new field names
- Replace hardcoded "ANY" with CATEGORY.ANY
* Schema field names changed

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* refactor: rename component files to use Category naming

- FoodCard → CategoryCard
- FoodCategoryCarousel → CategoryCarousel
- DislikedFoodButton → DislikedCategoryButton

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* refactor: update component export names

- FoodCard → CategoryCard
- FoodCategoryCarousel → CategoryCarousel
- DislikedFoodButton → DislikedCategoryButton
- Update component function names to match new file names
- Internal logic unchanged (will be updated in next PR)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* refactor: update import references to use new constant names

- Update all components to use new constant names:
  * RANKS → RANK_LIST
  * RANK_LABELS → RANK_LABEL
  * FOOD_CATEGORIES → CATEGORY_LIST
  * FOOD_CATEGORY_LABEL → CATEGORY_LABEL
  * FOOD_CATEGORY_VALUES → CATEGORY_VALUES
  * dislikedFoodSchema → dislikedCategoriesSchema
  * preferredMenusSchema → preferredCategoriesSchema

- Update type imports:
  * FoodCategory → Category

- Update form field references:
  * dislikedFoods → dislikedCategories
  * preferredMenus → preferredCategories

- Fix component imports after file renames:
  * FoodCategoryCarousel → CategoryCarousel
  * DislikedFoodButton → DislikedCategoryButton

This ensures the build succeeds after type system changes.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* style: run prettier format

- Format code according to project prettier rules
- No logic changes, only formatting

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

### Features

* 404, 500 에러 페이지 추가 ([#107](#107)) ([e9e5772](e9e5772))
* opinion 랜딩 페이지 UI 업데이트 (로고·lottie·footer) ([#120](#120)) ([2817c50](2817c50))
* SSE Event Registry 시스템 구현 및 마이그레이션 ([#119](#119)) ([178c79c](178c79c))
* SSE 기반 실시간 모임 현황 업데이트 구현 ([#87](#87)) ([0d220e0](0d220e0))
* 결과 페이지 - 투표 결과 섹션 구현 ([#106](#106)) ([c633225](c633225))
* 과반수 이상 의견 제출 시 추천 결과 생성 관련 API, Hook 추가 ([#103](#103)) ([5b31eec](5b31eec)), closes [#105](#105)
* 인원 수 선택 시 시각적 피드백 추가 ([e9f6de6](e9f6de6))
* 추천 결과 API response 타입 업데이트 ([#100](#100)) ([1d046ab](1d046ab)), closes [#101](#101) [#102](#102)
* 추천 결과 생성 대기 페이지 및 애니메이션 구현 ([#118](#118)) ([a720a76](a720a76))
* 취향 요약 카드 추가 ([#104](#104)) ([816fa96](816fa96))

### Bug Fixes

* 1, 3순위를 선택했으나 2순위를 선택하지 않았을 경우 Validation 을 막지 않았던 문제 수정 ([#113](#113)) ([22e58e8](22e58e8))
* GitHub Actions 워크플로우 개선 및 스타일 가이드 업데이트 ([#91](#91)) ([e6c009e](e6c009e))
* 결과 대기 페이지 내 공유 버튼 스타일을 Tertiary 로 수정 ([#115](#115)) ([a63ddd1](a63ddd1))
* 결과 페이지 - 상단 취향 요약 섹션, 하단 투표 결과 선호 카테고리 노출 순서 로직 수정 ([#117](#117)) ([f5c4a1c](f5c4a1c))
* 모임 인원 초과 및 결과 생성 완료 시 Toast 커스텀 기능 추가 ([#116](#116)) ([6088935](6088935))
* 음식 카테고리 일러스트레이터를 Figma 내 최신 시안으로 수정 ([#114](#114)) ([18f9cc3](18f9cc3))

### Code Refactoring

* opinion 페이지 컴포넌트 구조 개선 및 로직 통합 ([#109](#109)) ([a76f75f](a76f75f))
* PeopleIllustration 캐릭터 배치 및 구조 개선 ([#112](#112)) ([ae95b72](ae95b72))
* ProgressBar 컴포넌트 UI 개선 및 코드 최적화 ([#122](#122)) ([c73de1d](c73de1d))
* SSE 이벤트를 recommend-result-created로 변경 ([#121](#121)) ([222e613](222e613))
* 타입 시스템 리팩토링 - enum을 as const 패턴으로 전환 ([#110](#110)) ([d427378](d427378)), closes [#111](#111)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 Fix 버그 수정 및 이슈 해결

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant