Skip to content

Feature: 드롭다운 스타일 사안 반영#227

Merged
seung365 merged 8 commits into
developfrom
feat/dropdown-filter/#226
Oct 7, 2025
Merged

Feature: 드롭다운 스타일 사안 반영#227
seung365 merged 8 commits into
developfrom
feat/dropdown-filter/#226

Conversation

@seung365

@seung365 seung365 commented Oct 1, 2025

Copy link
Copy Markdown
Member

📌 Summary

📚 Tasks

  • dropdown 스타일로 변경된 사안 반영하였습니다
  • my-capsule과 explore 페이지 반영했습니다!

📸 Screenshot

  • explore
2025-10-01.11.34.27.mov
  • my-capsule
2025-10-01.11.34.48.mov

Summary by CodeRabbit

  • New Features
    • 탐색/내 캡슐에 정렬·필터를 각각의 드롭다운으로 제공하고, 현재 선택 라벨과 체크 아이콘을 표시합니다.
    • 드롭다운 좌/우 정렬 옵션을 추가해 좌측 정렬을 지원합니다.
    • 기본 정렬을 ‘최신 순’으로 변경했습니다.
  • Refactor
    • 기존 탭 방식에서 드롭다운 기반 선택 방식으로 전환하여 사용성을 개선했습니다.
  • Style
    • 좌/우 레이아웃 컨테이너 추가, 드롭다운 트리거 버튼과 콘텐츠 간격/정렬 스타일 개선으로 가독성과 일관성을 높였습니다.

@seung365 seung365 self-assigned this Oct 1, 2025
@seung365 seung365 requested a review from seueooo as a code owner October 1, 2025 02:37
@vercel

vercel Bot commented Oct 1, 2025

Copy link
Copy Markdown

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

Project Deployment Preview Comments Updated (UTC)
time-capsule Ready Ready Preview Comment Oct 1, 2025 2:37am

@coderabbitai

coderabbitai Bot commented Oct 1, 2025

Copy link
Copy Markdown

Walkthrough

정렬/필터 UI가 단일 탭 기반에서 두 개의 드롭다운(정렬, 필터)로 분리되었습니다. 관련 컴포넌트와 스타일이 추가/개편되었고, 페이지 상태와 쿼리 파라미터가 selectedTab → selectedFilter로 변경되며 정렬 기본값이 LATEST로 수정되었습니다. 공용 Dropdown 컴포넌트는 좌측 정렬과 선택 상태 표시를 지원합니다.

Changes

Cohort / File(s) Summary
Explore SelectTabSection 컴포넌트
app/(main)/explore/_components/select-tab-section/index.tsx
단일 탭 UI → 정렬/필터 드롭다운 분리. Props 변경(onSelect/selectedTab 제거, handleFilter/selectedFilter/selectedSort 추가), 기본 정렬값 LATEST, 옵션/라벨 계산 로직 추가, 아이콘/아이템 선택 처리 업데이트.
Explore SelectTabSection 스타일
app/(main)/explore/_components/select-tab-section/select-tab-section.css.ts
좌우 컨테이너(leftContainer, rightContainer) 추가, 드롭다운 트리거/컨텐츠 스타일(dropdownTrigger, dropdownContent) 신설, 포지셔닝 절대 → 상대 기반으로 전환.
Explore 페이지 연동
app/(main)/explore/page.tsx
상태 selectedTab → selectedFilter, 핸들러 handleSelect → handleFilter, 쿼리 옵션 인자 변경, 기본 정렬값 LATEST로 업데이트, SelectTabSection 새로운 Prop 적용.
My-Capsule SelectTabSection 컴포넌트
app/(main)/my-capsule/_components/select-tab-section/index.tsx
탭 UI → 정렬/필터 드롭다운 분리. 필터/정렬 옵션 리스트 추가, 선택 라벨 계산, Props 교체(handleFilter/selectedFilter/selectedSort), 기본 정렬값 LATEST.
My-Capsule SelectTabSection 스타일
app/(main)/my-capsule/_components/select-tab-section/select-tab-section.css.ts
leftContainer, rightContainer 추가, chipWrapper에 flex:1, 드롭다운 레이아웃 절대 → 상대, dropdownTrigger, dropdownContent 신설, 간격/타이포 조정.
My-Capsule 페이지 연동
app/(main)/my-capsule/page.tsx
상태/핸들러를 selectedFilter/handleFilter로 리네이밍, 쿼리 호출 인자 교체, 기본 정렬값 LATEST, SelectTabSection Prop 갱신.
공용 Dropdown 스타일
shared/ui/dropdown/dropdown.css.ts
좌측 정렬용 dropdownContentLeft 추가, dropdownItem에 space-between, 선택 상태 selectedItem, 체크 아이콘 checkIcon, 아이템 컨테이너 itemContent 추가.
공용 Dropdown 컴포넌트
shared/ui/dropdown/index.tsx
DropdownContentalign prop(기본 right) 추가, 좌측 정렬 클래스 적용. DropdownItemisSelected prop 추가, 선택 스타일/CheckIcon 표시, 아이템 컨텐츠 래퍼 적용.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor U as User
  participant ST as SelectTabSection
  participant DD as Dropdown (Filter/Sort)
  participant P as Page (Explore/My-Capsule)
  participant Q as useInfiniteQuery

  U->>ST: 드롭다운 트리거 클릭
  ST->>DD: DropdownContent 표시(align: left/right)
  U->>DD: 항목 선택
  DD->>ST: onSelect(value, type)
  ST->>P: handleFilter(value) 또는 handleSort(value)
  P->>P: setState(selectedFilter/selectedSort)
  P->>Q: capsuleLists(selectedSort, selectedFilter)
  Q-->>P: 데이터 업데이트
  P-->>U: 리스트 렌더링 갱신
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed 제목 “Feature: 드롭다운 스타일 사안 반영”은 PR의 핵심인 드롭다운 스타일 변경을 명확히 요약하며 불필요한 파일 목록이나 모호한 용어 없이 간결하게 작성되었습니다.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/dropdown-filter/#226

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@seung365 seung365 linked an issue Oct 1, 2025 that may be closed by this pull request
@github-actions

