Skip to content

Conversation

six-standard
Copy link
Member

@six-standard six-standard commented May 26, 2025

🔥 변경 사항

리더보드의 긴 텍스트가 덜 잘리도록 UI를 개선하였습니다.

🏷 관련 이슈

  • 관련 이슈: #198

📸 스크린샷 (UI 변경 시 필수)

스크린샷 2025-05-26 오전 9 25 28

📌 체크리스트

  • 기능이 정상적으로 동작하는지 테스트 완료
  • 코드 스타일 가이드 준수 여부 확인
  • 관련 문서 업데이트 완료 (필요 시)

Summary by CodeRabbit

  • 신규 기능

    • 리더보드에서 랭킹 항목을 표시하는 새로운 Rank 컴포넌트가 도입되었습니다.
  • 버그 수정

    • 리더보드에서 상위 3위에 대한 별도 레이아웃 및 반응형 스타일링이 제거되어 모든 랭킹이 동일한 방식으로 표시됩니다.
  • 리팩터

    • 불필요한 Ranker 컴포넌트 및 관련 파일들이 삭제되어 코드가 단순화되었습니다.
    • 컴포넌트 import 경로가 정리되어 관리가 용이해졌습니다.
    • 일부 import 경로가 더 넓은 모듈로 변경되어 일관성이 향상되었습니다.
    • 유틸리티 모듈의 중앙집중식 재수출 파일이 제거되었습니다.

@six-standard six-standard self-assigned this May 26, 2025
@six-standard six-standard added the enhancement New feature or request label May 26, 2025
Copy link

리더보드 UI 개선

Copy link

coderabbitai bot commented May 26, 2025

## Walkthrough

리더보드 UI 구성 요소가 단순화되었습니다. `Ranker` 컴포넌트와 관련 파일들이 제거되고, `Rank` 컴포넌트만을 사용하여 모든 랭크 항목을 동일한 방식으로 렌더링하도록 변경되었습니다. import 경로도 정리되었습니다.

## Changes

| 파일/경로                                                               | 변경 요약                                                                                      |
|-------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|
| src/app/(auth-required)/layout.tsx                                      | `Notice``Header` import를 하나의 경로로 합침                                                |
| src/app/(auth-required)/leaderboards/Content.tsx                        | `Ranker`/`useResponsive`/`SCREENS` 제거, `Rank`만 사용하여 단순화된 리스트 렌더링                |
| src/app/(auth-required)/leaderboards/Rank.tsx                           | 새로운 `Rank` 컴포넌트 및 인터페이스 추가                                                      |
| src/app/(auth-required)/leaderboards/components/Rank.tsx                | 기존 `Rank` 컴포넌트 파일 삭제                                                                 |
| src/app/(auth-required)/leaderboards/components/Ranker.tsx              | `Ranker` 컴포넌트 및 인터페이스 삭제                                                           |
| src/app/(auth-required)/leaderboards/components/index.ts                | `Ranker`/`Rank` 통합 re-export index 파일 삭제                                                 |
| src/app/(auth-required)/components/header/index.tsx                     | `useModal` import 경로 변경 (`@/hooks/useModal``@/hooks`)                                   |
| src/app/(auth-required)/components/notice/index.tsx                     | `useModal` import 경로 변경 (`@/hooks/useModal``@/hooks`)                                   |
| src/app/(auth-required)/leaderboards/page.tsx                           | `leaderboardList` import 경로 변경 (`@/apis/leaderboard.request``@/apis`)                   |
| src/app/(auth-required)/main/Content.tsx                                | `useSearchParam` import 경로 변경 (`@/hooks/useSearchParam``@/hooks`)                       |
| src/app/(auth-required)/main/components/Section/index.tsx               | import 순서 변경 및 미사용 `ForwardedRef` 제거                                                 |
| src/types/index.ts                                                      | `./leaderboard.type` 모듈 export 추가                                                         |
| src/utils/index.tsx                                                     | `componentUtil`, `numberUtil`, `dateUtil` 통합 re-export 파일 삭제                             |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
  participant User
  participant Content
  participant Rank

  User->>Content: 페이지 접근
  Content->>Rank: 각 랭킹 데이터로 Rank 컴포넌트 호출
  Rank-->>Content: 랭킹 UI 반환
  Content-->>User: 전체 리더보드 UI 렌더링

