Skip to content

Conversation

@keemsebin
Copy link
Member

@keemsebin keemsebin commented Nov 28, 2024

관련 이슈

close #76

📑 작업 내용

  • tailwind config에 xs 값 추가하고, Typograpty에도 xs에 따른 fontSize 추가했습니다.
  • font weight 값 제거 했습니다.
  • framer-motion에 어색한 부분이 있어 수정하였습니다.

💬 리뷰 중점 사항/기타 참고 사항

  • 추후 실제 모바일 환경 체크하며 세부 조정해야될 것 같습니다!

Summary by CodeRabbit

  • 새로운 기능

    • 입력 요소의 높이를 조정하여 사용자 경험을 개선했습니다.
    • 타이포그래피 업데이트로 제목과 주소 표시 방식을 개선했습니다.
    • 북마크 리스트와 검색 결과 리스트의 텍스트 렌더링을 간소화했습니다.
    • Tailwind CSS에 새로운 화면 크기 설정을 추가하여 반응형 디자인을 향상시켰습니다.
  • 버그 수정

    • 버튼 클릭 시 올바른 함수가 호출되도록 수정했습니다.
    • 로그인 후 리디렉션 URL을 업데이트했습니다.
  • 스타일

    • 여러 컴포넌트의 마진 및 스타일 클래스를 조정하여 일관성을 높였습니다.
  • 기타

    • 애니메이션 상수의 매개변수를 조정하여 시각적 효과를 개선했습니다.

@keemsebin keemsebin added the feat 기능 label Nov 28, 2024
@keemsebin keemsebin self-assigned this Nov 28, 2024
@keemsebin keemsebin requested a review from houony as a code owner November 28, 2024 16:02
@coderabbitai
Copy link

coderabbitai bot commented Nov 28, 2024

Walkthrough

이 풀 리퀘스트는 여러 컴포넌트의 스타일과 기능을 수정합니다. Input 컴포넌트의 높이를 조정하고, PlaceItem 컴포넌트의 타이포그래피를 변경하며, BookmarkListSearchResultsList 컴포넌트에서 불필요한 props를 제거합니다. 또한, 애니메이션 상수와 MapView 컴포넌트의 데이터 처리 로직을 수정하고, Tailwind CSS 설정에 새로운 화면 크기 구성을 추가합니다.

Changes

