Conversation
|
Warning Review limit reached
More reviews will be available in 50 minutes and 49 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the 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 credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. 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, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughURL의 Changes워크스페이스 기반 역할 판별 및 UI 비활성화 처리
Sequence Diagram(s)sequenceDiagram
rect rgba(100, 150, 200, 0.5)
Note over Sidebar,WorkspaceSetting: 페이지 진입 (URL workspaceId 기준 역할 조회)
end
participant Router
participant Sidebar
participant WorkspaceSetting
participant getMyWorkspaces
Router->>Sidebar: workspaceId (useParams)
Sidebar->>getMyWorkspaces: useCoreQuery(my-workspaces)
getMyWorkspaces-->>Sidebar: workspaces[]
Sidebar->>Sidebar: useMemo → myRole (roleSourceId 매칭, 폴백: store)
Router->>WorkspaceSetting: workspaceId (useParams)
WorkspaceSetting->>getMyWorkspaces: useCoreQuery(my-workspaces)
getMyWorkspaces-->>WorkspaceSetting: workspaces[]
WorkspaceSetting->>WorkspaceSetting: useMemo → isAdmin (myRole === "ADMIN")
rect rgba(200, 100, 100, 0.5)
Note over Sidebar: 워크스페이스 전환 시
end
Sidebar->>Sidebar: 워크스페이스 선택
Sidebar->>WorkspaceManageLayout: workspaceId 전달
WorkspaceManageLayout->>WorkspaceManageLayout: setSelectedOrgId, setMyRole
WorkspaceManageLayout->>getMyWorkspaces: saveWorkspace (mutation)
getMyWorkspaces-->>WorkspaceManageLayout: onSuccess
WorkspaceManageLayout->>WorkspaceManageLayout: invalidateQueries(my-workspaces, savedWorkspace)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
📚 Storybook 배포 완료
|
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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/components/sidebar/Sidebar.tsx`:
- Around line 97-103: The current implementation in the myRole useMemo hook does
not properly handle the fallback when workspaceId matching fails. If workspaceId
exists but no matching workspace is found, it immediately returns
myRoleFromStore without attempting to match using selectedOrgId, which can
expose cached admin permissions from a previous workspace. Modify the logic in
the myRole useMemo hook to first attempt matching with workspaceId if it exists,
then attempt matching with selectedOrgId if the first lookup fails, and only
after both attempts fail should it fall back to myRoleFromStore as the final
fallback.
In `@src/layout/workspace/WorkspaceManageLayout.tsx`:
- Line 28: The error message in the toast.error call contains a Korean spelling
error where "실패헀습니다" should be corrected to "실패했습니다". Fix the typo in the
toast.error message string to ensure the workspace change failure message
displays the correct Korean text to users.
- Around line 17-25: The workspace save mutation is being triggered by changes
to the `workspaces` query data, causing a circular dependency where invalidating
the my-workspaces query after a successful save triggers the effect again and
causes duplicate POST requests. Separate the effect logic so that the
saveSelectedWorkspace mutation is only triggered by changes to the workspaceId
(or whichever identifier controls which workspace to save), not by changes to
the workspaces array itself. This can be achieved by splitting the logic into
two separate effects with distinct dependency arrays, or by restructuring the
mutation trigger to depend only on the specific workspace identifier that needs
to be saved.
In `@src/styles/base.css`:
- Around line 25-27: The global button:disabled rule in base.css applies cursor:
not-allowed which overrides the cursor-wait styling intended for loading buttons
in the Button component. Modify the button:disabled selector to add an exception
for loading state buttons by using a :not() pseudo-class to exclude buttons that
have loading state indicators (such as a loading class or data attribute that
the Button component sets when in loading state). This ensures disabled buttons
in loading state retain their cursor-wait appearance rather than being
overridden by the not-allowed cursor.
🪄 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: CHILL
Plan: Pro
Run ID: 2d6fa78a-ab68-49f4-b434-a880aff2a3c9
📒 Files selected for processing (6)
src/components/common/textarea/TextareaField.tsxsrc/components/sidebar/Sidebar.tsxsrc/hooks/auth/useIsAdmin.tssrc/layout/workspace/WorkspaceManageLayout.tsxsrc/pages/workspace/WorkspaceSetting.tsxsrc/styles/base.css
💤 Files with no reviewable changes (1)
- src/hooks/auth/useIsAdmin.ts
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/layout/workspace/WorkspaceManageLayout.tsx (1)
3-3: ⚡ Quick win코딩 가이드라인에 따라
useCoreMutation을 사용해 주세요.
useMutation을@tanstack/react-query에서 직접 import하고 있습니다. 가이드라인에서는src/hooks/customQuery.ts의useCoreMutation을 사용하도록 권장하고 있어요.♻️ 수정 제안
-import { useMutation, useQueryClient } from "`@tanstack/react-query`"; +import { useQueryClient } from "`@tanstack/react-query`"; -import { useCoreQuery } from "`@/hooks/customQuery`"; +import { useCoreQuery, useCoreMutation } from "`@/hooks/customQuery`";그리고 mutation 선언 부분:
- const { mutate: saveWorkspace } = useMutation({ + const { mutate: saveWorkspace } = useCoreMutation({ mutationFn: (orgId: number) => saveSelectedWorkspace(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/layout/workspace/WorkspaceManageLayout.tsx` at line 3, The import statement in WorkspaceManageLayout.tsx is directly importing useMutation from `@tanstack/react-query`, but the coding guidelines require using useCoreMutation from src/hooks/customQuery.ts instead. Remove useMutation from the `@tanstack/react-query` import and add a new import for useCoreMutation from src/hooks/customQuery.ts, then replace all usages of useMutation with useCoreMutation throughout the file.Source: Coding guidelines
🤖 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/layout/workspace/WorkspaceManageLayout.tsx`:
- Line 3: The import statement in WorkspaceManageLayout.tsx is directly
importing useMutation from `@tanstack/react-query`, but the coding guidelines
require using useCoreMutation from src/hooks/customQuery.ts instead. Remove
useMutation from the `@tanstack/react-query` import and add a new import for
useCoreMutation from src/hooks/customQuery.ts, then replace all usages of
useMutation with useCoreMutation throughout the file.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 1bce6cc7-0a51-4458-bd0f-c739b6c4a64f
📒 Files selected for processing (3)
src/components/sidebar/Sidebar.tsxsrc/layout/workspace/WorkspaceManageLayout.tsxsrc/styles/base.css
🚧 Files skipped from review as they are similar to previous changes (2)
- src/styles/base.css
- src/components/sidebar/Sidebar.tsx
🚨 관련 이슈
Closed #242
✨ 변경사항
✏️ 작업 내용
Role이 MEMBER인데 ADMIN 전용 UI들이 보이는 문제와
기준 워크스페이스 바꾼뒤에 새로고침하면 이전 워크스페이스로 돌아가는 문제 같이 수정했습니다.
(기존 Issue 내용 + 새로고침후에도 워크스페이스 유지 추가)
1. WorkspaceSetting role 판정 수정
문제
useIsAdmin()이 store의myRole(선택된 워크스페이스 기준)을 사용/workspace/{id}/settingsURL로 직접 접근시, 전택된 워크스페이스가 ADMIN이면 저장/삭제 버튼 노출 및 입력 가능수정
useIsAdmin()제거workspaceId로getMyWorkspaces목록에서 해당 워크스페이스의myRole직접 조회myRole === "ADMIN"일때만 수정 UI 노출MEMBER 동작
2. 사이드바 메뉴 필터링 role 판정 수정
문제
filterNavByRole이 store의myRole기준으로만 필터링수정
workspaceId가 있으면, 해당 워크스페이스의myRole로 필터링workspaceId가 없으면(/dashboard,/workspace등)selectedOrgId기준myRole로 필터링 (fallback)myRole사용Role 결정 우선순위
URL workspaceId -> selectedOrgId -> store myRole
3. disabled 커서 스타일 수정
문제
cursor-not-allowed가 아님.원인
base.css의button { cursor: pointer; }전역 규칙이 우선시 되었음수정
button:not(:disabled) { cursor: pointer; }button:disabled { cursor: not-allowed; }4. 새로고침 시 선택 워크스페이스 유지
문제
원인
saveSelectedWorkspaceAPI는 사이드바 WorkspaceSwitcher에서만 호출/workspace/{id}/settings이동시 store만 변경, 서버 저장 없음MainLayout이getSavedWorkspaceAPI로 서버에 저장된 예전 워크스페이스 복원수정
WorkspaceManageLayout에서 URLworkspaceId진입시:saveSelectedWorkspaceAPI 호출로 서버 저장😅 미완성 작업
N/A
📢 논의 사항 및 참고 사항
Summary by CodeRabbit
릴리스 노트
버그 수정
스타일
새로운 기능
리팩토링