Possibly related PRs

Suggested reviewers

  • Nuung
  • Jihyun3478

Poem

리더보드 위에 토끼가 깡총
Ranker는 안녕, Rank만 남아
줄 맞춰 모두가 반짝이는 순간
코드도 심플, UI도 산뜻
🥕 점수도 랭크도 토끼처럼 쏙!


<!-- walkthrough_end -->
<!-- This is an auto-generated comment: all tool run failures by coderabbit.ai -->

> [!WARNING]
> There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.
> 
> <details>
> <summary>🔧 ESLint</summary>
> 
> > If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.
> 
> <details>
> <summary>src/app/(auth-required)/leaderboards/Rank.tsx</summary>
> 
> 
> Oops! Something went wrong! :(
> 
> ESLint: 8.57.1
> 
> Error: Failed to load parser '@typescript-eslint/parser' declared in '.eslintrc.js': Cannot find module '@typescript-eslint/parser'
> Require stack:
> - /.eslintrc.js
>     at Module._resolveFilename (node:internal/modules/cjs/loader:1405:15)
>     at require.resolve (node:internal/modules/helpers:145:19)
>     at Object.resolve (/node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2346:46)
>     at ConfigArrayFactory._loadParser (/node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3325:39)
>     at ConfigArrayFactory._normalizeObjectConfigDataBody (/node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3099:43)
>     at _normalizeObjectConfigDataBody.next (<anonymous>)
>     at ConfigArrayFactory._normalizeObjectConfigData (/node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3040:20)
>     at _normalizeObjectConfigData.next (<anonymous>)
>     at ConfigArrayFactory.loadInDirectory (/node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2886:28)
>     at CascadingConfigArrayFactory._loadConfigInAncestors (/node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3871:46)
> 
> </details>
> 
> </details>

<!-- end of auto-generated comment: all tool run failures by coderabbit.ai -->


---

<details>
<summary>📜 Recent review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**


<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 2a2b280ff0ad145ac5044c3e08eeca839305926e and 204e5d5317ecc7e60d3d1349ee3468adc9985075.

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* `src/app/(auth-required)/leaderboards/Rank.tsx` (1 hunks)

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (1)</summary>

* src/app/(auth-required)/leaderboards/Rank.tsx

</details>

</details>
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKNwSPbABsvkCiQBHbGlcSHFcLzpIACIAbQAmAFYNSAAGZMh4gDZIAHoYAEEAZQBpMABGAE4ADgBdSBsSADM0MXw+KEAazsAVZsAXnsAdlsgAVQBJSEAcGsACQejIAHc0ZAcBZnUaejkw2A9sREp7eAAPMERcTFpnegXrOwxHAT2AZgB2FCxcLb8SbnxEdXbZFLuSDMbRYBiwTCkV4SfBeKTIeDMXj4CTwDBETYeSJoJQUAT4C7DMYET60bAMDzvSkUbAYBjUeD4LD4JqQLxMjE0A6hdgUeDSQEIZBkCF0khsDChbTMZAkkEAa0pH2xuPxhNoSG4XjQ8mY7Q8/hxKkikA2aB8+FmaIx7PRey5oRJ93ssEtWCt7zZ0mQDDw4nR/CaTQ0bg+2G45xo6FotH8iF2CPjwUgZiq1XQGHoaIYXmwSmQaHsDH8ZEQrtCSj1GBOVH9nI+o0YotIiEFHkQxZIpfLLstsuVJBxlDVFCzksoLQpc3UsBQSIoKKiDsgqN+ai86gBoY84NE8o3JwUGCa8AoMs21ExkCatLEjIw5s3kAhMi7bxCUTOc3a8p97X8YheLIAA0V5MEo9i4LIJpENg8BKBu5DIBCUimm+16wuysx0KBX7+JEEiYBW+C+hKpziEyz5XPcZCQOGkafsg5B0HQIYGPoxjgFAZD0CyOAEMQZDKGsCisOwXC8PwwiiOI8KmvI4HKKo6haDoHEmFAcCoKgmD8YQpDkLWURMGJkpcFQsz2I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6Czo25B5NxDunxNsvpHsxzqZJwEvJZI2fIBsIpFQMpM5GpLGxpKJCsLgAAPrwSIBlv+CogaZ0BluNTxwcQGDFupBNCpA4iJAAAsiKzw5QDwlQWQ1Q1QDA5QTQXbAgTQlQDASg6QJAE7JAiQ1QtAWQlQlQXbrkhgxb8QaA8QAg8Q1Qbb7bOI5QXbiQrQiQqQXbPbDwJAqQ1QXY9I1QA7Dw6QlQ2QHg6kXEmQV7i7tAiQDw5QTwogDAwHWQqQtADwtA/bXblQXYDwXbQ7OIDAa71Ql7TwiQm7cbJb6gFb821bvc/IJ6ZbPEm7QAA=== -->

<!-- internal state end -->
<!-- finishing_touch_checkbox_start -->

<details open="true">
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---

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.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=Check-Data-Out/velog-dashboard-v2-fe&utm_content=37):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Explain this complex logic.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai explain this code block.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and explain its main purpose.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
src/app/(auth-required)/leaderboards/Rank.tsx (3)

