Skip to content

feat: 워크스페이스 소유권 이전 및 삭제 기능 추가 (#87) - #90

Merged
0011810 merged 3 commits into
developfrom
Feat/#87/workspace-leave-flow
Jul 23, 2026
Merged

feat: 워크스페이스 소유권 이전 및 삭제 기능 추가 (#87)#90
0011810 merged 3 commits into
developfrom
Feat/#87/workspace-leave-flow

Conversation

@0011810

@0011810 0011810 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Pull Request

작업 내용

  • 워크스페이스 소유권 이전 및 삭제, 설정 페이지 탭 재구성 기능을 추가했습니다.

작업 결과

  • 설정 페이지가 워크스페이스 관리 / 팀 관리 / 프로필 설정 3개 탭으로 재구성됩니다.
  • 팀 관리 탭에서 소유자가 다른 멤버에게 소유권을 이전할 수 있습니다.
  • 워크스페이스 관리 탭에서 소유자가 멤버 존재 여부와 관계없이 워크스페이스를 삭제할 수 있습니다(Storage 파일도 함께 정리됩니다).

변경 사항

Added

  • transfer_workspace_ownership RPC(security definer) 및 소유권 이전 서버 액션/UI
  • 워크스페이스 삭제 서버 액션(Storage 파일 페이지네이션/배치 삭제 포함) 및 확인 다이얼로그 UI
  • 설정 페이지 탭 재구성(워크스페이스 관리 / 팀 관리 / 프로필 설정)

Changed

  • 프로필 탭의 팀 탈퇴 안내 문구: 소유자인 경우 팀 관리 탭(소유권 이전) 또는 워크스페이스 관리 탭(삭제)으로 안내하도록 수정
  • 팀 탈퇴/워크스페이스 삭제 성공 시 /workspaces 목록의 react-query 캐시를 무효화하도록 수정

Fixed

실행화면

스크린샷 2026-07-22 오후 6 49 08 스크린샷 2026-07-22 오후 6 52 29 스크린샷 2026-07-22 오후 6 49 48 스크린샷 2026-07-22 오후 6 50 41

테스트

  • 로컬 실행 확인
  • 주요 시나리오 확인 (소유권 이전, 일반 멤버 탈퇴, owner 워크스페이스 삭제, Storage 파일 정리, 목록 즉시 반영)
  • 일반 멤버에게 소유권 이전/삭제 UI 미노출 및 서버 액션 직접 호출 시 거부 확인
  • 타입체크/ESLint/Prettier 통과

리뷰 체크리스트

  • PR base branch가 올바릅니다. (feature/* -> develop, 배포 시 develop 또는 release/* -> main)
  • 브랜치명이 Type/#issue-number/description 형식을 따릅니다.
  • 커밋 메시지가 컨벤션을 따릅니다.
  • 불필요한 console.log, 주석, 임시 코드를 제거했습니다.
  • 타입 에러와 린트 에러를 확인했습니다.
  • CodeRabbit 1차 리뷰를 확인했습니다.
  • CodeRabbit 리뷰 반영 후 Discord에 공유했습니다.
  • 최소 1명 이상의 approve 후 merge합니다.

리뷰 요청사항

관련 이슈

Closes #87

Summary by CodeRabbit

Summary by CodeRabbit

  • 새로운 기능
    • 설정에서 워크스페이스 삭제 확인 다이얼로그와 삭제 UI 제공
    • 설정에서 소유권 이전(확인 다이얼로그) 기능 제공
    • 프로필에서 팀 탈퇴(비소유자) 기능 제공
  • 개선 사항
    • 삭제 진행 중에는 업로드가 제한되고, 소유권 이전/중복 삭제를 방지합니다.
    • 삭제·탈퇴·이전 후 워크스페이스 목록이 즉시 갱신됩니다.
    • 설정 탭 명칭을 더 명확히 변경했습니다.

- transfer_workspace_ownership RPC 추가 (security definer, 행 잠금으로 동시 탈퇴 레이스 차단)
- deleteWorkspace 서버액션 추가 (owner 검증 -> Storage 정리 -> DB 삭제, 멤버 수 무관하게 owner면 항상 가능)
- 설정 페이지를 워크스페이스 관리/팀 관리/프로필 설정 탭으로 재구성
- 소유권 이전/워크스페이스 삭제 후 react-query 캐시 무효화 처리
@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
syncly Ready Ready Preview, Comment Jul 23, 2026 3:00am

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@0011810, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 37 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 80e4db93-67ff-4292-937f-e2182302ff32

📥 Commits

Reviewing files that changed from the base of the PR and between 918d942 and 8eb8689.

📒 Files selected for processing (6)
  • src/entities/workspace/api/delete-workspace.ts
  • src/features/manage-member-profile/ui/MemberProfileForm.tsx
  • src/features/manage-workspace-info/ui/DeleteWorkspaceDialog.tsx
  • src/features/manage-workspace-members/ui/TransferOwnershipDialog.tsx
  • src/shared/model/database.types.ts
  • supabase/migrations/20260723000000_create_workspace_deletion_jobs.sql
📝 Walkthrough

Walkthrough

워크스페이스 소유권 이전과 삭제 서버 액션, 관련 Supabase RPC 및 Storage 정리 절차, 설정 화면의 조건부 관리 UI와 소유자 탈퇴 안내를 추가했습니다.

Changes

워크스페이스 소유권 관리

Layer / File(s) Summary
소유권 이전 계약 및 RPC
supabase/migrations/..., src/entities/workspace/api/transfer-ownership.ts, src/shared/model/database.types.ts, src/entities/workspace/index.ts
소유자와 대상 멤버를 검증하고 역할과 owner_id를 갱신하는 RPC, 서버 액션, 타입 및 공개 export를 추가했습니다.
워크스페이스 삭제 예약 및 정리
supabase/migrations/..., src/entities/workspace/api/delete-workspace.ts, src/shared/model/database.types.ts
삭제 작업 상태와 토큰을 관리하고, Storage 파일을 배치 삭제한 뒤 검증된 RPC를 통해 워크스페이스를 삭제하도록 구현했습니다. 업로드 중단과 직접 삭제 차단 정책도 추가했습니다.
삭제 및 소유권 이전 UI
src/features/manage-workspace-info/..., src/features/manage-workspace-members/...
워크스페이스 이름 확인 삭제 다이얼로그와 멤버 선택 소유권 이전 다이얼로그를 추가했습니다.
설정 탭과 탈퇴 조건
src/views/settings/..., src/features/manage-member-profile/ui/MemberProfileForm.tsx
소유자와 다른 멤버 존재 여부에 따라 삭제·소유권 이전·탈퇴 안내를 표시하고, 탈퇴 성공 후 워크스페이스 목록 캐시를 무효화하도록 변경했습니다.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Owner
  participant SettingsView
  participant TransferOwnershipDialog
  participant transferOwnership
  participant transfer_workspace_ownership

  Owner->>SettingsView: 팀 관리 탭 열기
  SettingsView->>TransferOwnershipDialog: 다른 멤버 목록 전달
  Owner->>TransferOwnershipDialog: 새 소유자 선택
  TransferOwnershipDialog->>transferOwnership: 소유권 이전 요청
  transferOwnership->>transfer_workspace_ownership: RPC 호출
  transfer_workspace_ownership-->>transferOwnership: 역할과 owner_id 갱신
  transferOwnership-->>TransferOwnershipDialog: 성공 응답
Loading

Possibly related PRs

Suggested reviewers: kwon812, jiwoonge, wjswlgh96

🚥 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
Title check ✅ Passed 제목이 워크스페이스 소유권 이전과 삭제 기능 추가라는 핵심 변경을 명확히 담고 있습니다.
Description check ✅ Passed 필수 섹션과 관련 이슈, 테스트, 체크리스트가 모두 포함되어 있어 템플릿을 충분히 충족합니다.
Linked Issues check ✅ Passed 소유권 이전, owner 삭제, 탭 재구성, owner 탈퇴 분기, UI/서버 권한 제한이 이슈 요구사항과 일치합니다.
Out of Scope Changes check ✅ Passed 변경 내역은 설정 탭 정리와 소유권 이전·삭제 흐름 구현 범위 안에 있으며, 뚜렷한 이탈 변경은 보이지 않습니다.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch Feat/#87/workspace-leave-flow

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.

@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

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

Inline comments:
In `@src/entities/workspace/api/delete-workspace.ts`:
- Around line 66-118: Update the deleteWorkspace flow to acquire the same
row-level lock used by transfer_workspace_ownership before validating ownership
or deleting Storage files, keeping the existing requirement that Storage cleanup
precedes workspace-row deletion. Use a security-definer RPC or equivalent SELECT
... FOR UPDATE operation that holds the lock through the entire Storage listing,
batch removal, and final database delete, and ensure ownership validation and
deletion occur under that lock.

In `@src/features/manage-workspace-info/ui/DeleteWorkspaceDialog.tsx`:
- Around line 96-103: Update the delete button in DeleteWorkspaceDialog’s
handleDelete flow to expose an accessible loading state when isDeleting is true,
using an appropriate aria-label or aria-busy attribute while preserving the
existing visual spinner and button behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3002e2de-fd9b-4aaa-9d22-7239d7ac9640

📥 Commits

Reviewing files that changed from the base of the PR and between ee3a15a and 8a845a2.

📒 Files selected for processing (14)
  • src/entities/workspace/api/delete-workspace.ts
  • src/entities/workspace/api/transfer-ownership.ts
  • src/entities/workspace/index.ts
  • src/features/manage-member-profile/ui/MemberProfileForm.tsx
  • src/features/manage-workspace-info/index.ts
  • src/features/manage-workspace-info/ui/DeleteWorkspaceDialog.tsx
  • src/features/manage-workspace-info/ui/DeleteWorkspaceSection.tsx
  • src/features/manage-workspace-members/index.ts
  • src/features/manage-workspace-members/ui/OwnershipTransferSection.tsx
  • src/features/manage-workspace-members/ui/TransferOwnershipDialog.tsx
  • src/shared/model/database.types.ts
  • src/views/settings/model/settings-tab.ts
  • src/views/settings/ui/SettingsView.tsx
  • supabase/migrations/20260722000000_create_workspace_ownership_transfer_rpc.sql

Comment thread src/entities/workspace/api/delete-workspace.ts Outdated
Comment thread src/features/manage-workspace-info/ui/DeleteWorkspaceDialog.tsx

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

리뷰 확인해주세요~

Comment thread src/features/manage-workspace-members/ui/TransferOwnershipDialog.tsx Outdated

@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

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

Inline comments:
In `@src/entities/workspace/api/delete-workspace.ts`:
- Around line 81-92: Update cleanupWorkspaceStorage to filter
listAllStorageFileNames results to actual files with id !== null, excluding
folder placeholder entries. Continue looping only when the removal operation
deletes files and stop when no removable files remain, preventing an infinite
loop on unchanged listings.

In `@supabase/migrations/20260723000000_create_workspace_deletion_jobs.sql`:
- Line 12: Remove the explicit begin; and matching commit; statements from the
migration so Supabase CLI controls the transaction boundary and all migration
statements execute within its atomic transaction.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 73de3ef0-bfe9-4669-8dfb-5e7cb552fca1

📥 Commits

Reviewing files that changed from the base of the PR and between 8a845a2 and 918d942.

📒 Files selected for processing (6)
  • src/entities/workspace/api/delete-workspace.ts
  • src/features/manage-member-profile/ui/MemberProfileForm.tsx
  • src/features/manage-workspace-info/ui/DeleteWorkspaceDialog.tsx
  • src/features/manage-workspace-members/ui/TransferOwnershipDialog.tsx
  • src/shared/model/database.types.ts
  • supabase/migrations/20260723000000_create_workspace_deletion_jobs.sql

Comment thread src/entities/workspace/api/delete-workspace.ts
Comment thread supabase/migrations/20260723000000_create_workspace_deletion_jobs.sql Outdated
@0011810
0011810 merged commit 1ffc470 into develop Jul 23, 2026
3 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.

feat: 워크스페이스 소유권 이전 및 삭제 기능 추가

2 participants