Skip to content

자료필터링 UI 기능 수정 : feat : 필터링 UI개선 및 라벨 리네임 https://github.com/Sejong-B…#645

Merged
thswogh merged 2 commits intomainfrom
20251001_#643_기능개선_자료필터링_자료필터링_UI_기능_수정
Oct 1, 2025

Hidden character warning

The head ref may contain hidden characters: "20251001_#643_\uae30\ub2a5\uac1c\uc120_\uc790\ub8cc\ud544\ud130\ub9c1_\uc790\ub8cc\ud544\ud130\ub9c1_UI_\uae30\ub2a5_\uc218\uc815"
Merged

자료필터링 UI 기능 수정 : feat : 필터링 UI개선 및 라벨 리네임 https://github.com/Sejong-B…#645
thswogh merged 2 commits intomainfrom
20251001_#643_기능개선_자료필터링_자료필터링_UI_기능_수정

Conversation

@thswogh
Copy link
Copy Markdown
Contributor

@thswogh thswogh commented Oct 1, 2025

Summary by CodeRabbit

  • 스타일

    • 문서/질문 필터 바텀시트 하단 버튼 레이아웃 개선: 초기화 버튼 축소, 적용 버튼 강조(문서: 하늘색 고정, 질문: 초록색).
    • 적용 버튼 텍스트 ‘확인’→‘적용’, 초기화 아이콘 추가, 글자 크기·굵기 상향.
    • 문서 필터 색상 더 이상 사용자 설정 불가(문서쪽은 고정 색상).
    • 문서/질문 필터 태그 디자인 업데이트: 굵은 폰트, 16px, 경계/텍스트 색 대비 개선.
  • 카피 업데이트

    • 문서 유형 라벨 간결화: “강의 자료”, “과제 기출”, “해설” 등.
    • 정렬 옵션 라벨 가독성 향상(띄어쓰기 적용: “최신 순”, “추천 순”, “현상금 순”, “조회수 순”, “댓글 순”, “다운로드 순”).

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Oct 1, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

문서·질문 필터링 UI 컴포넌트들의 스타일·레이아웃이 조정되고, 버튼 관련 props/표현이 정리되었습니다. 문서 타입 및 정렬 라벨의 한글 표기도 수정되었으며, DocumentFilteringBottomSheet 사용처에서 activeColor가 제거되었습니다. 로직·이벤트 흐름은 유지됩니다.

Changes