4-9: 인터페이스 정의가 좋습니다.

HTMLDivElement 속성을 확장하여 추가적인 div 속성들을 받을 수 있도록 한 것이 좋습니다. 하지만 컴포넌트 구현부에서 이런 추가 속성들을 실제로 전달하지 않고 있습니다.

다음과 같이 추가 속성들을 전달하도록 개선할 수 있습니다:

-export const Rank = ({ name, rank, count, suffix = '회' }: IProp) => {
+export const Rank = ({ name, rank, count, suffix = '회', ...rest }: IProp) => {
   return (
     <div
       className={twMerge(
         'min-w-[40%] w-full p-[25px] bg-BG-SUB rounded-[4px] gap-3 justify-between flex',
         rank - 1 <= 2 ? `border-2 ${colorTable[rank - 1]}` : 'border-0',
       )}
+      {...rest}
     >

11-11: 하드코딩된 색상값 개선 권장.

상위 3개 순위의 테두리 색상이 하드코딩된 hex 값으로 되어 있습니다. 디자인 시스템의 색상 토큰을 사용하는 것이 유지보수에 더 좋을 것 같습니다.

다음과 같이 디자인 시스템 색상을 사용하도록 개선할 수 있습니다:

-const colorTable = ['border-[#DAA520]', 'border-[#A9A9A9]', 'border-[#B87333]'];
+const colorTable = ['border-gold', 'border-silver', 'border-bronze'];

또는 프로젝트의 Tailwind 색상 팔레트에 맞는 색상으로 변경하는 것을 고려해보세요.


13-33: 컴포넌트 구현이 잘 되었습니다.

전반적으로 잘 구현된 컴포넌트입니다. 상위 3개 순위에 대한 조건부 스타일링과 반응형 디자인이 잘 적용되어 있습니다.

몇 가지 작은 개선 사항을 제안합니다:

  1. 순위 검증 추가: rank 매개변수에 대한 최소 검증을 추가하는 것이 좋겠습니다.
  2. 매직 넘버 상수화: rank - 1 <= 2 조건을 더 명확하게 만들 수 있습니다.
+const TOP_RANKS_COUNT = 3;
+
 export const Rank = ({ name, rank, count, suffix = '회' }: IProp) => {
+  if (rank < 1) {
+    console.warn('Rank should be 1 or greater');
+  }
+
   return (
     <div
       className={twMerge(
         'min-w-[40%] w-full p-[25px] bg-BG-SUB rounded-[4px] gap-3 justify-between flex',
-        rank - 1 <= 2 ? `border-2 ${colorTable[rank - 1]}` : 'border-0',
+        rank <= TOP_RANKS_COUNT ? `border-2 ${colorTable[rank - 1]}` : 'border-0',
       )}
     >
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 82a39a1 and 0f0ad54.

📒 Files selected for processing (6)
  • src/app/(auth-required)/layout.tsx (1 hunks)
  • src/app/(auth-required)/leaderboards/Content.tsx (2 hunks)
  • src/app/(auth-required)/leaderboards/Rank.tsx (1 hunks)
  • src/app/(auth-required)/leaderboards/components/Rank.tsx (0 hunks)
  • src/app/(auth-required)/leaderboards/components/Ranker.tsx (0 hunks)
  • src/app/(auth-required)/leaderboards/components/index.ts (0 hunks)
💤 Files with no reviewable changes (3)
  • src/app/(auth-required)/leaderboards/components/index.ts
  • src/app/(auth-required)/leaderboards/components/Rank.tsx
  • src/app/(auth-required)/leaderboards/components/Ranker.tsx
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/app/(auth-required)/leaderboards/Content.tsx (1)
src/app/(auth-required)/leaderboards/Rank.tsx (1)
  • Rank (13-33)
🔇 Additional comments (4)
src/app/(auth-required)/layout.tsx (1)

6-6: 좋은 리팩토링입니다!

Import 경로를 통합하여 코드가 더 깔끔해졌습니다. 기능상 변화 없이 가독성을 개선한 좋은 변경사항입니다.

src/app/(auth-required)/leaderboards/Content.tsx (3)

7-8: Import 정리가 잘 되었습니다.

반응형 로직 관련 import들을 제거하고 새로운 Rank 컴포넌트만 import하도록 정리한 것이 좋습니다.


11-11: 통합된 Rank 컴포넌트 사용 승인.

새로운 Rank 컴포넌트로 통합하여 코드를 단순화한 것이 좋습니다.


88-92: 리더보드 렌더링 로직 단순화 우수.

기존의 복잡한 반응형 로직과 상위 3개 순위에 대한 별도 처리를 제거하고, 모든 순위 항목을 동일한 Rank 컴포넌트로 렌더링하도록 단순화한 것이 훌륭합니다. 이는 PR 목표인 텍스트 잘림 현상 개선과 가독성 향상에 도움이 될 것입니다.

Copy link
Member

@Nuung Nuung left a comment

Choose a reason for hiding this comment

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

좋았던 점

  • rank 를 단일화 하면서 확실하게 컴포넌트로 빼낸 점이 아주 좋았어요.
  • (props) type 들도 빼먹지 않고 좋았어요!

아쉬운 점

  • 짜잘한 것들인데, 코멘트 한 번 확인해주세요~
  • Rank 대신 RankRow 가 컴포넌트 이름으로 더 맞지 않을까요?!

@six-standard six-standard requested a review from Nuung May 27, 2025 01:14
Copy link
Member

@Nuung Nuung left a comment

Choose a reason for hiding this comment

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

오케이! 리뷰잉 반영 모두 확인했습니다! 서브 component 디렉토리가 있다는걸 깜빡했네요

Copy link

@Jihyun3478 Jihyun3478 left a comment

Choose a reason for hiding this comment

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

좋았던 점

  • UI가 전보다 훨씬 직관적이고 예뻐진 것 같아요!!!👍 빠른 반영 감사합니다!!
  • Rank 컴포넌트로 역할을 명확히 분리해주신 점이 좋았습니다!

Copy link

@ooheunda ooheunda left a comment

Choose a reason for hiding this comment

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

개선된 UI 보기 좋네요! 고생하셨습니다~! 👍 🔥

좋았던 점

  • import 경로들 수정된거 편-안해지네요!

@six-standard six-standard merged commit eaabf95 into main May 28, 2025
1 check passed
@six-standard six-standard deleted the refactor/leaderboard-ui branch May 28, 2025 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants