Skip to content

Feat(Client): 카테고리 수정 팝업 checkbox 추가 및 api 연결#279

Open
jjangminii wants to merge 6 commits intodevelopfrom
feat/#269/modal-checkbox-add
Open

Feat(Client): 카테고리 수정 팝업 checkbox 추가 및 api 연결#279
jjangminii wants to merge 6 commits intodevelopfrom
feat/#269/modal-checkbox-add

Conversation

@jjangminii
Copy link
Collaborator

@jjangminii jjangminii commented Feb 25, 2026

📌 Related Issues

관련된 Issue를 태그해주세요. (e.g. - close #25)

📄 Tasks

  • 카테고리 수정 팝업 checkbox 추가
  • api 연결
  • 체크박스 xsmall 사이즈 추가했습니다-!

⭐ PR Point (To Reviewer)

  • 진짜.. 롤백을 몇번했는데 체크박스가 api 연결은 되는데 수정 팝업 불러올때 반영되어서 안들어오네요..

📷 Screenshot

image

Summary by CodeRabbit

릴리스 노트

  • New Features
    • 카테고리 생성 및 편집 시 공개 범위 설정 옵션 추가
    • 관심사가 일치하는 사용자와 카테고리 공유 기능 추가
    • 체크박스 컴포넌트에 초소형 크기 옵션 추가

@jjangminii jjangminii self-assigned this Feb 25, 2026
@jjangminii jjangminii linked an issue Feb 25, 2026 that may be closed by this pull request
@vercel
Copy link

vercel bot commented Feb 25, 2026

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

Project Deployment Actions Updated (UTC)
pinback-client-client Ready Ready Preview, Comment Feb 25, 2026 4:09pm
pinback-client-landing Ready Ready Preview, Comment Feb 25, 2026 4:09pm

@github-actions github-actions bot added the feat 기능 개발하라 개발 달려라 달려 label Feb 25, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 25, 2026

Walkthrough

카테고리 공유 기능을 추가하기 위해 API를 v1에서 v3로 업그레이드하고, PUT을 PATCH로 변경하며, isPublic 파라미터를 추가했습니다. PopupPortal과 Popup 컴포넌트를 확장하여 체크박스 옵션을 지원하고, 관련 훅과 상태 관리를 업데이트했습니다.

Changes

Cohort / File(s) Summary
카테고리 API 레이어
apps/client/src/shared/apis/axios.ts, apps/client/src/shared/apis/queries.ts
postCategory에 isPublic 파라미터 추가, API 엔드포인트 v1→v3 업그레이드. putCategory를 patchCategory로 이름 변경, HTTP 메서드 PUT→PATCH로 변경. 두 함수 모두 isPublic을 포함한 확장 시그니처로 업데이트.
사이드바 UI 컴포넌트
apps/client/src/shared/components/sidebar/PopupPortal.tsx, apps/client/src/shared/components/sidebar/Sidebar.tsx
PopupPortal에 shareToJobUsers 상태 추가, onCreateConfirm과 onEditConfirm 콜백 시그니처 확장. Popup에 체크박스 옵션을 조건부로 렌더링하는 기능 추가.
카테고리 액션 훅
apps/client/src/shared/components/sidebar/hooks/useCategoryActions.ts
usePutCategory→usePatchCategory로 변경. handleCreateCategory(isPublic), handlePatchCategory(id, name, isPublic) 시그니처로 업데이트, 미래이션 페이로드에 isPublic 포함.
디자인 시스템 컴포넌트
packages/design-system/src/components/checkbox/Checkbox.tsx, packages/design-system/src/components/popup/Popup.tsx
Checkbox에 'xsmall' 크기 변형 추가. Popup에 PopupCheckboxOption 인터페이스 추가, checkboxOption props 지원으로 조건부 체크박스 렌더링 구현.

Sequence Diagram(s)

sequenceDiagram
    participant User as 사용자
    participant UI as PopupPortal
    participant Popup as Popup Component
    participant Hook as useCategoryActions
    participant API as API (axios)

    User->>UI: 카테고리 생성/수정 시작
    UI->>Popup: checkboxOption props 전달 (체크박스 활성화)
    Popup->>Popup: 체크박스 렌더링 (shareToJobUsers)
    User->>Popup: 카테고리명 입력 + 체크박스 선택
    Popup->>UI: onCreateConfirm(shareToJobUsers) 또는<br/>onEditConfirm(id, name, isPublic)
    UI->>Hook: handleCreateCategory(isPublic) 또는<br/>handlePatchCategory(id, name, isPublic)
    Hook->>API: postCategory(name, isPublic) 또는<br/>patchCategory(id, name, isPublic)
    API-->>Hook: 응답
    Hook->>Hook: 캐시 무효화, UI 상태 업데이트
    Hook-->>UI: 완료 콜백
    UI-->>User: 팝업 닫기, UI 갱신
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested labels

🛠️ Feature, frontend, api

Suggested reviewers

  • jllee000
  • constantly-dev

Poem

🐰 새로운 체크박스가 팝업 안에서 춤을 추고,
API는 v1에서 v3로 우아하게 진화하며,
PUT에서 PATCH로 바뀐 우리의 카테고리,
isPublic이 함께 손잡고 공유의 길을 걷는다네.
디자인과 로직이 함께 어우러져 빛난다! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Linked Issues check ❓ Inconclusive 이슈 #269는 이미지만 포함하고 텍스트 요구사항이 명시적으로 없어 완전한 검증이 어렵습니다. PR의 변경사항이 의도된 요구사항을 충족하는지 확인할 구체적인 요구사항이 부족합니다. 이슈 #269의 구체적인 요구사항을 명시해주세요. 체크박스 동작, API 연결 방식 등의 상세 요구사항이 필요합니다.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 주요 변경 사항을 명확하게 반영하고 있습니다: 카테고리 수정 팝업에 checkbox 추가 및 API 연결이 정확히 설명되어 있습니다.
Description check ✅ Passed PR 설명이 필수 섹션을 모두 포함하고 있습니다: 관련 이슈(#269), 작업 목록, 리뷰어 주의사항, 스크린샷이 모두 제시되어 있습니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 카테고리 관련 기능(checkbox 추가, API 연결, 사이즈 옵션 확장)과 관련되어 있으며, 범위 내 변경으로 보입니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/#269/modal-checkbox-add

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
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.

❤️ Share

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

@github-actions
Copy link

✅ Storybook chromatic 배포 확인:
🐿️ storybook

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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/client/src/shared/components/sidebar/PopupPortal.tsx`:
- Around line 44-50: The effect in PopupPortal (useEffect watching popup)
unconditionally calls setShareToJobUsers(false), which resets the checkbox for
edit flows and overwrites existing visibility; change the logic in the effect to
initialize shareToJobUsers based on popup when popup.kind === 'edit' (e.g., read
the existing visibility flag from popup or popup.shareToJobUsers) and only
default to false for create flows, updating the setShareToJobUsers call in the
useEffect that references popup so edit restores the current value and create
sets false; ensure any other places that set shareToJobUsers on open (calls
around lines where shareToJobUsers/setShareToJobUsers are used, and the confirm
handler that passes the value at line ~95) are consistent with this
initialization.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a1ee533 and 3bf8c23.

📒 Files selected for processing (7)
  • apps/client/src/shared/apis/axios.ts
  • apps/client/src/shared/apis/queries.ts
  • apps/client/src/shared/components/sidebar/PopupPortal.tsx
  • apps/client/src/shared/components/sidebar/Sidebar.tsx
  • apps/client/src/shared/components/sidebar/hooks/useCategoryActions.ts
  • packages/design-system/src/components/checkbox/Checkbox.tsx
  • packages/design-system/src/components/popup/Popup.tsx

Comment on lines +44 to 50
const [shareToJobUsers, setShareToJobUsers] = useState(false);

useEffect(() => {
if (!popup) return;
setDraft(popup.kind === 'edit' ? (popup.name ?? '') : '');
setShareToJobUsers(false);
}, [popup]);
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

수정 팝업 체크박스 초기값이 항상 false로 덮여서 기존 공개 설정이 깨집니다.
Line 49에서 edit/create 구분 없이 setShareToJobUsers(false)를 호출해, 수정 팝업이 현재 값을 반영하지 못합니다. 그 상태로 확인하면 Line 95 경로로 false가 전달되어 공개 카테고리가 비공개로 바뀔 수 있습니다.

수정 제안 diff
 interface Props {
@@
-  categoryList?: { id: number; name: string }[];
+  categoryList?: { id: number; name: string; isPublic?: boolean }[];
@@
   useEffect(() => {
     if (!popup) return;
     setDraft(popup.kind === 'edit' ? (popup.name ?? '') : '');
-    setShareToJobUsers(false);
-  }, [popup]);
+    if (popup.kind === 'edit') {
+      const current = categoryList?.find((c) => c.id === popup.id);
+      setShareToJobUsers(current?.isPublic ?? false);
+    } else {
+      setShareToJobUsers(false);
+    }
+  }, [popup, categoryList]);

Also applies to: 95-95, 150-156

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/client/src/shared/components/sidebar/PopupPortal.tsx` around lines 44 -
50, The effect in PopupPortal (useEffect watching popup) unconditionally calls
setShareToJobUsers(false), which resets the checkbox for edit flows and
overwrites existing visibility; change the logic in the effect to initialize
shareToJobUsers based on popup when popup.kind === 'edit' (e.g., read the
existing visibility flag from popup or popup.shareToJobUsers) and only default
to false for create flows, updating the setShareToJobUsers call in the useEffect
that references popup so edit restores the current value and create sets false;
ensure any other places that set shareToJobUsers on open (calls around lines
where shareToJobUsers/setShareToJobUsers are used, and the confirm handler that
passes the value at line ~95) are consistent with this initialization.

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] 모달 수정 + 익스텐션 라이팅 수정

1 participant