github-actions Bot commented Oct 1, 2025

Copy link
Copy Markdown

This pull request (commit 7da4332) has been deployed to Vercel ▲ - View GitHub Actions Workflow Logs

Name Link
🌐 Unique https://time-capsule-6sms414ck-hs-projects-b4a69d5f.vercel.app
🔍 Inspect https://vercel.com/hs-projects-b4a69d5f/time-capsule/56TpcNr9GEG2hBFpUX4yFfiDvoJm

@github-actions

github-actions Bot commented Oct 1, 2025

Copy link
Copy Markdown

🚀 Storybook 배포

📖 Storybook: https://683d91ab23651aa0b399e435-hscsstyswd.chromatic.com/
🔗 Chromatic Build: https://www.chromatic.com/build?appId=683d91ab23651aa0b399e435&number=231
✅ Status: success

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (4)
app/(main)/explore/_components/select-tab-section/select-tab-section.css.ts (1)

16-26: 코드 중복 확인 필요

leftContainerrightContainer 스타일이 app/(main)/my-capsule/_components/select-tab-section/select-tab-section.css.ts와 완전히 동일합니다. 공통 스타일은 shared/styles 디렉토리로 추출하는 것을 고려해보세요.

다음 스크립트로 두 파일 간 중복 스타일을 확인할 수 있습니다:

#!/bin/bash
# Description: Check for duplicate styles between explore and my-capsule select-tab-section CSS files

echo "=== Explore select-tab-section.css.ts ==="
cat "app/(main)/explore/_components/select-tab-section/select-tab-section.css.ts"

echo -e "\n=== My-capsule select-tab-section.css.ts ==="
cat "app/(main)/my-capsule/_components/select-tab-section/select-tab-section.css.ts"
app/(main)/my-capsule/_components/select-tab-section/index.tsx (2)

36-42: undefined 처리 고려 필요

selectedFilterLabelselectedSortLabelfind()로 파생되므로 매칭되는 옵션이 없을 경우 undefined가 될 수 있습니다. Trigger에서 렌더링 시 빈 값이나 기본 플레이스홀더를 표시하도록 처리하는 것을 권장합니다.

다음과 같이 fallback 값을 추가할 수 있습니다:

-  const selectedFilterLabel = filterOptions.find(
-    (option) => option.value === selectedFilter,
-  )?.label;
+  const selectedFilterLabel = filterOptions.find(
+    (option) => option.value === selectedFilter,
+  )?.label ?? "필터 선택";

-  const selectedSortLabel = sortOptions.find(
-    (option) => option.value === selectedSort,
-  )?.label;
+  const selectedSortLabel = sortOptions.find(
+    (option) => option.value === selectedSort,
+  )?.label ?? "정렬 선택";

17-84: 코드 중복 확인 필요

