Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
워크스루결과 페이지에서 '핫' 상태 속성을 추가하여 카테고리 텍스트 렌더링 로직을 확장했고, 헤더 UI 레이아웃을 조정하여 공유 버튼 위치를 변경했으며, 전송 모달의 경로 단계 계산 로직을 제거하고 전송 경로 세그먼트 렌더링으로 대체했습니다. 변경사항
예상 코드 리뷰 소요 시간🎯 3 (중간 난이도) | ⏱️ ~20분 관련 가능성 있는 PR
제안 검수자
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
components/modal/transferModal.tsx (1)
162-226: 좌측 배지/화살표 열과 우측 역 이름 열의 정렬이 어긋날 수 있습니다.좌측 열(
gap-[10px])에는 배지 + 화살표가 포함되어 항목당 높이가 우측 열(gap-[30px])의 텍스트 항목보다 커집니다. 환승이 많아질수록 좌우 정렬 드리프트가 발생할 수 있습니다.각 "행"을 하나의
flexrow로 묶어 좌측 배지와 우측 역 이름을 같은 컨테이너에 배치하면 정렬 문제를 근본적으로 해결할 수 있습니다. 현재 구조에서는 환승 1~2개 정도에서는 크게 눈에 띄지 않을 수 있지만, 환승이 많아지면 문제가 됩니다.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@components/modal/transferModal.tsx` around lines 162 - 226, The left badges/arrow column and right station-name column are rendered as separate stacked columns causing vertical misalignment when items have different heights; refactor the JSX in transferModal.tsx so each logical row (start station, each transfer, final drop-off) is rendered as a single flex row container that contains the left badge/arrow block and the right station-name block together (i.e., move the startStation, route.transferPath.map and endStation into a single map/sequence that yields <div className="flex items-center ..."> rows), keep existing helpers like getLineBadgeStyle and the train/down Image usages, and ensure consistent item spacing (use items-center and a single gap value) so left and right columns stay aligned.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@app/result/`[id]/page.tsx:
- Around line 142-150: The fallback branch that returns '밍글링 추천 1위' when
!category incorrectly applies to items with rank >= 3; update the logic that
produces the label (the branch checking rank === 1, rank === 2, and else if
(!category)) so the !category case respects rank: either check !category earlier
and compute the label from rank (e.g. return `밍글링 추천 ${rank}위` for rank >= 3) or
change the else if (!category) to include rank checks (e.g. else if (!category
&& rank <= 2) ... else return `밍글링 추천 ${rank}위`), ensuring rank, category and
the exact returned string literals are adjusted accordingly.
- Around line 116-156: The function getCategoryText currently uses a hardcoded
purposeText ('[모임 목적]') instead of the actual category; update getCategoryText
to use the category parameter (with a safe fallback when category is undefined)
for all text construction and for the jongseong check, e.g., compute lastChar
and hasJongseong from category (or from a default like '장소' if category is
missing), then use `${category}${hasJongseong ? '이' : '가'} 많은 장소` and include
that computed purposeTextWithPostfix in the hot/rank branches; ensure you keep
the existing special-case returns (e.g., when rank 1/2 or hot) but replace any
occurrence of the placeholder with the actual category and add a null/empty
guard so undefined category still returns the intended default ('밍글링 추천 1위' or a
sensible phrase).
---
Nitpick comments:
In `@components/modal/transferModal.tsx`:
- Around line 162-226: The left badges/arrow column and right station-name
column are rendered as separate stacked columns causing vertical misalignment
when items have different heights; refactor the JSX in transferModal.tsx so each
logical row (start station, each transfer, final drop-off) is rendered as a
single flex row container that contains the left badge/arrow block and the right
station-name block together (i.e., move the startStation, route.transferPath.map
and endStation into a single map/sequence that yields <div className="flex
items-center ..."> rows), keep existing helpers like getLineBadgeStyle and the
train/down Image usages, and ensure consistent item spacing (use items-center
and a single gap value) so left and right columns stay aligned.
| const getCategoryText = ( | ||
| category: string | undefined, | ||
| hot: boolean | undefined, | ||
| rank: number, | ||
| ): string => { | ||
| const purposeText = '[모임 목적]'; | ||
| const lastChar = purposeText.charCodeAt(purposeText.length - 1); | ||
| const hasJongseong = (lastChar - 0xac00) % 28 !== 0; | ||
| const purposeTextWithPostfix = `${purposeText}${hasJongseong ? '이' : '가'} 많은 장소`; | ||
|
|
||
|
|
||
| if (hot === true && rank === 1) { | ||
| return `밍글링 추천 1위 · ${purposeTextWithPostfix}`; | ||
| } | ||
|
|
||
|
|
||
| else if (hot === true && rank === 2) { | ||
| return `밍글링 추천 2위 · ${purposeTextWithPostfix}`; | ||
| } | ||
|
|
||
|
|
||
| else if (hot === true) { | ||
| return purposeTextWithPostfix; | ||
| } | ||
|
|
||
|
|
||
| else if (rank === 1) { | ||
| return '밍글링 추천 1위'; | ||
| } | ||
|
|
||
| else if (rank === 2) { | ||
| return '밍글링 추천 2위'; | ||
| } | ||
|
|
||
| else if (!category) return '밍글링 추천 1위'; | ||
|
|
||
| // 카테고리 종성에 따라 "이/가"를 다르게 렌더링 | ||
| const lastChar = category.charCodeAt(category.length - 1); | ||
| const hasJongseong = (lastChar - 0xac00) % 28 !== 0; | ||
| return `${category}${hasJongseong ? '이' : '가'} 많은 장소`; | ||
| const categoryLastChar = category.charCodeAt(category.length - 1); | ||
| const categoryHasJongseong = (categoryLastChar - 0xac00) % 28 !== 0; | ||
| return `${category}${categoryHasJongseong ? '이' : '가'} 많은 장소`; | ||
| }; |
There was a problem hiding this comment.
purposeText에 실제 카테고리 값 대신 리터럴 플레이스홀더 '[모임 목적]'이 하드코딩되어 있습니다.
PR 명세에서 [모임 목적]은 실제 모임 목적(예: "카페", "술집")으로 치환되어야 할 플레이스홀더입니다. 현재 코드는 이 문자열을 그대로 UI에 노출하므로, 사용자에게 "[모임 목적]이 많은 장소"라는 의미 없는 텍스트가 표시됩니다.
category 파라미터를 활용하여 실제 카테고리 값으로 텍스트를 생성해야 합니다. 또한 '[모임 목적]'의 마지막 문자가 ']'(비한글)이므로 종성 판별 로직도 의도와 다른 결과를 산출합니다.
🐛 수정 제안: category 파라미터를 활용한 수정
const getCategoryText = (
category: string | undefined,
hot: boolean | undefined,
rank: number,
): string => {
- const purposeText = '[모임 목적]';
- const lastChar = purposeText.charCodeAt(purposeText.length - 1);
- const hasJongseong = (lastChar - 0xac00) % 28 !== 0;
- const purposeTextWithPostfix = `${purposeText}${hasJongseong ? '이' : '가'} 많은 장소`;
+ const getPurposeTextWithPostfix = (text: string) => {
+ const lastChar = text.charCodeAt(text.length - 1);
+ const hasJongseong = (lastChar - 0xac00) % 28 !== 0;
+ return `${text}${hasJongseong ? '이' : '가'} 많은 장소`;
+ };
+
+ const purposeTextWithPostfix = category
+ ? getPurposeTextWithPostfix(category)
+ : '인기 많은 장소';
if (hot === true && rank === 1) {
return `밍글링 추천 1위 · ${purposeTextWithPostfix}`;
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const getCategoryText = ( | |
| category: string | undefined, | |
| hot: boolean | undefined, | |
| rank: number, | |
| ): string => { | |
| const purposeText = '[모임 목적]'; | |
| const lastChar = purposeText.charCodeAt(purposeText.length - 1); | |
| const hasJongseong = (lastChar - 0xac00) % 28 !== 0; | |
| const purposeTextWithPostfix = `${purposeText}${hasJongseong ? '이' : '가'} 많은 장소`; | |
| if (hot === true && rank === 1) { | |
| return `밍글링 추천 1위 · ${purposeTextWithPostfix}`; | |
| } | |
| else if (hot === true && rank === 2) { | |
| return `밍글링 추천 2위 · ${purposeTextWithPostfix}`; | |
| } | |
| else if (hot === true) { | |
| return purposeTextWithPostfix; | |
| } | |
| else if (rank === 1) { | |
| return '밍글링 추천 1위'; | |
| } | |
| else if (rank === 2) { | |
| return '밍글링 추천 2위'; | |
| } | |
| else if (!category) return '밍글링 추천 1위'; | |
| // 카테고리 종성에 따라 "이/가"를 다르게 렌더링 | |
| const lastChar = category.charCodeAt(category.length - 1); | |
| const hasJongseong = (lastChar - 0xac00) % 28 !== 0; | |
| return `${category}${hasJongseong ? '이' : '가'} 많은 장소`; | |
| const categoryLastChar = category.charCodeAt(category.length - 1); | |
| const categoryHasJongseong = (categoryLastChar - 0xac00) % 28 !== 0; | |
| return `${category}${categoryHasJongseong ? '이' : '가'} 많은 장소`; | |
| }; | |
| const getCategoryText = ( | |
| category: string | undefined, | |
| hot: boolean | undefined, | |
| rank: number, | |
| ): string => { | |
| const getPurposeTextWithPostfix = (text: string) => { | |
| const lastChar = text.charCodeAt(text.length - 1); | |
| const hasJongseong = (lastChar - 0xac00) % 28 !== 0; | |
| return `${text}${hasJongseong ? '이' : '가'} 많은 장소`; | |
| }; | |
| const purposeTextWithPostfix = category | |
| ? getPurposeTextWithPostfix(category) | |
| : '인기 많은 장소'; | |
| if (hot === true && rank === 1) { | |
| return `밍글링 추천 1위 · ${purposeTextWithPostfix}`; | |
| } | |
| else if (hot === true && rank === 2) { | |
| return `밍글링 추천 2위 · ${purposeTextWithPostfix}`; | |
| } | |
| else if (hot === true) { | |
| return purposeTextWithPostfix; | |
| } | |
| else if (rank === 1) { | |
| return '밍글링 추천 1위'; | |
| } | |
| else if (rank === 2) { | |
| return '밍글링 추천 2위'; | |
| } | |
| else if (!category) return '밍글링 추천 1위'; | |
| // 카테고리 종성에 따라 "이/가"를 다르게 렌더링 | |
| const categoryLastChar = category.charCodeAt(category.length - 1); | |
| const categoryHasJongseong = (categoryLastChar - 0xac00) % 28 !== 0; | |
| return `${category}${categoryHasJongseong ? '이' : '가'} 많은 장소`; | |
| }; |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@app/result/`[id]/page.tsx around lines 116 - 156, The function
getCategoryText currently uses a hardcoded purposeText ('[모임 목적]') instead of
the actual category; update getCategoryText to use the category parameter (with
a safe fallback when category is undefined) for all text construction and for
the jongseong check, e.g., compute lastChar and hasJongseong from category (or
from a default like '장소' if category is missing), then use
`${category}${hasJongseong ? '이' : '가'} 많은 장소` and include that computed
purposeTextWithPostfix in the hot/rank branches; ensure you keep the existing
special-case returns (e.g., when rank 1/2 or hot) but replace any occurrence of
the placeholder with the actual category and add a null/empty guard so undefined
category still returns the intended default ('밍글링 추천 1위' or a sensible phrase).
| else if (rank === 1) { | ||
| return '밍글링 추천 1위'; | ||
| } | ||
|
|
||
| else if (rank === 2) { | ||
| return '밍글링 추천 2위'; | ||
| } | ||
|
|
||
| else if (!category) return '밍글링 추천 1위'; |
There was a problem hiding this comment.
rank >= 3이고 category가 없는 경우 '밍글링 추천 1위'로 폴백됩니다.
hot이 false이고 rank가 3 이상일 때, category도 없으면 Line 150의 else if (!category) 분기에 도달하여 '밍글링 추천 1위'를 반환합니다. Top3 결과에서 3번째 항목에 "1위" 라벨이 표시될 수 있습니다.
기존 코드에서도 동일한 동작이었으나, 이번에 rank 기반 로직을 추가했으므로 함께 수정하는 것이 좋겠습니다.
🛡️ 수정 제안
else if (rank === 2) {
return '밍글링 추천 2위';
}
- else if (!category) return '밍글링 추천 1위';
+ else if (!category) return `밍글링 추천 ${rank}위`;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| else if (rank === 1) { | |
| return '밍글링 추천 1위'; | |
| } | |
| else if (rank === 2) { | |
| return '밍글링 추천 2위'; | |
| } | |
| else if (!category) return '밍글링 추천 1위'; | |
| else if (rank === 1) { | |
| return '밍글링 추천 1위'; | |
| } | |
| else if (rank === 2) { | |
| return '밍글링 추천 2위'; | |
| } | |
| else if (!category) return `밍글링 추천 ${rank}위`; |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@app/result/`[id]/page.tsx around lines 142 - 150, The fallback branch that
returns '밍글링 추천 1위' when !category incorrectly applies to items with rank >= 3;
update the logic that produces the label (the branch checking rank === 1, rank
=== 2, and else if (!category)) so the !category case respects rank: either
check !category earlier and compute the label from rank (e.g. return `밍글링 추천
${rank}위` for rank >= 3) or change the else if (!category) to include rank
checks (e.g. else if (!category && rank <= 2) ... else return `밍글링 추천
${rank}위`), ensuring rank, category and the exact returned string literals are
adjusted accordingly.
🚀 중간모임 카테고리 & 환승경로 수정
📝 변경사항
hot === true인 장소에 "[모임 목적]이 많은 장소" 표시hot === true이면서 1순위: "밍글링 추천 1위 · [모임목적]이 많은 장소"hot === true이면서 2순위: "밍글링 추천 2위 · [모임목적]이 많은 장소"환승 경로 모달 UI 개선
startStation)과 환승역(transferPath의station) 값으로 경로 표시✅ 체크리스트
📸 스크린샷
💬 리뷰어 전달사항
Summary by CodeRabbit
릴리스 노트
새로운 기능
UI/UX 개선