파일 경로 변경 요약
src/components/common/Input/index.tsx Input 컴포넌트의 높이를 h-11에서 h-12로 변경.
src/components/common/PlaceItem/index.tsx Typography 모듈에서 Body1, Body4Body2, Body3로 변경.
src/components/common/Typography/index.tsx variantClasses의 공백 처리 변경 및 Body 변형 클래스의 반응형 설정 추가.
src/components/features/BookmarkList/BookmarkList.tsx Body1, Body2에서 weight prop 제거.
src/components/features/LinkForm/ExtractionStatus.tsx my-36 클래스를 my-28로 변경 및 중첩된 Body1 태그 제거.
src/components/features/LinkForm/Landing.tsx ButtononClick 핸들러를 수정하여 onNext를 호출하도록 변경.
src/components/features/LoginModal/Login.tsx 인증 후 리디렉션 URL을 ${ENV.API_BASE_URL}api/oauth/${auth}로 변경.
src/components/features/SearchResultsList/BookmarkSelectionList.tsx Body1에서 weight prop 제거.
src/components/features/SearchResultsList/SearchResultsList.tsx Body1weight prop 제거 및 마진 스타일 변경.
src/constants/motions.ts 애니메이션 상수의 FIDIES_ANIMATION, THUMBNAIL_ANIMATION, SLIDER_ANIMATION 수정.
src/pages/MapView.tsx handleDataUpdate 함수의 매개변수 타입을 `ExtractResponse
tailwind.config.ts Tailwind CSS 설정에 xs: '450px' 추가.

Assessment against linked issues

Objective Addressed Explanation
모바일 반응형 tailwind breakpoint 설정 (#76)

Possibly related PRs

Suggested reviewers

  • houony

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between b457a73 and 4c83560.

📒 Files selected for processing (1)
  • src/components/common/Typography/index.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/common/Typography/index.tsx

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link

github-actions bot commented Nov 28, 2024

Update: 2024년 11월 29일 01시 22분 58초
Storybook 미리보기: https://6709628f8a6eec04b29d4f39-zciitpvxmu.chromatic.com/

Copy link

@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: 5

🧹 Outside diff range and nitpick comments (9)
tailwind.config.ts (1)

Line range hint 1-38: 테마 설정 구조 개선 제안

현재 설정은 기본적인 반응형 지원을 위한 좋은 시작점입니다만, 더 체계적인 모바일 지원을 위해 다음 사항들을 고려해보시면 좋을 것 같습니다:

  1. 브레이크포인트 시스템 전체 재정립
  2. 모바일에 특화된 타이포그래피 스케일 추가
  3. 터치 타겟 사이즈를 고려한 간격 시스템 추가

모바일 환경에 최적화된 테마 설정이 필요하시다면 제가 도움을 드릴 수 있습니다. 새로운 이슈를 생성해드릴까요?

src/constants/motions.ts (1)

25-31: 모바일 성능 최적화 필요

애니메이션 지속 시간이 1초에서 2초로 증가하고, repeatType이 'mirror'에서 'loop'로 변경되었습니다. 이는 모바일 기기의 배터리 소모와 성능에 영향을 줄 수 있습니다.

제안사항:

  1. 모바일에서는 애니메이션 지속 시간을 줄이거나
  2. 저전력 모드에서는 애니메이션을 비활성화하는 옵션을 제공하거나
  3. will-change 속성을 사용하여 성능을 최적화하는 것을 고려해보세요.
export const THUMBNAIL_ANIMATION = {
  initial: { y: 0 },
  animate: {
-   y: [0, -13, 0, 13, 0],
+   y: [0, window.innerWidth <= 640 ? -8 : -13, 0, window.innerWidth <= 640 ? 8 : 13, 0],
  },
  transition: {
-   duration: 2,
+   duration: window.innerWidth <= 640 ? 1.5 : 2,
    repeat: Infinity,
    repeatType: 'loop' as const,
    ease: 'linear',
  },
};
src/components/common/Input/index.tsx (1)

Line range hint 24-30: 리셋 버튼 터치 영역 개선 필요

모바일 환경에서 리셋 버튼의 터치 영역이 너무 작습니다. 아이콘 주변에 충분한 터치 영역을 확보하는 것이 좋습니다.

다음과 같이 수정하는 것을 제안합니다:

-              className="absolute right-3 top-1/2 transform -translate-y-1/2 cursor-pointer"
+              className="absolute right-3 top-1/2 transform -translate-y-1/2 cursor-pointer p-2 -m-2"
src/components/features/LoginModal/Login.tsx (1)

Line range hint 16-30: 모바일 화면에서의 UI 개선 제안

모바일 환경에서의 사용성 향상을 위해 다음 사항들을 고려해보시기 바랍니다:

  1. 작은 화면에서의 아이콘 크기 조정이 필요해 보입니다.
  2. 요소들 간의 간격이 모바일 화면에서는 너무 클 수 있습니다.

다음과 같은 변경을 제안드립니다:

- <div className="flex flex-col gap-6 items-center ">
+ <div className="flex flex-col gap-6 xs:gap-4 items-center">

- <div className="flex flex-row gap-6 items-center mb-1.5">
+ <div className="flex flex-row gap-6 xs:gap-4 items-center mb-1.5">

- size={60}
+ className="w-[60px] xs:w-[48px] h-[60px] xs:h-[48px]"
src/components/common/PlaceItem/index.tsx (2)

24-26: 주소 표시 레이아웃 개선을 제안드립니다.

모바일 환경에서 긴 주소가 있을 경우를 대비하여 다음과 같은 개선을 고려해보시는 것은 어떨까요?

- <Body3 className="pt-1" weight="normal">
+ <Body3 className="pt-1 break-words" weight="normal">

또한 주소 텍스트가 너무 길 경우를 대비하여 다음과 같은 최대 길이 제한도 고려해보시면 좋을 것 같습니다:

- <Body3 className="pt-1" weight="normal">
+ <Body3 className="pt-1 max-w-[200px] truncate sm:max-w-full" weight="normal">

Line range hint 13-17: 모바일 터치 영역 개선이 필요해 보입니다.

모바일 환경에서의 사용성 향상을 위해 터치 영역을 좀 더 넓히는 것이 좋을 것 같습니다.

- className={`flex flex-row justify-between items-center cursor-pointer ${!isLast && 'pb-2'}`}
+ className={`flex flex-row justify-between items-center cursor-pointer min-h-[48px] ${!isLast && 'pb-2'}`}
src/components/features/LinkForm/ExtractionStatus.tsx (1)

51-51: alt 텍스트 접근성 개선이 필요합니다.

스크린 리더 사용자를 위해 alt 텍스트를 더 의미있게 작성하는 것이 좋습니다.

다음과 같이 수정하는 것을 제안합니다:

-<img src={thumbnailUrl} alt="YouTubeThumbnail" className="w-full h-full rounded-md" />
+<img src={thumbnailUrl} alt="유튜브 영상 썸네일" className="w-full h-full rounded-md" />
src/pages/MapView.tsx (2)

Line range hint 89-108: 모바일 반응형 UI 개선이 필요합니다.

PR의 주요 목적인 모바일 반응형과 관련하여, 사이드 메뉴 버튼들의 위치와 크기가 모바일 화면에서 최적화되어 있지 않습니다.

다음과 같은 개선사항을 제안합니다:

-<div className="absolute bottom-10 right-4 flex flex-col gap-2 justify-center items-center">
+<div className="absolute bottom-10 right-4 flex flex-col gap-2 justify-center items-center xs:bottom-16 xs:right-2">
   <SideMenu.Group>
-    <SideMenu position="right" variant="gps" onClick={() => handleCurrentLocation()} />
+    <SideMenu 
+      position="right" 
+      variant="gps" 
+      onClick={() => handleCurrentLocation()} 
+      className="xs:scale-90"
+    />
     // 나머지 SideMenu 컴포넌트들에도 동일하게 적용
   </SideMenu.Group>
 </div>

Line range hint 82-87: 검색 입력창의 모바일 최적화가 필요합니다.

상단 검색 입력창의 반응형 디자인이 모바일 화면에서 최적화되어 있지 않습니다.

다음과 같이 개선하는 것을 제안합니다:

-<div className="absolute top-4 left-1/2 -translate-x-1/2 z-10 w-full max-w-md px-2">
+<div className="absolute top-4 left-1/2 -translate-x-1/2 z-10 w-full max-w-md px-2 xs:top-2 xs:px-4">
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 0613a32 and b457a73.

📒 Files selected for processing (12)
  • src/components/common/Input/index.tsx (1 hunks)
  • src/components/common/PlaceItem/index.tsx (2 hunks)
  • src/components/common/Typography/index.tsx (2 hunks)
  • src/components/features/BookmarkList/BookmarkList.tsx (1 hunks)
  • src/components/features/LinkForm/ExtractionStatus.tsx (2 hunks)
  • src/components/features/LinkForm/Landing.tsx (1 hunks)
  • src/components/features/LoginModal/Login.tsx (1 hunks)
  • src/components/features/SearchResultsList/BookmarkSelectionList.tsx (1 hunks)
  • src/components/features/SearchResultsList/SearchResultsList.tsx (1 hunks)
  • src/constants/motions.ts (2 hunks)
  • src/pages/MapView.tsx (2 hunks)
  • tailwind.config.ts (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • src/components/features/BookmarkList/BookmarkList.tsx
  • src/components/features/SearchResultsList/BookmarkSelectionList.tsx
🔇 Additional comments (14)
tailwind.config.ts (1)

31-33: 🛠️ Refactor suggestion

모바일 브레이크포인트 값 검토 필요

xs 브레이크포인트를 450px로 설정하는 것은 일반적인 모바일 기기의 뷰포트 크기를 고려할 때 문제가 될 수 있습니다. iPhone SE(320px)나 iPhone 12/13(375px)와 같은 작은 화면의 모바일 기기에서 스타일이 제대로 적용되지 않을 수 있습니다.

다음과 같이 수정하는 것을 추천드립니다:

screens: {
-  xs: '450px',
+  xs: '375px',
}
src/components/features/LinkForm/Landing.tsx (1)

Line range hint 1-30: 모바일 레이아웃 검증 필요

현재 구현된 레이아웃이 모바일 환경에서 적절하게 동작하는지 확인이 필요합니다:

  • 하단 버튼의 position: absolute 사용이 모바일에서 문제가 없는지
  • max-w-[30rem]이 모바일 화면에서 적절한지
  • my-32 마진이 작은 화면에서도 적절한지

모바일 화면에서의 레이아웃을 검증하기 위해 Tailwind 설정을 확인합니다:

✅ Verification successful

Let me check if there are any similar components or patterns in the codebase that might help us verify the mobile layout implementation.


Let me check the Layout component and screen configurations one more time to ensure we have a complete picture.


모바일 레이아웃 구현이 적절하게 되어있음을 확인했습니다

현재 구현된 레이아웃은 다음과 같은 이유로 모바일 환경에서 안전합니다:

  • Layout 컴포넌트가 max-w-[30rem]으로 전체 앱의 최대 너비를 제한하고 있어, 하위 컴포넌트들의 동일한 max-w-[30rem] 설정과 일관성이 있습니다.
  • absolute bottom-3 패턴이 BottomSheet, LinkInput 등 여러 컴포넌트에서 일관되게 사용되고 있어 검증된 패턴입니다.
  • my-32 마진은 Layout 컴포넌트의 h-dvh(동적 뷰포트 높이)와 함께 사용되어 화면 크기에 따라 적절히 조정됩니다.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify Tailwind configuration for mobile breakpoints
fd -e js -e ts "tailwind.config" -x cat {} \;

Length of output: 785


Script:

#!/bin/bash
# Search for similar absolute positioning patterns in other components
rg "absolute bottom-" -A 2 -B 2

# Search for components with max-w references
rg "max-w-\[" -A 2 -B 2

# Search for my-32 usage in other components
rg "my-32" -A 2 -B 2

Length of output: 4960


Script:

#!/bin/bash
# Check Layout component implementation
cat src/components/common/Layout/index.tsx

# Check if there are any mobile-specific styles or media queries
rg "@media.*max-width" -A 2 -B 2

Length of output: 324

src/constants/motions.ts (1)

10-16: 🛠️ Refactor suggestion

애니메이션 크기가 모바일 화면에 적합한지 검토 필요

모바일 환경에서 scale 값이 1.1로 증가하고 y 이동이 -15px로 커진 것은 작은 화면에서 과도한 움직임을 유발할 수 있습니다. 모바일에서는 더 섬세한 애니메이션이 권장됩니다.

다음과 같이 화면 크기에 따라 애니메이션 크기를 조절하는 것을 고려해보세요:

export const FIDIES_ANIMATION = {
  initial: { opacity: 1, scale: 1, rotate: 0, y: 0 },
  animate: {
-   scale: [1, 0.95, 1.1, 1],
+   scale: [1, 0.95, window.innerWidth <= 640 ? 1.05 : 1.1, 1],
    rotate: [0, 5, -5, 0],
-   y: [0, -15, -15, 0],
+   y: [0, window.innerWidth <= 640 ? -10 : -15, window.innerWidth <= 640 ? -10 : -15, 0],
  },
src/components/common/Input/index.tsx (2)

19-19: 터치 영역 크기 검토 필요

모바일 환경에서의 사용성을 고려할 때, 입력 필드의 높이가 적절한지 확인이 필요합니다. iOS Human Interface Guidelines에서는 최소 44px의 터치 영역을 권장하고 있습니다.

다음과 같이 변경하는 것을 고려해보세요:

-            className="w-full h-12 text-body3 bg-gray-100 pl-5 pr-10 rounded-lg outline-none focus:outline-1 focus:outline-offset-0 focus:outline-gray-400 transition-colors"
+            className="w-full min-h-[48px] text-body3 bg-gray-100 pl-5 pr-10 rounded-lg outline-none focus:outline-1 focus:outline-offset-0 focus:outline-gray-400 transition-colors"

Line range hint 33-37: 에러 메시지 반응형 처리 확인

모바일 화면에서 에러 메시지의 가독성을 확인해주세요. Caption 컴포넌트가 작은 화면에서도 잘 보이는지 검증이 필요합니다.

src/components/features/LoginModal/Login.tsx (1)

11-11: ⚠️ Potential issue

API 엔드포인트 변경 검증 필요

인증 엔드포인트가 변경되었습니다. 이는 모바일 반응형 작업과는 별개의 변경사항으로 보입니다.

  1. 백엔드 팀과 이 엔드포인트 변경이 의도된 것인지 확인해주세요.
  2. 이전 엔드포인트(oauth2/authorization)가 더 이상 사용되지 않는지 확인이 필요합니다.
src/components/common/PlaceItem/index.tsx (2)

7-7: Typography 컴포넌트 변경이 적절해 보입니다.

Body2와 Body3로의 변경은 모바일 환경에서 더 나은 가독성을 제공할 것으로 보입니다.


19-19: 제목의 타이포그래피 스타일이 적절합니다.

Body2 컴포넌트를 사용하여 제목을 표시하는 것이 모바일 환경에서 적절한 크기를 제공할 것으로 보입니다.

src/components/features/SearchResultsList/SearchResultsList.tsx (2)

39-39: 마진 조정이 모바일 화면에 적절한지 확인 필요

마진 값이 my-3에서 mt-2로 변경되어 수직 간격이 줄어들었습니다. 모바일 화면에서 터치 영역이 충분한지 확인해주세요.

✅ Verification successful

마진 조정이 일관성 있게 적용되어 있음을 확인

검색 결과와 북마크 리스트 컴포넌트에서 mt-2 mx-3 마진이 동일하게 적용되어 있어 일관성이 유지되고 있습니다. 다른 Body1 컴포넌트들의 마진 값도 각각의 용도에 맞게 적절히 설정되어 있습니다:

  • 모달 내 텍스트: text-center mt-4
  • 리스트 헤더: my-4 mx-3

모바일 화면에서의 터치 영역도 충분할 것으로 판단됩니다.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: 다른 Body1 컴포넌트의 마진 설정을 확인

# Body1 컴포넌트의 마진 클래스 사용 패턴 검색
rg -t tsx -t jsx "Body1.*className.*m[tbrly]" 

Length of output: 75


Script:

#!/bin/bash
# Search for Body1 component usage with margin classes, considering file extensions
rg "Body1.*className.*m[tbrly]" --type-add 'tsx:*.tsx' --type-add 'jsx:*.jsx' -t tsx -t jsx

# Also search for any Body1 component usage to understand the broader context
rg "Body1.*className" --type-add 'tsx:*.tsx' --type-add 'jsx:*.jsx' -t tsx -t jsx

Length of output: 2006


39-39: Typography 스타일 일관성 검증 필요

AI 요약에 따르면 weight 속성이 제거되었습니다. 전체 애플리케이션에서 Typography 스타일의 일관성을 확인해주세요.

✅ Verification successful

Typography 스타일 일관성 검증 완료

Typography 컴포넌트의 구현과 사용 패턴을 분석한 결과, weight 속성 제거는 문제가 되지 않습니다. 그 이유는:

  • Typography 컴포넌트는 기본적으로 'medium' weight를 사용하도록 설정되어 있습니다.
  • 검색 결과 텍스트의 경우 특별한 강조가 필요하지 않은 일반적인 텍스트이므로, 기본 weight 값을 사용하는 것이 적절합니다.
  • 다른 Body1 사용 사례들을 보면, weight 속성은 특별히 강조가 필요한 경우에만 명시적으로 지정되고 있습니다.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Typography 컴포넌트 사용 패턴 분석

# Body1 컴포넌트의 weight 속성 사용 검색
ast-grep --pattern 'Body1 weight=$_'

# 다른 Typography 컴포넌트의 스타일 패턴 검색
rg -t tsx -t jsx "<(Body1|Body2|Heading)[^>]*>"

Length of output: 116


Script:

#!/bin/bash
# Typography 컴포넌트 사용 패턴 분석 (수정된 버전)

# Body1 컴포넌트 사용 검색
rg "<Body1" --type ts --type tsx --type jsx -A 1

# 전체 Typography 컴포넌트 스타일 패턴 검색
rg "<(Body1|Body2|Heading)" --type ts --type tsx --type jsx -A 1

Length of output: 173


Script:

#!/bin/bash
# Typography 컴포넌트 사용 패턴 분석 (파일 확장자 수정)

# 먼저 TypeScript/React 파일들 찾기
fd "\.(tsx|jsx|ts)$" 

# Body1 컴포넌트 사용 검색
rg -t typescript -t javascriptreact -t typescriptreact "<Body1" -A 1

# 전체 Typography 컴포넌트 스타일 패턴 검색
rg -t typescript -t javascriptreact -t typescriptreact "<(Body1|Body2|Heading)" -A 1

Length of output: 5935


Script:

#!/bin/bash
# Typography 컴포넌트 사용 패턴 분석 (grep 사용)

# Body1 컴포넌트 사용 검색
find . -type f \( -name "*.tsx" -o -name "*.jsx" \) -exec grep -A 1 "<Body1" {} \;

# Typography 컴포넌트 정의 확인
cat src/components/common/Typography/Typography.types.ts

# Typography 인덱스 파일 확인
cat src/components/common/Typography/index.tsx

Length of output: 3573

src/components/common/Typography/index.tsx (2)

13-16: 반응형 타이포그래피 구현이 적절합니다

모바일 환경을 위한 xs 브레이크포인트 추가와 함께 Body1-3의 텍스트 크기를 조정한 것이 적절해 보입니다. 시각적 계층 구조가 잘 유지되었습니다.


7-7: whitespace 속성 변경이 기존 텍스트 레이아웃에 미치는 영향 확인 필요

whitespace-pre-wrap에서 whitespace-pre-line으로의 변경은 텍스트 줄바꿈 동작을 수정합니다. 이는 모바일 환경에서 더 나은 텍스트 표시를 위한 것으로 보이나, 기존 텍스트 레이아웃에 영향을 미칠 수 있습니다.

✅ Verification successful

whitespace 속성 변경은 안전하게 적용 가능합니다

코드베이스 검사 결과, Typography 컴포넌트에서 여러 줄 텍스트나 연속된 공백을 사용하는 사례가 발견되지 않았습니다. whitespace-pre-wrap에서 whitespace-pre-line으로의 변경은 현재 구현된 사용 패턴에 영향을 미치지 않을 것으로 판단됩니다.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: 기존 텍스트 컴포넌트에서 여러 줄 텍스트나 공백이 있는 사례 검색

# 여러 줄 문자열이나 공백이 포함된 텍스트 검색
rg -l "(\n|\s{2,})" --type tsx --type jsx

Length of output: 235


Script:

#!/bin/bash
# Description: 기존 텍스트 컴포넌트에서 여러 줄 텍스트나 공백이 있는 사례 검색

# Typography 컴포넌트를 사용하는 파일 검색
rg -U "Typography.*>.*(\n.*){2,}.*</Typography" --type tsx --type jsx

# Typography 컴포넌트를 사용하는 파일에서 연속된 공백이 있는 경우 검색
rg -U "Typography.*>.*\s{2,}.*</Typography" --type tsx --type jsx

# Typography 컴포넌트 사용 패턴 전반적 확인
rg "<Typography" -A 2 --type tsx --type jsx

Length of output: 269


Script:

#!/bin/bash
# Description: Typography 컴포넌트 사용 패턴 검색 (파일 확장자 수정)

# Typography 컴포넌트를 사용하는 파일 검색
rg -U "Typography.*>.*\n.*\n.*</Typography"

# Typography 컴포넌트를 사용하는 파일에서 연속된 공백이 있는 경우 검색
rg -U "Typography.*>.*\s{2,}.*</Typography"

# Typography 컴포넌트 사용 패턴 전반적 확인
rg "<Typography" -A 2

Length of output: 300

src/components/features/LinkForm/ExtractionStatus.tsx (2)

36-36: 모바일 반응형 마진 설정이 적절해 보입니다.

xs 브레이크포인트에서의 마진 조정이 모바일 환경에 맞게 잘 구현되었습니다.


38-42: 상태 메시지가 명확하게 작성되었습니다.

각 상태(로딩, 성공, 실패)에 대한 메시지가 사용자 친화적으로 잘 작성되었습니다.

</div>
<div className="absolute bottom-3 w-full max-w-[30rem] px-4 mb-5">
<Button variant="primary" size="large" onClick={() => onNext} className="w-full">
<Button variant="primary" size="large" onClick={() => onNext()} className="w-full">
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

onClick 핸들러 최적화 필요

불필요한 화살표 함수 래퍼를 제거하여 성능을 개선할 수 있습니다. 매개변수가 필요하지 않으므로 함수 참조를 직접 전달하는 것이 좋습니다.

다음과 같이 수정하는 것을 추천드립니다:

-<Button variant="primary" size="large" onClick={() => onNext()} className="w-full">
+<Button variant="primary" size="large" onClick={onNext} className="w-full">
📝 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.

Suggested change
<Button variant="primary" size="large" onClick={() => onNext()} className="w-full">
<Button variant="primary" size="large" onClick={onNext} className="w-full">

Comment on lines 20 to 23
<Chip variant="medium">
{typeof place.category === 'object' ? place.category.majorCategory : place.category}
</Chip>
</div>
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

모바일 대응을 위한 레이아웃 개선이 필요합니다.

코드 분석 결과, 다음과 같은 사항들이 확인되었습니다:

  • 카테고리는 '음식점', '카페', '교육', '병원' 등 다양한 길이의 텍스트가 포함될 수 있습니다
  • Chip 컴포넌트는 min-w-7로 최소 너비가 지정되어 있어 긴 텍스트의 경우 모바일에서 레이아웃 문제가 발생할 수 있습니다
  • 현재 PlaceItem의 레이아웃은 gap-3으로 고정되어 있어 모바일 화면에서 유연하지 않습니다

제안된 수정사항:

- <div className="flex flex-row gap-3 items-center">
+ <div className="flex flex-row gap-2 items-center flex-wrap xs:gap-3">

이 변경으로:

  • 모바일에서는 더 작은 gap으로 공간을 효율적으로 사용
  • flex-wrap으로 긴 카테고리명이 있을 경우 자연스럽게 줄바꿈
  • 데스크톱에서는 기존 여백(gap-3) 유지
🔗 Analysis chain

카테고리 칩의 모바일 대응이 필요해 보입니다.

긴 카테고리명이 있을 경우 모바일 화면에서 레이아웃이 깨질 수 있습니다. 다음과 같은 개선을 제안드립니다:

- <div className="flex flex-row gap-3 items-center">
+ <div className="flex flex-row gap-2 items-center flex-wrap xs:gap-3">
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# 카테고리명의 최대 길이 확인
ast-grep --pattern 'category: $_' | rg -A 1 'category'

Length of output: 54


Script:

#!/bin/bash
# 카테고리 관련 타입 정의와 실제 데이터 확인
rg -g '*.ts*' -A 5 'type.*Place.*{' 
rg -g '*.ts*' -A 5 'interface.*Place.*{'

Length of output: 274


Script:

#!/bin/bash
# 실제 사용되는 카테고리 데이터 확인
rg -g '*.ts*' -g '*.js*' -B 2 -A 2 'category.*:.*'

Length of output: 8333


Script:

#!/bin/bash
# PlaceItem 컴포넌트의 전체 구현 확인
cat src/components/common/PlaceItem/index.tsx

Length of output: 1356


Script:

#!/bin/bash
# 카테고리 데이터의 실제 값과 길이 확인
rg -g '*.ts*' -g '*.js*' 'majorCategory.*:.*' -B 2 -A 2
rg -g '*.ts*' -g '*.js*' 'CATEGORY_REGEX_MAPPING' -B 2 -A 10

Length of output: 2486


Script:

#!/bin/bash
# Chip 컴포넌트 구현 확인
cat src/components/common/Chip/index.tsx

Length of output: 303


Script:

#!/bin/bash
# Chip 컴포넌트의 variants 확인
cat src/components/common/Chip/Chip.variants.ts

Length of output: 453


Script:

#!/bin/bash
# 실제 카테고리 데이터 예시 확인
rg -g '*.stories.tsx' -B 2 -A 2 'category.*:.*'

Length of output: 1022

className,
...props
}: Props & TypographyVariants) => {
console.log(variantClasses({ type: 'Title3', weight: 'medium' }));
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

프로덕션 코드에서 console.log 제거 필요

디버깅을 위한 console.log 문이 남아있습니다. 프로덕션 환경에 배포되기 전에 제거해야 합니다.

- console.log(variantClasses({ type: 'Title3', weight: 'medium' }));

const extractedData = location.state?.data;
if (extractedData?.places.length) {
handleDataUpdate(extractedData.places, 'extract');
handleDataUpdate(extractedData, 'extract');
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

데이터 유효성 검사가 필요합니다.

extractedData가 undefined일 경우나 places 배열이 없는 경우에 대한 처리가 필요합니다.

다음과 같이 수정하는 것을 제안합니다:

-      handleDataUpdate(extractedData, 'extract');
+      if (extractedData && Array.isArray(extractedData.places)) {
+        handleDataUpdate(extractedData, 'extract');
+      }
📝 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.

Suggested change
handleDataUpdate(extractedData, 'extract');
if (extractedData && Array.isArray(extractedData.places)) {
handleDataUpdate(extractedData, 'extract');
}

Comment on lines +36 to 41
(newData: ExtractResponse | Place[], type: BottomSheetType) => {
clearMarkers();
newData?.forEach(addMarker);
if ('places' in newData) newData.places.forEach(addMarker);
if (Array.isArray(newData)) newData.forEach((place) => addMarker(place));
setState({ data: newData, type }, token);
},
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

타입 처리 로직 개선이 필요합니다.

타입 가드를 사용하여 더 안전하게 타입을 처리할 수 있습니다. 현재 구현은 런타임 에러가 발생할 수 있습니다.

다음과 같이 개선하는 것을 제안합니다:

-(newData: ExtractResponse | Place[], type: BottomSheetType) => {
+(newData: ExtractResponse | Place[], type: BottomSheetType) => {
   clearMarkers();
-  if ('places' in newData) newData.places.forEach(addMarker);
-  if (Array.isArray(newData)) newData.forEach((place) => addMarker(place));
+  if ('places' in newData && Array.isArray(newData.places)) {
+    newData.places.forEach(addMarker);
+  } else if (Array.isArray(newData)) {
+    newData.forEach((place) => addMarker(place));
+  }
   setState({ data: newData, type }, token);
 }
📝 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.

Suggested change
(newData: ExtractResponse | Place[], type: BottomSheetType) => {
clearMarkers();
newData?.forEach(addMarker);
if ('places' in newData) newData.places.forEach(addMarker);
if (Array.isArray(newData)) newData.forEach((place) => addMarker(place));
setState({ data: newData, type }, token);
},
(newData: ExtractResponse | Place[], type: BottomSheetType) => {
clearMarkers();
if ('places' in newData && Array.isArray(newData.places)) {
newData.places.forEach(addMarker);
} else if (Array.isArray(newData)) {
newData.forEach((place) => addMarker(place));
}
setState({ data: newData, type }, token);
},

@keemsebin keemsebin merged commit 627cb6a into main Nov 30, 2024
5 checks passed
@keemsebin keemsebin deleted the feat/#76-responsive branch November 30, 2024 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat 기능

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] 모바일 반응형

3 participants