Skip to content

[Feature/#377] AI 분석 결과 조직 공유 조회 API 연동 - #391

Merged
Seojegyeong merged 4 commits into
developfrom
feature/#377
Aug 4, 2026
Merged

[Feature/#377] AI 분석 결과 조직 공유 조회 API 연동#391
Seojegyeong merged 4 commits into
developfrom
feature/#377

Conversation

@Seojegyeong

@Seojegyeong Seojegyeong commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

🚨 관련 이슈

#377

✨ 변경사항

  • 🐞 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.)

✏️ 작업 내용

  • GET /api/ai/organizations/{orgId}/reports 연동(대시보드 진입 시 조직 공유 최신 리포트 우선 조회)
    - 조회 결과 있을 때: POST 없이 해당 accessToken으로 바로 렌더링 (FAILED 건은 채택 안 함)
    - 조회 결과 없을 때: 카드 펼침 시 기존 POST → 폴링 플로우로 자동 fallback
  • 사용자가 "다시 분석" 요청 시: skipSharedLookup = true 설정으로 POST 플로우 명시 실행
  • 공유 리포트 렌더링 시 카드에 팀 공유 분석 생성일 표시 (예: 분석 기준 2026.06.24 ~ 2026.07.07 · 팀 공유 분석 (2026.07.05))
  • 공유 조회 진행 중 카드 펼침 시 결과 없으면 POST fallback 미실행되던 버그 수정

😅 미완성 작업

N/A

📢 논의 사항 및 참고 사항

N/A

스크린샷

스크린샷 2026-08-04 오후 1 37 54

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

Summary by CodeRabbit

  • 개선 사항
    • 최신 팀 공유 분석 결과가 있으면 해당 결과와 생성 날짜를 우선 표시합니다.
    • 공유 분석 결과를 확인하는 동안 불필요한 분석 요청이 발생하지 않도록 개선했습니다.
    • 공유 결과가 없을 때만 새로운 분석을 실행하며, 재시도 시 기존 상태를 유지합니다.
    • 제공자 또는 워크스페이스 변경 시 분석 상태가 올바르게 초기화됩니다.

@Seojegyeong
Seojegyeong requested review from YermIm and jjjsun August 4, 2026 04:31
@Seojegyeong Seojegyeong self-assigned this Aug 4, 2026
@Seojegyeong Seojegyeong added the ✨ Feature 기능 개발 label Aug 4, 2026
@Seojegyeong Seojegyeong linked an issue Aug 4, 2026 that may be closed by this pull request
3 tasks
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 47 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

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

Plan: Pro Plus

Run ID: d235f92d-43d3-471a-9e2b-44a1ca7e660f

📥 Commits

Reviewing files that changed from the base of the PR and between 611d92b and b0e1ed3.

⛔ Files ignored due to path filters (1)
  • tests/ai-analysis.spec.ts is excluded by none and included by none
📒 Files selected for processing (7)
  • src/api/dashboard/aiAnalysis.ts
  • src/components/dashboard/ai-report/components/AiSummaryCard.tsx
  • src/components/dashboard/ai-report/components/DashboardAiSummarySection.tsx
  • src/constants/dashboard/overviewMetricsRange.ts
  • src/hooks/dashboard/useAiAnalysisReport.ts
  • src/lib/queryKeys.ts
  • src/types/dashboard/aiAnalysis.ts
📝 Walkthrough

Walkthrough

조직의 최신 공유 AI 리포트를 먼저 조회합니다. 유효한 리포트가 있으면 POST 없이 해당 리포트를 사용합니다. 공유 리포트가 없으면 분석 요청으로 전환합니다. 요약 카드는 조회 상태와 생성 시각을 표시합니다.

Changes

공유 AI 리포트 흐름

Layer / File(s) Summary
공유 리포트 조회 및 요청 제어
src/hooks/dashboard/useAiAnalysisReport.ts
최신 조직 공유 리포트를 조회합니다. 유효한 리포트는 해당 토큰으로 폴링합니다. 명시적 분석 요청은 공유 조회를 건너뛰고 POST를 실행합니다. 조회 상태와 생성 시각을 반환합니다.
요약 카드 상태 및 표시 연동
src/components/dashboard/ai-report/components/DashboardAiSummarySection.tsx
공유 조회 중 확장 요청을 보류합니다. 공유 결과가 없으면 POST 분석 요청으로 전환합니다. 재시도는 상태 초기화 없이 분석 요청만 실행합니다. 기간 라벨에 공유 리포트 생성 시각을 표시합니다.

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

Possibly related issues

Possibly related PRs

Suggested labels: 📬 API

Suggested reviewers: jjjsun, yermim

Sequence Diagram(s)

sequenceDiagram
  participant 사용자
  participant DashboardAiSummarySection
  participant useAiAnalysisReport
  participant 조직리포트API

  사용자->>DashboardAiSummarySection: 카드 확장
  DashboardAiSummarySection->>useAiAnalysisReport: 분석 상태 요청
  useAiAnalysisReport->>조직리포트API: 최신 공유 리포트 조회
  조직리포트API-->>useAiAnalysisReport: 공유 리포트 또는 없음
  alt 유효한 공유 리포트 존재
    useAiAnalysisReport-->>DashboardAiSummarySection: 공유 토큰과 생성 시각
  else 공유 리포트 없음
    DashboardAiSummarySection->>useAiAnalysisReport: POST 분석 요청
  end
  useAiAnalysisReport-->>DashboardAiSummarySection: 로딩 및 분석 결과 상태
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed 조직 공유 AI 분석 결과 조회 API 연동이라는 주요 변경 사항을 구체적으로 설명합니다.
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 feature/#377

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 Aug 4, 2026

Copy link
Copy Markdown

📚 Storybook 배포 완료

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

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

🤖 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/dashboard/ai-report/components/DashboardAiSummarySection.tsx`:
- Around line 61-73: Prevent the fallback effect in
src/components/dashboard/ai-report/components/DashboardAiSummarySection.tsx:61-73
from calling requestAnalysis when a usable shared report exists, while keeping
hasUsableSharedReport out of that effect’s dependency array. In
src/hooks/dashboard/useAiAnalysisReport.ts:88-105, compute hasUsableSharedReport
from sharedReportListQuery.isSuccess, a non-null latest report, and
latest.status !== "FAILED"; expose it from the hook at
src/hooks/dashboard/useAiAnalysisReport.ts:243-249 and consume it in
DashboardAiSummarySection.tsx:32-41. Add regression coverage verifying
requestAiAnalysis is not called while a usable PENDING or SUCCESS shared report
is being resolved.
🪄 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 Plus

Run ID: e3f3a3d5-d162-4896-a54c-8bf5cd85d21f

📥 Commits

Reviewing files that changed from the base of the PR and between cb04440 and 611d92b.

📒 Files selected for processing (2)
  • src/components/dashboard/ai-report/components/DashboardAiSummarySection.tsx
  • src/hooks/dashboard/useAiAnalysisReport.ts

@jjjsun jjjsun 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: 확인했습니다!

@Seojegyeong
Seojegyeong merged commit a75cf48 into develop Aug 4, 2026
3 checks passed
@Seojegyeong
Seojegyeong deleted the feature/#377 branch August 4, 2026 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feature 기능 개발

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ [Feature] AI 분석 결과 조직 공유 조회 API 연동

2 participants