이 컴포넌트의 구조가 app/(main)/explore/_components/select-tab-section/index.tsx와 거의 동일합니다. 공통 로직(레이블 파생, 드롭다운 렌더링)을 재사용 가능한 유틸리티나 공통 컴포넌트로 추출하는 것을 고려해보세요.

다음 스크립트로 두 파일의 유사도를 확인할 수 있습니다:

#!/bin/bash
# Description: Compare the structure of explore and my-capsule select-tab-section components

echo "=== My-capsule component ==="
cat "app/(main)/my-capsule/_components/select-tab-section/index.tsx"

echo -e "\n=== Explore component ==="
cat "app/(main)/explore/_components/select-tab-section/index.tsx"
app/(main)/explore/_components/select-tab-section/index.tsx (1)

32-38: undefined 처리 고려 필요

selectedFilterLabelselectedSortLabelfind()로 파생되므로 매칭되는 옵션이 없을 경우 undefined가 될 수 있습니다. Trigger에서 렌더링 시 빈 값이나 기본 플레이스홀더를 표시하도록 처리하는 것을 권장합니다.

다음과 같이 fallback 값을 추가할 수 있습니다:

-  const selectedFilterLabel = filterOptions.find(
-    (option) => option.value === selectedFilter,
-  )?.label;
+  const selectedFilterLabel = filterOptions.find(
+    (option) => option.value === selectedFilter,
+  )?.label ?? "필터 선택";

-  const selectedSortLabel = sortOptions.find(
-    (option) => option.value === selectedSort,
-  )?.label;
+  const selectedSortLabel = sortOptions.find(
+    (option) => option.value === selectedSort,
+  )?.label ?? "정렬 선택";
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 754c4b5 and 7da4332.

⛔ Files ignored due to path filters (1)
  • shared/assets/icon/down.svg is excluded by !**/*.svg
📒 Files selected for processing (8)
  • app/(main)/explore/_components/select-tab-section/index.tsx (1 hunks)
  • app/(main)/explore/_components/select-tab-section/select-tab-section.css.ts (3 hunks)
  • app/(main)/explore/page.tsx (3 hunks)
  • app/(main)/my-capsule/_components/select-tab-section/index.tsx (1 hunks)
  • app/(main)/my-capsule/_components/select-tab-section/select-tab-section.css.ts (2 hunks)
  • app/(main)/my-capsule/page.tsx (3 hunks)
  • shared/ui/dropdown/dropdown.css.ts (4 hunks)
  • shared/ui/dropdown/index.tsx (5 hunks)
🧰 Additional context used
🧬 Code graph analysis (7)
app/(main)/explore/_components/select-tab-section/index.tsx (1)
shared/types/api/capsule.ts (2)
  • CapsuleSortType (82-82)
  • CAPSULE_SORT (75-80)
app/(main)/my-capsule/_components/select-tab-section/index.tsx (1)
shared/types/api/capsule.ts (4)
  • MyCapsuleFilterType (91-92)
  • CapsuleSortType (82-82)
  • CAPSULE_SORT (75-80)
  • MY_CAPSULE_FILTER (84-89)
app/(main)/my-capsule/_components/select-tab-section/select-tab-section.css.ts (4)
app/(main)/explore/_components/select-tab-section/select-tab-section.css.ts (6)
  • leftContainer (16-20)
  • rightContainer (22-26)
  • chipWrapper (28-37)
  • dropdown (39-42)
  • dropdownTrigger (44-56)
  • dropdownContent (58-60)
shared/styles/tokens/screen.ts (1)
  • screen (9-27)
shared/styles/base/theme.css.ts (1)
  • themeVars (14-14)
shared/styles/tokens/color.ts (1)
  • colorTheme (1-71)
shared/ui/dropdown/index.tsx (1)
shared/utils/cn.ts (1)
  • cn (3-5)
app/(main)/explore/page.tsx (2)
shared/types/api/capsule.ts (2)
  • CapsuleSortType (82-82)
  • CAPSULE_SORT (75-80)
shared/api/queries/capsule.ts (1)
  • capsuleQueryOptions (36-79)
app/(main)/my-capsule/page.tsx (2)
shared/types/api/capsule.ts (4)
  • MyCapsuleFilterType (91-92)
  • MY_CAPSULE_FILTER (84-89)
  • CapsuleSortType (82-82)
  • CAPSULE_SORT (75-80)
shared/api/queries/capsule.ts (1)
  • capsuleQueryOptions (36-79)
app/(main)/explore/_components/select-tab-section/select-tab-section.css.ts (2)
app/(main)/my-capsule/_components/select-tab-section/select-tab-section.css.ts (4)
  • leftContainer (16-20)
  • rightContainer (22-26)
  • dropdownTrigger (44-56)
  • dropdownContent (59-61)
shared/styles/tokens/color.ts (1)
  • colorTheme (1-71)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: deploy
  • GitHub Check: test
  • GitHub Check: storybook-deploy
🔇 Additional comments (14)
app/(main)/my-capsule/_components/select-tab-section/select-tab-section.css.ts (2)

1-26: 레이아웃 구조가 explore 페이지와 일관되게 구현되었습니다.

좌우 컨테이너와 필요한 테마 import가 올바르게 추가되었습니다.


39-61: 드롭다운 스타일이 올바르게 구현되었습니다.

relative 포지셔닝과 새로운 트리거/콘텐츠 스타일이 explore 페이지와 일관되게 적용되었습니다.

app/(main)/my-capsule/page.tsx (2)

21-30: 상태 관리와 쿼리 호출이 올바르게 업데이트되었습니다.

selectedTab → selectedFilter로 이름이 변경되었고, 기본 정렬이 LATEST로 설정되어 explore 페이지와 일관성을 유지합니다.


48-69: 핸들러와 props가 새로운 네이밍 규칙에 맞게 올바르게 업데이트되었습니다.

app/(main)/explore/page.tsx (1)

16-56: explore 페이지가 my-capsule 페이지와 일관되게 업데이트되었습니다.

상태 이름, 기본 정렬, 핸들러 네이밍이 모두 올바르게 변경되었습니다. selectedFilter의 타입이 string으로 유연하게 처리된 점도 적절합니다.

shared/ui/dropdown/dropdown.css.ts (2)

53-71: 좌측 정렬 드롭다운과 아이템 레이아웃이 올바르게 구현되었습니다.

dropdownContentLeft는 transformOrigin과 함께 좌측 정렬을 지원하며, justifyContent: space-between은 선택 표시를 위한 공간을 확보합니다.


82-93: 선택 상태 스타일이 테마 변수를 활용하여 일관되게 구현되었습니다.

shared/ui/dropdown/index.tsx (2)

3-3: align prop이 올바르게 구현되어 좌우 정렬을 지원합니다.

기본값 "right"를 통해 하위 호환성을 유지하며, 타입 제약도 적절합니다.

Also applies to: 120-139


148-181: 선택 상태 표시 기능이 올바르게 구현되었습니다.

isSelected prop과 CheckIcon을 통해 선택된 항목을 명확하게 표시하며, space-between 레이아웃과 잘 조화됩니다.

app/(main)/explore/_components/select-tab-section/select-tab-section.css.ts (2)

1-2: LGTM!

테마 변수와 색상 토큰 import가 새로운 드롭다운 스타일링에 적절하게 사용되었습니다.


44-56: 드롭다운 트리거 최소 너비(11rem) 검토 필요
explore 컴포넌트(전체·참여가능·오픈된 캡슐·마감된 캡슐), my-capsule 컴포넌트(전체·좋아요·내가 만든 캡슐·참여 중인 캡슐), 정렬 옵션(최신 순·오픈 임박 순·편지 마감 순) 등 모든 라벨 렌더링 시 11rem이 충분한지 UI에서 확인하고, 필요 시 minWidth 조정 또는 width: auto 적용을 권장합니다.

app/(main)/my-capsule/_components/select-tab-section/index.tsx (2)

10-15: LGTM!

Props 인터페이스가 명확하게 정의되어 있고, 타입 안정성이 확보되었습니다. MyCapsuleFilterTypeCapsuleSortType 사용이 적절합니다.


21-21: 좋은 개선입니다!

selectedSort에 기본값 CAPSULE_SORT.LATEST를 설정한 것은 좋은 방어 코드입니다.

app/(main)/explore/_components/select-tab-section/index.tsx (1)

17-17: LGTM!

selectedSort에 기본값 CAPSULE_SORT.LATEST를 설정한 것은 좋은 방어 코드입니다.

Comment thread app/(main)/explore/_components/select-tab-section/index.tsx
Comment thread app/(main)/explore/_components/select-tab-section/index.tsx

@seueooo seueooo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

고생하셧습니다~~!~!!

@seung365 seung365 merged commit 33264d7 into develop Oct 7, 2025
11 checks passed
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.

[Feature]: 탐색과 마이 캡슐 드롭다운 추가

2 participants