Cohort / File(s) Summary of edits
Document Filtering Bottom Sheet & usage
src/components/common/DocumentFilteringBottomSheet.tsx, src/app/board/document/sub/my-faculty/page.tsx
activeColor prop 제거(컴포넌트 선언·사용 중지). 제출 버튼 색상 고정(#00D1F2). 하단 액션 레이아웃을 flex 분할(flex-[1]/flex-[2.5])로 변경. DrawerHeader 테두리 클래스 업데이트.
Question Filtering Bottom Sheet + FilteringButton
src/components/common/QuestionFilteringBottomSheet.tsx, src/components/common/buttons/FilteringButton.tsx
하단 액션 레이아웃을 분할 레이아웃으로 재구성(왼쪽 리셋 flex-1, 오른쪽 제출 flex-2.5). FilteringButtonactiveColor?: string 지원 추가(예: #00E271). 버튼 텍스트·타이포·크기(굵기 18px) 변경, 활성 시 단색 배경/기본은 그라디언트 유지, 리셋 아이콘(Image) 추가.
Filtering Tags
src/components/common/tags/DocumentFilteringTag.tsx, src/components/common/tags/QuestionFilteringTag.tsx
태그 스타일 재구성: font-weight → bold, 폰트 크기 16px, 패딩 조정, 선택/비선택 테두리·색상 규칙 단순화 및 클래스 변경(transition 제거). API 시그니처 변화 없음.
Constants (labels)
src/types/api/constants/documentType.ts, src/types/api/constants/sortType.ts
문서 타입 한글 라벨 변경(예: "강의 자료", "과제 기출", "해설"). 정렬 라벨 문자열에 공백/표현 정리(예: "최신 순", "현상금 순", "조회수 순" 등).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

폴짝, 나는 리뷰 토끼 🐇
버튼 빛깔은 고정되었네, 깔끔한 한 줄기 빛
태그는 굵어지고, 글자는 또렷해졌지
정렬도 띄어 쓰여 길을 바로잡았네
클릭하니 적용, 다시 폴짝 들판으로 ✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title Check ⚠️ Warning PR 제목에 주요 변경사항인 자료 필터링 UI 개선 및 라벨 리네임이 포함되어 있으나 URL과 불필요한 접두사(feat:)가 들어가 있어 불필요한 정보로 인해 가독성과 간결성이 저해되고 있습니다. 제목에서 URL과 불필요한 접두사를 제거하고 “자료 필터링 UI 개선 및 라벨 리네임”처럼 핵심 변경사항을 간결하고 명확하게 요약하도록 수정해주세요.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

📜 Recent 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 2c4c1d1 and 0e22810.

📒 Files selected for processing (4)
  • src/components/common/DocumentFilteringBottomSheet.tsx (2 hunks)
  • src/components/common/QuestionFilteringBottomSheet.tsx (2 hunks)
  • src/components/common/tags/DocumentFilteringTag.tsx (1 hunks)
  • src/components/common/tags/QuestionFilteringTag.tsx (1 hunks)

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.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Oct 1, 2025

세종말싸미 빌드 결과: ❌ 빌드 실패

빌드 검증이 완료되었습니다.

📋 빌드 에러 로그

> malsami-fe@0.1.23 build
> next build

⚠ No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry

  ▲ Next.js 14.2.30
  - Environments: .env.local

   Creating an optimized production build ...
 ✓ Compiled successfully
   Linting and checking validity of types ...
Failed to compile.

./src/app/board/document/sub/hot-download/page.tsx:148:9
Type error: Type '{ onReset: () => void; onConfirm: (filtering: Partial<DocumentCommand>) => Promise<void>; currentFiltering: Partial<DocumentCommand>; trigger: Element; activeColor: string; }' is not assignable to type 'IntrinsicAttributes & DocumentFilteringBottomSheetProps'.
  Property 'activeColor' does not exist on type 'IntrinsicAttributes & DocumentFilteringBottomSheetProps'.

�[0m �[90m 146 |�[39m         currentFiltering�[33m=�[39m{currentFiltering}�[0m
�[0m �[90m 147 |�[39m         trigger�[33m=�[39m{�[33m<�[39m�[33mdiv�[39m �[35m/>} /�[39m�[33m/�[39m 빈 트리거 (�[33mHeader의�[39m 메뉴 버튼으로 제어)�[0m
�[0m�[31m�[1m>�[22m�[39m�[90m 148 |�[39m         activeColor�[33m=�[39m�[32m"#00D1F2"�[39m �[90m// 파란색 테마�[39m�[0m
�[0m �[90m     |�[39m         �[31m�[1m^�[22m�[39m�[0m
�[0m �[90m 149 |�[39m       �[33m/�[39m�[33m>�[39m�[0m
�[0m �[90m 150 |�[39m     �[33m<�[39m�[33m/�[39m�[33mdiv�[39m�[33m>�[39m�[0m
�[0m �[90m 151 |�[39m   )�[33m;�[39m�[0m
Next.js build worker exited with code: 1 and signal: null

@github-actions
Copy link
Copy Markdown

github-actions bot commented Oct 1, 2025

세종말싸미 빌드 결과: ❌ 빌드 실패

빌드 검증이 완료되었습니다.

📋 빌드 에러 로그

> malsami-fe@0.1.23 build
> next build

  ▲ Next.js 14.2.30
  - Environments: .env.local

   Creating an optimized production build ...
 ✓ Compiled successfully
   Linting and checking validity of types ...
Failed to compile.

./src/app/board/document/sub/hot-download/page.tsx:148:9
Type error: Type '{ onReset: () => void; onConfirm: (filtering: Partial<DocumentCommand>) => Promise<void>; currentFiltering: Partial<DocumentCommand>; trigger: Element; activeColor: string; }' is not assignable to type 'IntrinsicAttributes & DocumentFilteringBottomSheetProps'.
  Property 'activeColor' does not exist on type 'IntrinsicAttributes & DocumentFilteringBottomSheetProps'.

�[0m �[90m 146 |�[39m         currentFiltering�[33m=�[39m{currentFiltering}�[0m
�[0m �[90m 147 |�[39m         trigger�[33m=�[39m{�[33m<�[39m�[33mdiv�[39m �[35m/>} /�[39m�[33m/�[39m 빈 트리거 (�[33mHeader의�[39m 메뉴 버튼으로 제어)�[0m
�[0m�[31m�[1m>�[22m�[39m�[90m 148 |�[39m         activeColor�[33m=�[39m�[32m"#00D1F2"�[39m �[90m// 파란색 테마�[39m�[0m
�[0m �[90m     |�[39m         �[31m�[1m^�[22m�[39m�[0m
�[0m �[90m 149 |�[39m       �[33m/�[39m�[33m>�[39m�[0m
�[0m �[90m 150 |�[39m     �[33m<�[39m�[33m/�[39m�[33mdiv�[39m�[33m>�[39m�[0m
�[0m �[90m 151 |�[39m   )�[33m;�[39m�[0m
Next.js build worker exited with code: 1 and signal: null

@thswogh thswogh merged commit cf095cc into main Oct 1, 2025
1 check passed
Copy link
Copy Markdown

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

🧹 Nitpick comments (1)
src/components/common/buttons/FilteringButton.tsx (1)

37-46: activeColor prop 사용 시 색상 유효성 검증을 고려하세요.

activeColor를 직접 backgroundColor로 사용하고 있지만, 유효한 CSS 색상 값인지 검증하지 않습니다. 잘못된 값이 전달될 경우 스타일이 적용되지 않을 수 있습니다.

색상 형식 검증을 추가하는 것을 고려하세요:

if (activeColor) {
  // CSS 색상 형식 검증 (선택적)
  const isValidColor = /^#([0-9A-F]{3}){1,2}$/i.test(activeColor) || 
                       /^rgb\(/.test(activeColor) || 
                       /^hsl\(/.test(activeColor);
  
  if (!isValidColor) {
    console.warn(`Invalid activeColor provided: ${activeColor}`);
  }
  
  return {
    backgroundClass: "",
    textClass: "text-white font-suit-bold text-lg",
    text: "적용",
    style: {
      backgroundColor: activeColor,
    },
  };
}
📜 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 5debd5b and 2c4c1d1.

📒 Files selected for processing (8)
  • src/app/board/document/sub/my-faculty/page.tsx (0 hunks)
  • src/components/common/DocumentFilteringBottomSheet.tsx (1 hunks)
  • src/components/common/QuestionFilteringBottomSheet.tsx (1 hunks)
  • src/components/common/buttons/FilteringButton.tsx (3 hunks)
  • src/components/common/tags/DocumentFilteringTag.tsx (1 hunks)
  • src/components/common/tags/QuestionFilteringTag.tsx (1 hunks)
  • src/types/api/constants/documentType.ts (1 hunks)
  • src/types/api/constants/sortType.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • src/app/board/document/sub/my-faculty/page.tsx
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx}: 모든 코드에 TypeScript 엄격 타입을 사용합니다.
인터페이스를 타입 별칭보다 선호합니다.
Boolean 변수는 반드시 is 접두사를 사용합니다.
명확한 Command/Dto 패턴 사용
에러는 명시적으로 처리하고 로깅합니다.
변수/함수: camelCase
상수: UPPER_SNAKE_CASE
컴포넌트/클래스: PascalCase
축약어 및 모호한 이름 금지
오류는 항상 명시적으로 발생시킵니다.
특정 오류 타입 사용 (ValueError, TypeError 등)
오류 메시지는 명확하고 조치 가능해야 합니다.
any 타입 사용 금지
불변성 유지

**/*.{ts,tsx}: Boolean variables must use the 'is' prefix (e.g., isLoading, isModalOpen, isDocumentValid, isUserAuthenticated). Do not use 'has', 'can', or 'should' prefixes.
Do not use abbreviations for variable names (e.g., doc, q, QNA). Use full, descriptive names.
Do not use meaningless variable names such as 'data', 'item', or 'temp'.
Do not use the 'any' type or ambiguous names like 'result' or 'value'.
Constants must be named in UPPER_SNAKE_CASE.
Do not use the 'any' type anywhere in the codebase.
All code must be written in TypeScript (.ts or .tsx files).
Do not use generic interface names like 'Props' or prefix interfaces with 'I'.

Files:

  • src/types/api/constants/documentType.ts
  • src/components/common/tags/QuestionFilteringTag.tsx
  • src/components/common/DocumentFilteringBottomSheet.tsx
  • src/components/common/QuestionFilteringBottomSheet.tsx
  • src/types/api/constants/sortType.ts
  • src/components/common/tags/DocumentFilteringTag.tsx
  • src/components/common/buttons/FilteringButton.tsx
**/*.ts

📄 CodeRabbit inference engine (.cursorrules)

FormData 기반 API 통신

Files:

  • src/types/api/constants/documentType.ts
  • src/types/api/constants/sortType.ts
src/types/**/*.ts

📄 CodeRabbit inference engine (GEMINI.md)

src/types/**/*.ts: TypeScript interfaces should be used for type definitions (not types or classes), especially for objects that may be extended.
All files in src/types/ must only contain type/interface definitions and related constants.

Files:

  • src/types/api/constants/documentType.ts
  • src/types/api/constants/sortType.ts
**/*.tsx

📄 CodeRabbit inference engine (.cursorrules)

**/*.tsx: 함수형 컴포넌트와 TypeScript 인터페이스를 사용합니다.
컴포넌트명은 PascalCase를 사용합니다.
Tailwind CSS 유틸리티 클래스 사용
하드코딩된 색상/크기 대신 디자인 시스템 토큰 활용
반응형 디자인은 모바일 우선 접근 방식
React.memo, useMemo, useCallback 적절히 사용
불필요한 렌더링 방지
서버 컴포넌트 및 정적 생성 최대한 활용
Shadcn UI 및 Radix UI 컴포넌트 우선 사용

Files:

  • src/components/common/tags/QuestionFilteringTag.tsx
  • src/components/common/DocumentFilteringBottomSheet.tsx
  • src/components/common/QuestionFilteringBottomSheet.tsx
  • src/components/common/tags/DocumentFilteringTag.tsx
  • src/components/common/buttons/FilteringButton.tsx
src/components/**/*.tsx

📄 CodeRabbit inference engine (GEMINI.md)

src/components/**/*.tsx: Component files must be named in PascalCase (e.g., DocumentUploadCard.tsx, QuestionAnswerForm.tsx, UserProfileHeader.tsx).
Props interface must be named as ComponentNameProps (e.g., DocBoardCardProps). Do not use generic names like 'Props' or prefix with 'I'.
Component names must use PascalCase and clearly indicate their role (e.g., DocumentUploadCard, QuestionAnswerForm, UserProfileHeader).
In CSS/JSX, always use Tailwind CSS classes for colors. Do not use hardcoded color values or inline styles for color.
Do not use inline styles for font or color (e.g., style={{ fontFamily: 'SUIT', fontSize: '18px' }}). Use Tailwind classes instead.
Do not use hardcoded pixel values for width, height, or position (e.g., className="w-[393px]", style={{ width: '271px' }}). Use dynamic, responsive units (rem, %, flex, grid) and Tailwind classes.
Do not use inline styles for layout or spacing. Use Tailwind CSS classes for all spacing, sizing, and layout.
Use conditional rendering for loading, error, and empty states in components (e.g., show skeleton, error message, or empty state as appropriate).
Optimize components using React.memo, useMemo, and useCallback where appropriate.
Do not use inline styles for any layout, spacing, font, or color. Use Tailwind CSS classes exclusively.
All new components must have a defined props interface, use PascalCase for the component name, and follow the project's naming and structure conventions.
Do not use hardcoded pixel values for spacing, sizing, or layout. Use Tailwind's spacing and sizing utilities (e.g., p-4, gap-3, w-full, h-16).
All Tailwind spacing and sizing should use the project's standard scale (multiples of 4px, e.g., gap-1, p-2, m-3, etc.).
Do not use inline styles for text overflow or line clamping. Use Tailwind's 'truncate' or 'line-clamp-N' classes.
All component files must use the default export for the main component.

Files:

  • src/components/common/tags/QuestionFilteringTag.tsx
  • src/components/common/DocumentFilteringBottomSheet.tsx
  • src/components/common/QuestionFilteringBottomSheet.tsx
  • src/components/common/tags/DocumentFilteringTag.tsx
  • src/components/common/buttons/FilteringButton.tsx
🔇 Additional comments (5)
src/types/api/constants/documentType.ts (1)

13-15: 라벨 업데이트 확인 완료

한글 라벨이 간결하고 명확하게 수정되었습니다. 타입 정의와 상수 구조는 코딩 가이드라인을 준수하고 있습니다.

src/types/api/constants/sortType.ts (1)

19-27: 라벨 업데이트 확인 완료

정렬 옵션의 한글 라벨에 공백이 추가되어 가독성이 개선되었습니다. 타입 정의와 상수 구조는 코딩 가이드라인을 준수하고 있습니다.

src/components/common/DocumentFilteringBottomSheet.tsx (1)

145-151: 하단 액션 영역 레이아웃 개선 확인

새로운 flex 비율(flex-[1], flex-[2.5])을 사용한 레이아웃 구조가 적절하며, 초기화 버튼보다 확인 버튼에 더 많은 공간을 할당하여 사용성을 개선했습니다.

src/components/common/QuestionFilteringBottomSheet.tsx (1)

185-191: 하단 액션 영역 레이아웃 일관성 확인

DocumentFilteringBottomSheet와 동일한 flex 비율(flex-[1], flex-[2.5])을 사용하여 두 컴포넌트 간 레이아웃 일관성이 유지되고 있습니다.

src/components/common/buttons/FilteringButton.tsx (1)

30-30: 라벨 변경이 적절합니다.

버튼 텍스트를 "확인"에서 "초기화"(refresh) 및 "적용"(submit)으로 변경한 것은 사용자 경험을 개선하고 버튼의 의도를 더 명확하게 전달합니다.

Also applies to: 41-41, 51-51

return {
backgroundClass: "bg-white border border-ui-divider",
textClass: "text-ui-muted font-suit-medium text-[16px]",
textClass: "text-ui-muted font-suit-bold text-[18px]",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

하드코딩된 폰트 크기를 Tailwind 표준 클래스로 변경하세요.

text-[18px]는 하드코딩된 픽셀 값으로 프로젝트 코딩 가이드라인을 위반합니다. Tailwind의 표준 텍스트 크기 클래스를 사용해야 합니다.

다음 diff를 적용하여 수정하세요:

-        textClass: "text-ui-muted font-suit-bold text-[18px]",
+        textClass: "text-ui-muted font-suit-bold text-lg",
-        textClass: "text-white font-suit-bold text-[18px]",
+        textClass: "text-white font-suit-bold text-lg",
-      textClass: "text-white font-suit-bold text-[18px]",
+      textClass: "text-white font-suit-bold text-lg",

Also applies to: 40-40, 50-50

🤖 Prompt for AI Agents
In src/components/common/buttons/FilteringButton.tsx around lines 29, 40 and 50,
replace the hardcoded Tailwind arbitrary class "text-[18px]" with the standard
Tailwind size class "text-lg"; update the textClass entries on those lines to
use "text-lg" instead of "text-[18px]" so the component follows the project's
Tailwind sizing conventions.

return (
<div
className={`h-11 flex-1 rounded-lg ${buttonStyles.backgroundClass} flex cursor-pointer items-center justify-center transition-all duration-200 hover:opacity-90`}
className={`h-11 w-full rounded-lg ${buttonStyles.backgroundClass} flex cursor-pointer items-center justify-center transition-all duration-200 hover:opacity-90`}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

컨테이너 클래스 변경의 영향을 확인하세요.

flex-1에서 w-full로 변경되어 버튼이 flex 컨테이너에서 grow하는 대신 전체 너비를 차지하게 되었습니다. 이 변경이 부모 컴포넌트의 레이아웃에 영향을 주지 않는지 확인이 필요합니다.

다음 스크립트를 실행하여 이 버튼을 사용하는 부모 컴포넌트들을 확인하세요:


🏁 Script executed:

#!/bin/bash
# Description: Find all components using FilteringButton and check their layout context

echo "=== Files importing FilteringButton ==="
rg -l "FilteringButton" --type=tsx --type=ts -g '!FilteringButton.tsx'

echo -e "\n=== Usage patterns of FilteringButton ==="
rg "FilteringButton" --type=tsx --type=ts -g '!FilteringButton.tsx' -B2 -A2

echo -e "\n=== Parent container context (flex layouts) ==="
rg -n "FilteringButton" --type=tsx -B10 -A2 | rg -C3 "flex|grid"

Length of output: 215


스크립트를 다시 실행하여 FilteringButton을 사용하는 부모 컴포넌트를 확인하세요.


🏁 Script executed:

#!/bin/bash
echo "=== Files importing FilteringButton ==="
rg -l "FilteringButton" -g '*.tsx' -g '!src/components/common/buttons/FilteringButton.tsx'

echo -e "\n=== Usage patterns of FilteringButton ==="
rg "FilteringButton" -g '*.tsx' -g '!src/components/common/buttons/FilteringButton.tsx' -B2 -A2

echo -e "\n=== Parent container context ==="
rg -n "FilteringButton" -g '*.tsx' -B10 -A2 | rg -C3 "flex|grid"

Length of output: 8531


BottomSheet.tsx 하단 버튼 레이아웃 수정 필요

w-full로 변경되면서 BottomSheet.tsx의 flex 컨테이너 내 두 버튼이 각각 부모 너비를 100% 차지해 겹치거나 오버플로우가 발생합니다.
src/components/common/BottomSheet.tsx (63–66)에서 각 <FilteringButton><div className="flex-1">…</div>로 감싸거나 버튼에 flex-1 클래스를 적용해 균등 분할되도록 수정하세요.

🤖 Prompt for AI Agents
In src/components/common/buttons/FilteringButton.tsx around line 67 and
referencing src/components/common/BottomSheet.tsx lines 63–66, the button uses
w-full which causes both buttons in BottomSheet's flex container to each take
100% width and overlap/overflow; fix by making the buttons flex items that share
space: either remove w-full and add flex-1 to the button's className (e.g.,
replace w-full with flex-1) or, alternatively, wrap each <FilteringButton> in
BottomSheet.tsx with <div className="flex-1">…</div> so the two buttons are
evenly split.

Comment on lines +74 to +86
{type === "refresh" && (
<Image
src="/icons/reset.svg"
alt="초기화"
width={14}
height={14}
className="mr-1"
style={{
filter:
"invert(1) brightness(0) saturate(100%) invert(78%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(89%) contrast(89%)",
}}
/>
)}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

🧩 Analysis chain

아이콘 렌더링에서 하드코딩된 값과 인라인 스타일을 제거하세요.

이 코드는 여러 코딩 가이드라인을 위반합니다:

  1. 하드코딩된 픽셀 값 (lines 78-79): width={14}, height={14} 대신 Tailwind의 크기 유틸리티를 사용해야 합니다.
  2. 인라인 스타일 (lines 81-84): CSS filter를 인라인 스타일로 적용하는 것은 금지되어 있습니다. Tailwind 클래스나 CSS 모듈을 사용해야 합니다.
  3. 아이콘 파일 존재 확인 필요: /icons/reset.svg 경로의 파일이 존재하는지 확인이 필요합니다.

다음과 같이 리팩토링하세요:

       {type === "refresh" && (
         <Image
           src="/icons/reset.svg"
           alt="초기화"
-          width={14}
-          height={14}
-          className="mr-1"
-          style={{
-            filter:
-              "invert(1) brightness(0) saturate(100%) invert(78%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(89%) contrast(89%)",
-          }}
+          width={14}
+          height={14}
+          className="mr-1 brightness-[.89] contrast-[.89] grayscale"
         />
       )}

아이콘 파일의 존재를 확인하기 위해 다음 스크립트를 실행하세요:


🏁 Script executed:

#!/bin/bash
# Description: Verify that the reset icon file exists in the public directory

# Check if the reset icon exists
if [ -f "public/icons/reset.svg" ]; then
  echo "✓ Reset icon found at public/icons/reset.svg"
  cat public/icons/reset.svg | head -5
else
  echo "✗ Reset icon NOT found at public/icons/reset.svg"
  echo "Searching for similar icon files..."
  fd -e svg -t f . public/icons 2>/dev/null || find public/icons -name "*.svg" -type f 2>/dev/null || echo "No SVG files found or public/icons directory does not exist"
fi

Length of output: 775


인라인 CSS 필터 제거 및 Tailwind 또는 CSS 모듈로 대체
style={{ filter: … }}을 제거하고, Tailwind의 arbitrary filter 유틸(filter-[invert(1)_brightness(0)_…]) 또는 CSS 모듈을 사용해 동일한 효과를 적용하세요. Next.js Image의 width/height는 필수 prop이므로 그대로 두시면 됩니다.
public/icons/reset.svg 파일이 존재함을 확인했습니다.

🤖 Prompt for AI Agents
In src/components/common/buttons/FilteringButton.tsx around lines 74 to 86,
remove the inline style prop on the Image component and replace it with a
class-based solution: either add a Tailwind arbitrary-filter class (e.g.
filter-[invert(1)_brightness(0)_saturate(100%)_invert(78%)_sepia(0%)_saturate(0%)_hue-rotate(0deg)_brightness(89%)_contrast(89%)]
along with existing classes) or create/import a CSS module (e.g. .resetIcon {
filter: … }) and add that classname to the Image; keep the width and height
props unchanged and ensure the new classname is applied to reproduce the exact
filter effect.

<FilteringButton type="refresh" onClick={handleReset} />
</div>
<div className="flex-[2.5]">
<FilteringButton type="submit" onClick={handleConfirm} activeColor="#00D1F2" />
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

하드코딩된 색상값을 상수 또는 Tailwind 클래스로 변경 필요

코딩 가이드라인에 따라 하드코딩된 색상값(#00D1F2) 사용을 지양해야 합니다. 이 색상은 다른 곳에서도 재사용될 가능성이 있으므로, 파일 상단에 상수로 정의하거나 디자인 시스템 토큰을 활용하는 것이 좋습니다.

다음과 같이 상수로 정의하여 사용하세요:

+const DOCUMENT_FILTER_ACTIVE_COLOR = "#00D1F2";
+
 export default function DocumentFilteringBottomSheet({
   onReset,
   onConfirm,
           <div className="flex-[2.5]">
-            <FilteringButton type="submit" onClick={handleConfirm} activeColor="#00D1F2" />
+            <FilteringButton type="submit" onClick={handleConfirm} activeColor={DOCUMENT_FILTER_ACTIVE_COLOR} />
           </div>
📝 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
<FilteringButton type="submit" onClick={handleConfirm} activeColor="#00D1F2" />
// add at the top of the file, after imports
const DOCUMENT_FILTER_ACTIVE_COLOR = "#00D1F2";
export default function DocumentFilteringBottomSheet({
onReset,
onConfirm,
// ... other props
}) {
// ... other JSX
return (
<div className="flex-[2.5]">
<FilteringButton
type="submit"
onClick={handleConfirm}
activeColor={DOCUMENT_FILTER_ACTIVE_COLOR}
/>
</div>
// ... rest of JSX
);
}
🤖 Prompt for AI Agents
In src/components/common/DocumentFilteringBottomSheet.tsx around line 150, the
FilteringButton is using a hardcoded color value "#00D1F2"; replace this with a
reusable token instead. Define a color constant at the top of the file (or
import it from your design tokens/theme) and pass that constant into the
FilteringButton's activeColor prop, or switch to an appropriate Tailwind class
and remove the prop if the component supports class-based styling; update any
imports/exports as needed so the color is reused rather than hardcoded.

<FilteringButton type="refresh" onClick={handleReset} />
</div>
<div className="flex-[2.5]">
<FilteringButton type="submit" onClick={handleConfirm} activeColor="#00E271" />
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

하드코딩된 색상값을 상수로 정의 필요

코딩 가이드라인에 따라 하드코딩된 색상값(#00E271) 사용을 지양해야 합니다. 이 색상은 질문 필터링 테마 색상으로 보이며, 파일 상단에 명확한 이름의 상수로 정의하여 재사용성과 유지보수성을 개선해야 합니다.

다음과 같이 상수로 정의하여 사용하세요:

+const QUESTION_FILTER_ACTIVE_COLOR = "#00E271";
+
 export default function QuestionFilteringBottomSheet({
   onReset,
   onConfirm,
           <div className="flex-[2.5]">
-            <FilteringButton type="submit" onClick={handleConfirm} activeColor="#00E271" />
+            <FilteringButton type="submit" onClick={handleConfirm} activeColor={QUESTION_FILTER_ACTIVE_COLOR} />
           </div>
📝 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
<FilteringButton type="submit" onClick={handleConfirm} activeColor="#00E271" />
// Define the theme color as a constant for reuse and maintainability
const QUESTION_FILTER_ACTIVE_COLOR = "#00E271";
export default function QuestionFilteringBottomSheet({
onReset,
onConfirm,
}: QuestionFilteringBottomSheetProps) {
// …
return (
<div className="flex-[2.5]">
<FilteringButton
type="submit"
onClick={handleConfirm}
activeColor={QUESTION_FILTER_ACTIVE_COLOR}
/>
</div>
// …
);
}
🤖 Prompt for AI Agents
In src/components/common/QuestionFilteringBottomSheet.tsx around line 190, the
button uses a hardcoded color "#00E271"; define a descriptive constant (e.g.,
QUESTION_FILTER_THEME_COLOR or FILTER_BUTTON_ACTIVE_COLOR) at the top of the
file (or in a shared colors/constants module if reused across files), use that
constant in place of the literal string for the FilteringButton activeColor
prop, and update any imports/usages accordingly to improve reusability and
maintainability.

Comment on lines 12 to 14
className={`font-suit-bold flex items-center justify-center rounded-[20px] border px-3 py-2 hover:bg-gray-50 text-[16px]${
isSelected ? "border-1 border-[#00E271] text-[#00E271]" : "border-[#C5C5C5] text-[#898989]"
} `}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Tailwind CSS 클래스를 사용하고 하드코딩된 값을 제거하세요.

다음과 같은 코딩 가이드라인 위반 사항이 있습니다:

  1. 하드코딩된 색상 값: #00E271, #C5C5C5, #898989 대신 Tailwind 색상 클래스를 사용해야 합니다.
  2. 하드코딩된 폰트 크기: text-[16px] 대신 Tailwind 텍스트 크기 클래스(예: text-base)를 사용해야 합니다.
  3. 하드코딩된 border-radius: rounded-[20px] 대신 표준 Tailwind 클래스(예: rounded-full 또는 rounded-2xl)를 사용해야 합니다.
  4. 잘못된 Tailwind 클래스: border-1은 유효하지 않습니다. border 또는 border-[1px]를 사용하세요.
  5. 템플릿 리터럴 공백 누락: text-[16px]${ 사이에 공백이 필요합니다.

다음 diff를 적용하여 수정하세요:

-      className={`font-suit-bold flex items-center justify-center rounded-[20px] border px-3 py-2 hover:bg-gray-50 text-[16px]${
-        isSelected ? "border-1 border-[#00E271] text-[#00E271]" : "border-[#C5C5C5] text-[#898989]"
+      className={`font-suit-bold flex items-center justify-center rounded-full border px-3 py-2 text-base hover:bg-gray-50 ${
+        isSelected ? "border-green-500 text-green-500" : "border-gray-400 text-gray-500"
       } `}

참고: #00E271에 정확히 일치하는 Tailwind 색상이 없다면, tailwind.config 파일에서 커스텀 색상을 정의하거나 가장 가까운 표준 색상(예: green-500)을 사용하세요.

As per coding guidelines

📝 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
className={`font-suit-bold flex items-center justify-center rounded-[20px] border px-3 py-2 hover:bg-gray-50 text-[16px]${
isSelected ? "border-1 border-[#00E271] text-[#00E271]" : "border-[#C5C5C5] text-[#898989]"
} `}
className={`font-suit-bold flex items-center justify-center rounded-full border px-3 py-2 text-base hover:bg-gray-50 ${
isSelected
? "border-green-500 text-green-500"
: "border-gray-400 text-gray-500"
} `}
🤖 Prompt for AI Agents
In src/components/common/tags/QuestionFilteringTag.tsx around lines 12–14,
replace hardcoded style tokens and fix the malformed template literal: remove
the hex colors and use Tailwind color classes (or add a custom color in
tailwind.config and reference it, e.g., bg-[--custom-green] or green-500),
change text-[16px] to a standard class like text-base, replace rounded-[20px]
with a standard class such as rounded-2xl (or rounded-full if appropriate),
replace invalid border-1 with border (or border-[1px] if you prefer
explicitness), and ensure there is a space before the template expression so the
class string concatenates correctly (e.g., "... text-base " + (isSelected ? "
border text-green-500 ..." : " border border-gray-300 text-gray-500 ...")).

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