Skip to content

feat: 신규 유저, 업데이트 시간 시각화#60

Merged
marulog merged 3 commits intodevelopfrom
feat/#59
Dec 25, 2025
Merged

feat: 신규 유저, 업데이트 시간 시각화#60
marulog merged 3 commits intodevelopfrom
feat/#59

Conversation

@marulog
Copy link
Contributor

@marulog marulog commented Dec 25, 2025

🍀 이슈 번호


✅ 작업 사항

신규 유저의 경우 css 적용 및 아이콘 추가 배치
현재, 과거 구간에 맞춰서 배치 스냅샷 기준 업데이트 시간 표시
image
image


⌨ 기타

제가 디자인은 볼 줄 몰라서 아이콘 2~4개 넣어놨습니다.
맘에 드는걸로 넣고 나머진 빼면 될 것 같아요.

@marulog marulog self-assigned this Dec 25, 2025
@marulog marulog linked an issue Dec 25, 2025 that may be closed by this pull request
2 tasks
@gemini-code-assist
Copy link

Summary of Changes

Hello @marulog, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 랭킹 페이지의 사용자 경험을 개선하기 위해 두 가지 주요 기능을 도입합니다. 첫째, 랭킹 목록에서 새로 등록된 유저를 쉽게 식별할 수 있도록 시각적 표시를 추가했습니다. 둘째, 랭킹 데이터가 언제 마지막으로 업데이트되었는지 사용자에게 명확하게 보여주는 기능을 구현하여 데이터의 신뢰성을 높였습니다.

Highlights

  • 신규 유저 시각화: 랭킹 목록에서 신규 유저를 시각적으로 구분하기 위해 newUser 필드를 추가하고, 해당 유저에게는 특별한 CSS 스타일과 'NEW' 아이콘을 적용했습니다.
  • 업데이트 시간 표시: 랭킹 데이터가 마지막으로 업데이트된 시간을 표시하는 기능을 추가했습니다. API 응답에 updateTime 필드를 포함하고, 이를 사용자 친화적인 형식으로 변환하여 UI에 보여줍니다.
  • API 인터페이스 확장: 랭킹 API 응답 인터페이스에 newUser (개별 랭킹 로우) 및 updateTime (전체 랭킹 페이지) 필드를 추가하여 백엔드와의 데이터 계약을 확장했습니다.
  • 새로운 컴포넌트 추가: 업데이트 시간을 표시하기 위한 RankingUpdateTime 컴포넌트를 새로 생성하여 날짜/시간 포맷팅 로직을 캡슐화했습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

이번 PR은 랭킹 페이지에 신규 유저 시각화 및 데이터 업데이트 시간 표시 기능을 추가하는군요. 신규 유저의 경우 랭킹 테이블에서 특별한 배경색과 아이콘으로 표시되고, 데이터 스냅샷 기준 시각이 기간 선택기 옆에 표시되도록 구현되었습니다. 전반적으로 잘 구현되었지만, 코드의 일관성과 견고성을 높이기 위한 몇 가지 제안 사항이 있습니다.

@@ -1,5 +1,6 @@
import { getTierImageUrl } from "../../constants/tierMap";
import { getTeamLabel, type TeamName } from "@/types/team";
import newPng from "../../assets/images/new444.png";

Choose a reason for hiding this comment

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

medium

이미지 파일을 import 할 때 상대 경로(../../)를 사용하셨습니다. 프로젝트의 다른 부분에서는 경로 별칭(@/)을 일관되게 사용하고 있으므로, 유지보수성과 일관성을 위해 에셋 파일 경로에도 별칭을 사용하는 것이 좋습니다.

Suggested change
import newPng from "../../assets/images/new444.png";
import newPng from "@/assets/images/new444.png";

Comment on lines 8 to 19
const formatUpdateTime = (value: string) => {
const m = value.match(/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})/);
if (!m) return `${value} KST 기준`;

const yyyy = Number(m[1]);
const mm = Number(m[2]);
const dd = Number(m[3]);
const hh = m[4];
const mi = m[5];

return `${yyyy}년 ${mm}월 ${dd}일 ${hh}:${mi} KST 기준`;
};

Choose a reason for hiding this comment

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

medium

formatUpdateTime 함수에서 정규식을 사용하여 날짜 문자열을 파싱하고 있습니다. 이 방식은 날짜 형식이 조금만 바뀌어도(예: 초 단위나 타임존 정보 포함) 코드가 깨지기 쉬운 단점이 있습니다. JavaScript/TypeScript의 내장 new Date() 생성자를 사용하는 것이 더 안정적이고 표준적인 방법입니다.

const formatUpdateTime = (value: string) => {
  const date = new Date(value);
  if (isNaN(date.getTime())) {
    return `${value} KST 기준`;
  }

  const yyyy = date.getFullYear();
  const mm = date.getMonth() + 1;
  const dd = date.getDate();
  const hh = String(date.getHours()).padStart(2, '0');
  const mi = String(date.getMinutes()).padStart(2, '0');

  return `${yyyy}년 ${mm}월 ${dd}일 ${hh}:${mi} KST 기준`;
};

if (!updateTime) return null;

return (
<div className="flex justify-center items-center mb-2">

Choose a reason for hiding this comment

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

medium

RankingUpdateTime 컴포넌트의 최상위 divmb-2 클래스가 적용되어 있습니다. 일반적으로 컴포넌트 자체에서 외부 여백을 지정하면 재사용성이 떨어집니다. 컴포넌트를 사용하는 부모가 레이아웃과 간격을 책임지는 것이 더 좋은 구조입니다. 이미 부모 컴포넌트인 RankingPage에서 gap-3를 사용해 간격을 조절하고 있으므로, 이 클래스는 불필요해 보입니다.

    <div className="flex justify-center items-center">

@sonarqubecloud
Copy link

@marulog marulog merged commit 69bae79 into develop Dec 25, 2025
2 checks passed
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.

feat: 신규 유저, 업데이트 일시 시각화

1 participant