Skip to content

Conversation

@toothlessdev
Copy link
Member

@toothlessdev toothlessdev commented Sep 8, 2025

✅ Linked Issue

Summary by CodeRabbit

  • New Features

    • Competition rankings now limited to the Top 20 schools; Top 3 are derived from this list.
  • Bug Fixes

    • Hide the “previous rank/gap” column for the first row to prevent misleading data.
    • Improved spacing in the gap display for clearer readability.
  • Refactor

    • Simplified per-row rank and gap calculation logic for the rankings table without changing behavior or public APIs.

@coderabbitai
Copy link

coderabbitai bot commented Sep 8, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The competition page now limits topRatedSchools to the top 20 by paidApplicationCount. RankTableRow conditionally renders the third column only when prevRank !== 0. RankTableSection refactors row computation, explicitly handling the first row and calculating gaps based on the previous item.

Changes

Cohort / File(s) Summary
Competition page data limiting
mosu-app/src/pages/events/competition/index.tsx
Sorts by paidApplicationCount desc, slices to top 20 for topRatedSchools; top3Schools derived from the first 3 of this list; no API signature changes; revalidate unchanged.
Competition widgets rendering
mosu-app/src/widgets/competition/RankTableRow.tsx, mosu-app/src/widgets/competition/RankTableSection.tsx
Row: third cell (prevRank/gap) renders only if prevRank !== 0; adds nbsp before gap. Section: introduces rank variable, early return for first row with prevRank=0/gap=0; computes gap from previous item for subsequent rows; signatures unchanged.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor U as User
  participant P as CompetitionPage
  participant D as Data Source
  participant S as RankTableSection
  participant R as RankTableRow

  U->>P: Request /events/competition
  P->>D: Fetch schools with paidApplicationCount
  D-->>P: List of schools
  note over P: Sort desc by paidApplicationCount<br/>Slice top 20 -> topRatedSchools<br/>top3Schools = first 3
  P->>S: Render with topRatedSchools

  loop For each school (index i)
    alt i == 0
      S->>R: rank=1, prevRank=0, gap=0
      note over R: Third column omitted (prevRank == 0)
    else i > 0
      S->>S: gap = prev.paidApplicationCount - curr.paidApplicationCount<br/>prevRank = i
      S->>R: rank=i+1, prevRank=i, gap=gap
      note over R: Third column rendered with nbsp before gap
    end
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I sift through ranks with twitching nose,
Top twenty carrots neatly chose. 🥕
First place hops—no gap to show,
Next ones follow, gaps in tow.
Tables turn with subtle grace,
A tidy race in data space.
Thump! Approved—now set the pace.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ee516da and d5143cb.

📒 Files selected for processing (3)
  • mosu-app/src/pages/events/competition/index.tsx (1 hunks)
  • mosu-app/src/widgets/competition/RankTableRow.tsx (1 hunks)
  • mosu-app/src/widgets/competition/RankTableSection.tsx (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature#388

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 and usage tips.

@toothlessdev toothlessdev moved this to 진행중 in mosu-client Sep 8, 2025
@vercel
Copy link

vercel bot commented Sep 8, 2025

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

Project Deployment Preview Comments Updated (UTC)
mosu-client Building Building Preview Comment Sep 8, 2025 5:59pm

@toothlessdev toothlessdev merged commit 120d918 into main Sep 8, 2025
4 of 6 checks passed
@toothlessdev toothlessdev deleted the feature#388 branch September 8, 2025 18:00
@github-project-automation github-project-automation bot moved this from 진행중 to 완료 in mosu-client Sep 8, 2025
@github-actions
Copy link

github-actions bot commented Sep 8, 2025

Warnings
⚠️ PR에 Reviewers가 지정되어 있지 않습니다. 리뷰어를 지정해주세요.
Messages
📖 ✅ PR 제목에 이슈 번호가 포함되어 있습니다.
📖 ✅ PR에 라벨이 지정되어 있습니다.
📖 ✅ PR에 Assignees가 지정되어 있습니다.
📖 ✅ package.json에 변경사항이 없습니다.
📖 ✅ 브랜치 이름 'feature#388'이 컨벤션을 따릅니다.
📖 ✅ TypeScript 컴파일이 성공적으로 완료되었습니다.
📖 ✅ ESLint 검사 결과 문제가 없습니다.

📝 추가 및 변경된 파일

총 3개 파일 변경

└── 📂 mosu-app/
    └── 📂 src/
        ├── 📂 pages/
        │   └── 📂 events/
        │       └── 📂 competition/
        │           └── ⚛️ index.tsx
        └── 📂 widgets/
            └── 📂 competition/
                ├── ⚛️ RankTableRow.tsx
                └── ⚛️ RankTableSection.tsx

Generated by 🚫 dangerJS against d5143cb

@github-actions
Copy link

github-actions bot commented Sep 8, 2025

📚 Storybook이 Chromatic에 배포되었습니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: 완료

Development

Successfully merging this pull request may close these issues.

2 participants