Skip to content

[Refactor/#302] 워크스페이스/설정/목록/타임라인 useCoreQuery, useCoreMutation 패턴 통일 - #303

Merged
jjjsun merged 6 commits into
developfrom
refactor/#302
Jul 14, 2026
Merged

[Refactor/#302] 워크스페이스/설정/목록/타임라인 useCoreQuery, useCoreMutation 패턴 통일 #303
jjjsun merged 6 commits into
developfrom
refactor/#302

Conversation

@jjjsun

@jjjsun jjjsun commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

🚨 관련 이슈

Closed #302

✨ 변경사항

  • 🐞 BugFix Something isn't working
  • 💻 CrossBrowsing Browser compatibility
  • 🌏 Deploy Deploy
  • 🎨 Design Markup & styling
  • 📃 Docs Documentation writing and editing (README.md, etc.)
  • ✨ Feature Feature
  • 🔨 Refactor Code refactoring
  • ⚙️ Setting Development environment setup
  • ✅ Test Test related (storybook, jest, etc.)

✏️ 작업 내용

담당영역이었던 워크스페이스 목록/생성, 기본정보/설정, 멤버 관리, 초대 에서 raw useQueryuseMutationuseCoreQueryuseCoreMutation으로 통일했습니다.

mutation 성공 시 캐시 무효화는 invalidateKeys로 선언적 처리하고, toast/모달닫기와 같은 부수효과만 userOnSuccessuserOnError에 남겼습니다.

타임라인은 이미 Core 패턴 적용 상태라 raw 잔여 점검만 진행했습니다

캐시 반영

  • 워크스페이스 생성 -> 목록 갱신
  • 멤버 초대/권한 변경/삭제 -> 멤버/대기/카운트 갱신
  • 설정 저장 -> 목록 + 상세 갱신
  • 워크스페이스 삭제 -> 목록 갱신 후에 /workspace로 이동

😅 미완성 작업

N/A

📢 논의 사항 및 참고 사항

💬 리뷰어 가이드 (P-Rules)
P1: 필수 반영 (Critical) - 버그 가능성, 컨벤션 위반. 해결 전 머지 불가.
P2: 적극 권장 (Recommended) - 더 나은 대안 제시. 가급적 반영 권장.
P3: 제안 (Suggestion) - 아이디어 공유. 반영 여부는 드라이버 자율.
P4: 단순 확인/칭찬 (Nit) - 사소한 오타, 칭찬 등 피드백.

Summary by CodeRabbit

  • 개선 사항
    • 워크스페이스 목록과 상세 정보가 변경 후 더욱 일관되게 최신 상태로 갱신됩니다.
    • 멤버 권한 변경 및 멤버 삭제 후 멤버 목록과 인원 수가 자동으로 업데이트됩니다.
    • 워크스페이스 생성·수정·삭제 및 멤버 초대 처리의 성공·실패 안내가 토스트 메시지로 제공됩니다.
    • 멤버 초대 성공 시 입력 폼이 자동으로 초기화됩니다.
    • 워크스페이스 상세 정보 로딩 실패 시 다시 시도할 수 있습니다.

@jjjsun
jjjsun requested review from Seojegyeong and YermIm July 14, 2026 05:59
@jjjsun jjjsun self-assigned this Jul 14, 2026
@jjjsun jjjsun added the 🔨 Refactor 코드 리팩토링 label Jul 14, 2026
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

워크스페이스와 타임라인 영역의 직접적인 React Query 사용을 useCoreQuery/useCoreMutation으로 전환했습니다. 캐시 무효화는 invalidateKeys로 통일하고, 워크스페이스 상세 쿼리 키를 추가했습니다.

Changes

워크스페이스 서버 상태 관리

Layer / File(s) Summary
공통 쿼리 키와 뮤테이션 패턴
src/lib/queryKeys.ts, src/components/workspace/InviteMemberModal.tsx, src/hooks/timeline/useUpdateTimeline.ts
초대 및 타임라인 수정 뮤테이션을 useCoreMutationinvalidateKeys 기반으로 변경하고, 워크스페이스 상세 쿼리 키를 추가했습니다.
워크스페이스 목록 및 생성
src/pages/workspace/Workspace.tsx
워크스페이스 목록 조회와 생성 처리를 Core 훅으로 전환하고, 생성 후 목록 무효화와 모달 종료를 훅 옵션으로 구성했습니다.
멤버 조회 및 관리
src/pages/workspace/MemberManagement.tsx
멤버 수·대기 멤버 조회와 권한 변경·삭제를 Core 훅으로 전환하고, 캐시 무효화 및 오류 토스트 처리를 정리했습니다.
워크스페이스 설정 조회 및 변경
src/pages/workspace/WorkspaceSetting.tsx
워크스페이스 목록·상세 조회와 저장·삭제를 Core 훅으로 전환하고, 폼 동기화·뮤테이션 상태·재시도 동작을 변경했습니다.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested reviewers: yermim, seojegyeong

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

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.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed 연결된 #302의 대상인 워크스페이스, 멤버, 초대, 설정, 타임라인의 Core 훅 전환과 캐시 무효화가 반영되었습니다.
Out of Scope Changes check ✅ Passed 요약된 변경은 모두 #302의 대상 영역에 속하며, 별도의 무관한 수정은 보이지 않습니다.
Title check ✅ Passed 워크스페이스 영역의 useCoreQuery/useCoreMutation 통일이라는 주요 변경점을 명확하게 요약합니다.
Description check ✅ Passed 관련 이슈, 변경사항, 작업 내용, 미완성 작업, 논의 사항 섹션이 포함되어 템플릿 요구를 대부분 충족합니다.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/#302

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.

@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown

📚 Storybook 배포 완료

항목 링크
📖 Storybook https://69a147b60a56365d9e2185ef-yieacyjave.chromatic.com/
🔍 Chromatic https://www.chromatic.com/build?appId=69a147b60a56365d9e2185ef&number=418

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

🧹 Nitpick comments (1)
src/hooks/timeline/useUpdateTimeline.ts (1)

23-30: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

타임라인 상세 캐시 무효화를 위한 공통 쿼리 키 사용 권장

현재 타임라인 상세 쿼리 무효화를 위해 배열(["timeline", "detail", orgId] as const)을 직접 하드코딩하고 있습니다. 일관된 키 관리를 위해 src/lib/queryKeys.ts에 무효화 전용 키를 정의하여 사용하는 것을 권장합니다.

♻️ 수정 제안

먼저 src/lib/queryKeys.ts 파일에 무효화 전용 키를 추가합니다:

  timeline: {
    list: (orgId: number | null) => ["timeline", "list", orgId] as const,
+   /** 타임라인 상세 무효화 전용 키 */
+   details: (orgId: number | null) => ["timeline", "detail", orgId] as const,
    detail: (orgId: number | null, timelineId: number | null) =>
      ["timeline", "detail", orgId, timelineId] as const,
  },

그리고 본 파일에서 해당 키를 사용하도록 변경합니다:

      invalidateKeys:
        orgId != null
          ? [
              QUERY_KEYS.timeline.list(orgId),
-             ["timeline", "detail", orgId] as const,
+             QUERY_KEYS.timeline.details(orgId),
            ]
          : [],
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/hooks/timeline/useUpdateTimeline.ts` around lines 23 - 30, Replace the
hardcoded ["timeline", "detail", orgId] invalidation key in useUpdateTimeline’s
invalidateKeys with a shared timeline.details(orgId) key defined in
queryKeys.ts. Add the dedicated details helper alongside timeline.list and
timeline.detail, preserving the existing key shape and null handling.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/hooks/timeline/useUpdateTimeline.ts`:
- Around line 23-30: Replace the hardcoded ["timeline", "detail", orgId]
invalidation key in useUpdateTimeline’s invalidateKeys with a shared
timeline.details(orgId) key defined in queryKeys.ts. Add the dedicated details
helper alongside timeline.list and timeline.detail, preserving the existing key
shape and null handling.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 62b12804-ae90-4b11-9d3f-e982f7dc63ec

📥 Commits

Reviewing files that changed from the base of the PR and between a0ef752 and 51ef44f.

📒 Files selected for processing (6)
  • src/components/workspace/InviteMemberModal.tsx
  • src/hooks/timeline/useUpdateTimeline.ts
  • src/lib/queryKeys.ts
  • src/pages/workspace/MemberManagement.tsx
  • src/pages/workspace/Workspace.tsx
  • src/pages/workspace/WorkspaceSetting.tsx

@jjjsun jjjsun changed the title [Refactor/#302] 워크스페이스/설정/목록 useCoreQuery, useCoreMutation 패턴 통일 [Refactor/#302] 워크스페이스/설정/목록/타임라인 useCoreQuery, useCoreMutation 패턴 통일 Jul 14, 2026

@YermIm YermIm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

P4: 확인했습니다!

@jjjsun
jjjsun merged commit cf9d443 into develop Jul 14, 2026
3 checks passed
@jjjsun
jjjsun deleted the refactor/#302 branch July 14, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 Refactor 코드 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

♻️ [Refactor] 워크스페이스/설정/타임라인 useCoreQuery/useCoreMutation 패턴 통일

2 participants