Skip to content

feat(client): Sidebar organization switcher 추가 - #216

Merged
yoonki1207 merged 2 commits into
devfrom
feature/mba-137
Jul 6, 2026
Merged

feat(client): Sidebar organization switcher 추가#216
yoonki1207 merged 2 commits into
devfrom
feature/mba-137

Conversation

@yoonki1207

Copy link
Copy Markdown
Member

변경 사항

  • Sidebar 하단의 현재 organization badge를 organization switcher dropdown으로 변경
  • is_manager 기준으로 내 조직 / 멤버 조직 구분 표시 추가
  • 다른 organization 선택 시 active organization 저장 후 /dashboard로 이동
  • /dashboard가 active organization 변경 event 수신 시 데이터를 재조회하도록 수정
  • organization switcher 동작 문서와 테스트 케이스 갱신

관련 이슈

Closes #MBA-137

변경 유형

  • 버그 수정
  • 새로운 기능
  • 리팩토링
  • 문서 수정
  • 기타

테스트

  • 로컬에서 테스트 완료
  • 기존 테스트 통과 확인
npm run test -- --run app/features/dashboard/components/Sidebar.test.tsx app/dashboard/page.test.tsx
npm run lint
git diff --check

@linear-code

linear-code Bot commented Jul 6, 2026

Copy link
Copy Markdown

MBA-137

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9a980d678b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +221 to +222
const handleActiveOrganizationChanged = () => {
void loadData();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 이전 조직 조회 결과를 무시하세요

대시보드 홈에서 조직 A의 초기 조회나 수동 새로고침이 아직 끝나기 전에 Sidebar에서 조직 B로 전환하면 이 이벤트가 B 조회를 추가로 시작하지만, 기존 A 조회를 취소하거나 request sequence로 폐기하지 않습니다. A의 /apps, 권한, 팀 조회가 B보다 늦게 끝나는 느린 네트워크/대량 데이터 상황에서는 loadData의 후속 setOrganization/setWorkflowRows/setTeams가 새 조직 화면을 다시 A 데이터로 덮어써서 전환 직후 잘못된 조직 홈이 표시될 수 있으니, 활성 조직 변경 시 이전 요청 결과를 무시하는 가드를 추가하는 것이 안전합니다.

Useful? React with 👍 / 👎.

Comment on lines +164 to +167
const [currentResponse, organizationsResponse] = await Promise.all([
apiClient.get('/organizations/current'),
apiClient.get('/organizations'),
]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 조직 목록 실패와 현재 조직 표시를 분리하세요

현재 조직 조회는 성공했지만 새로 추가한 /organizations 목록 조회만 일시적으로 실패하는 경우에도 Promise.all 전체가 reject되어 catch에서 조직명, manager 여부, 목록을 모두 비웁니다. 이러면 기존에는 표시되던 현재 조직 badge와 manager-only 관리 navigation이 숨겨져서 조직 전환 기능의 보조 데이터 실패가 핵심 navigation까지 깨뜨리므로, /organizations/current 결과는 유지하고 목록 조회 실패 시에만 switcher 목록을 비활성화하는 식으로 분리하는 것이 안전합니다.

Useful? React with 👍 / 👎.

setOrganizationName(response.data.name);
const [currentResponse, organizationsResponse] = await Promise.all([
apiClient.get('/organizations/current'),
apiClient.get('/organizations'),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 초대 수락 후 조직 목록을 갱신하세요

Sidebar의 organization 목록은 mount와 active organization 변경 이벤트에서만 다시 가져오는데, 같은 Sidebar의 알림 overlay에서 조직 초대를 수락하면 backend는 membership을 active로 바꾸고 notifications.changed만 보내며 active organization 변경 이벤트는 발생하지 않습니다. 따라서 사용자가 초대를 수락한 직후 새 조직이 switcher dropdown에 나타나지 않아 페이지를 새로고침해야 전환할 수 있으니, 초대 수락 성공 후 이 목록도 재조회하도록 연결해야 합니다.

Useful? React with 👍 / 👎.

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