Skip to content

fix: 캘린더 페이지 기본 선택 날짜 및 스타일 수정#76

Merged
JiWoongE merged 3 commits into
developfrom
Fix/#75/calendar-page-date-selection
Jul 21, 2026
Merged

fix: 캘린더 페이지 기본 선택 날짜 및 스타일 수정#76
JiWoongE merged 3 commits into
developfrom
Fix/#75/calendar-page-date-selection

Conversation

@JiWoongE

@JiWoongE JiWoongE commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Pull Request

작업 내용

  • 캘린더 페이지의 기본 선택 날짜가 특정 날짜(2025-07-30)로 고정되던 문제를 수정했습니다.
  • 캘린더 페이지에서 선택된 날짜 셀의 강조 배경색을 메인 브랜드 보라 계열로 조정했습니다.

작업 결과

  • 캘린더 페이지 진입 시 오늘 날짜가 기본 선택됩니다.
  • 선택된 날짜가 브랜드 컬러 톤으로 표시되어 화면 일관성이 개선됩니다.
  • npm run typecheck 통과했습니다.

변경 사항

Added

  • 오늘 날짜를 ISO 문자열로 계산하는 초기 선택 날짜 유틸 추가

Changed

  • 캘린더 초기 월 기준을 현재 월 기준으로 변경
  • 캘린더 선택 셀 배경색을 보라 계열로 조정

Fixed

  • 캘린더 페이지 기본 선택 날짜가 하드코딩되어 있던 문제 수정

실행화면

  • 캘린더 페이지 진입 시 오늘 날짜 선택 상태 확인
  • 날짜 선택 시 보라 계열 강조 스타일 확인

테스트

  • 로컬 실행 확인
  • 주요 시나리오 확인
  • 영향 범위 확인

리뷰 체크리스트

  • PR base branch가 올바릅니다. (feature/* -> develop, 배포 시 develop 또는 release/* -> main)
  • 브랜치명이 Type/#issue-number/description 형식을 따릅니다.
  • 커밋 메시지가 컨벤션을 따릅니다.
  • 불필요한 console.log, 주석, 임시 코드를 제거했습니다.
  • 타입 에러와 린트 에러를 확인했습니다.
  • CodeRabbit 1차 리뷰를 확인했습니다.
  • CodeRabbit 리뷰 반영 후 Discord에 공유했습니다.
  • 최소 1명 이상의 approve 후 merge합니다.

리뷰 요청사항

  • 캘린더 페이지 진입 시 오늘 날짜를 기본 선택으로 두는 흐름이 현재 UX 의도와 맞는지 확인 부탁드립니다.
  • 선택 날짜 강조 색상의 브랜드 톤이 디자인 가이드와 어긋나지 않는지 함께 봐주시면 좋겠습니다.

관련 이슈

Closes #75

Summary by CodeRabbit

  • 개선 사항
    • 캘린더 초기 표시 기준을 현재 월의 1일로 설정해 더 일관된 월 보기 경험을 제공합니다.
    • 초기 선택 날짜가 자동으로 “오늘(Asia/Seoul 기준)”으로 설정됩니다.
    • 선택된 날짜 셀의 배경 스타일을 브랜드 톤 기반으로 변경해 시각적 구분을 강화했습니다.

@vercel

vercel Bot commented Jul 20, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
syncly Ready Ready Preview, Comment Jul 21, 2026 5:09am

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

캘린더의 초기 선택 날짜를 서울 시간대의 현재 날짜에서 계산해 전달하고, 이를 기준으로 월과 선택 상태를 초기화합니다. 날짜 유틸리티의 공개 API를 갱신하고 선택된 날짜 셀의 배경 스타일을 브랜드 색상으로 변경했습니다.

Changes

캘린더 날짜 선택

Layer / File(s) Summary
서울 기준 초기 날짜 생성
src/app/workspaces/[workspaceId]/calendar/page.tsx
서울 시간대의 현재 날짜를 YYYY-MM-DD 형식으로 생성해 CalendarPage에 전달합니다.
초기 날짜 prop 전달
src/views/calendar/ui/CalendarPage.tsx
initialSelectedDate prop을 추가하고 CalendarView로 전달합니다.
캘린더 초기화 및 선택 스타일
src/features/manage-calendar/model/calendar-utils.ts, src/features/manage-calendar/ui/CalendarView.tsx
ISO 날짜에서 월 시작일을 생성하는 함수를 추가하고, 캘린더의 월·선택 날짜 초기값을 전달받은 날짜로 설정하며 선택 셀 배경을 bg-brand/12로 변경합니다.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

Possibly related PRs

  • TeampleRun/syncly#35 — 동일한 캘린더 라우트와 CalendarPage·CalendarView 초기화 경로를 추가한 변경입니다.

Suggested reviewers: kwon812

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 제목이 캘린더 기본 선택 날짜 수정과 선택 스타일 변경이라는 핵심 변경을 정확히 요약합니다.
Description check ✅ Passed 작업 내용, 결과, 변경 사항, 테스트, 리뷰 체크리스트, 관련 이슈가 템플릿에 맞게 모두 채워져 있습니다.
Linked Issues check ✅ Passed #75의 기본 날짜 오늘 설정과 브랜드 보라 계열 스타일 보정 요구를 코드 변경이 충족합니다.
Out of Scope Changes check ✅ Passed 핵심 요구인 날짜 초기화와 선택 스타일 수정 외에 눈에 띄는 무관한 변경은 없습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 Fix/#75/calendar-page-date-selection

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.

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

🤖 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/features/manage-calendar/model/calendar-utils.ts`:
- Around line 39-44: Update the CalendarView initial-state flow that uses
getInitialSelectedCalendarDate and the current-date utility so it does not
evaluate new Date() during SSR and client hydration. Prefer calculating the
reference date in the server component and passing it through an initialDate
prop; otherwise initialize with a stable value and set the current date in
useEffect after mount, preserving the existing date format.

In `@src/features/manage-calendar/ui/CalendarView.tsx`:
- Line 231: Replace the hardcoded rgba selection background in the CalendarView
selection class with Tailwind’s brand color alpha utility bg-brand/12,
preserving the existing conditional application of the selected-state styling.
🪄 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: ASSERTIVE

Plan: Pro Plus

Run ID: 930d9e57-5789-4fa4-a7ec-311e61ab9d9b

📥 Commits

Reviewing files that changed from the base of the PR and between c7fff64 and 9ca7273.

📒 Files selected for processing (2)
  • src/features/manage-calendar/model/calendar-utils.ts
  • src/features/manage-calendar/ui/CalendarView.tsx

Comment on lines +39 to +44
const now = new Date();
return new Date(now.getFullYear(), now.getMonth(), 1);
}

export function getInitialSelectedCalendarDate() {
return formatIsoDate(new Date());

@coderabbitai coderabbitai Bot Jul 20, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Next.js SSR 환경에서의 Hydration 불일치 위험

이 유틸리티 함수들은 CalendarView의 초기 상태(useState) 설정에 사용되고 있습니다. new Date()를 클라이언트 컴포넌트의 초기값으로 직접 평가하면, 서버 렌더링 시점(보통 UTC)과 클라이언트 하이드레이션 시점(유저 로컬 타임존)의 날짜가 다를 경우(예: 자정 부근) 렌더링된 마크업이 일치하지 않아 React Hydration 에러가 발생할 수 있습니다.

권장 해결 방안:
안전한 렌더링을 위해 서버 컴포넌트에서 기준 날짜를 계산하여 CalendarView에 props(예: initialDate)로 주입하는 구조를 권장합니다. 부득이하게 클라이언트에서만 동적으로 날짜를 설정해야 한다면, 초기에는 고정된 값이나 빈 상태를 유지하고 useEffect를 통해 마운트된 이후에 현재 날짜를 설정해 주세요.

🤖 Prompt for 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.

In `@src/features/manage-calendar/model/calendar-utils.ts` around lines 39 - 44,
Update the CalendarView initial-state flow that uses
getInitialSelectedCalendarDate and the current-date utility so it does not
evaluate new Date() during SSR and client hydration. Prefer calculating the
reference date in the server component and passing it through an initialDate
prop; otherwise initialize with a stable value and set the current date in
useEffect after mount, preserving the existing date format.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

동의합니다. 서버 컴포넌트에서 기준 날짜를 계산해 initialDate로 전달하거나, 클라이언트에서 처리해야 한다면 초기값을 고정한 뒤 마운트 이후 현재 날짜를 설정하도록 보완하면 좋겠습니다.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@seongjinss555 네, 감사합니다. 서버 컴포넌트에서 기준 날짜를 계산해 initialDate로 전달하는 방식이 SSR과 hydration 간 일관성을 가장 잘 보장합니다. 해당 구조가 어려우면, 클라이언트에서는 안정적인 초기값으로 렌더링한 뒤 useEffect에서 오늘 날짜를 설정하는 대안도 괜찮습니다.

수정 후에는 자정 전후 및 서로 다른 타임존에서도 hydration 경고 없이 선택 날짜와 월이 정상 표시되는지 확인하면 좋겠습니다. 🐰

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

클라이언트 컴포넌트 초기 상태에서 new Date()를 직접 평가하면 SSR/CSR 타임존 차이로 hydration mismatch가 발생할 수 있어, 초기 날짜 계산을 서버 컴포넌트로 이동했습니다.

/workspaces/[workspaceId]/calendar/page.tsx에서 Asia/Seoul 기준 날짜 문자열을 계산해 initialSelectedDate props로 내려주고, CalendarView는 해당 값을 초기 상태로만 사용하도록 수정했습니다.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Comment thread src/features/manage-calendar/ui/CalendarView.tsx Outdated

@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/app/workspaces/`[workspaceId]/calendar/page.tsx:
- Around line 9-22: 간단한 날짜 포맷 반환을 위해 getSeoulTodayIsoDate의 formatToParts 및 수동 조합
로직을 제거하고, 동일한 Asia/Seoul 옵션으로 Intl.DateTimeFormat의 format() 결과를 직접 반환하도록 정리하세요.
🪄 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: ASSERTIVE

Plan: Pro Plus

Run ID: 79f65958-b5d1-4c0b-8c4d-ee9fcb2fd30d

📥 Commits

Reviewing files that changed from the base of the PR and between 9ca7273 and c4b7653.

📒 Files selected for processing (4)
  • src/app/workspaces/[workspaceId]/calendar/page.tsx
  • src/features/manage-calendar/model/calendar-utils.ts
  • src/features/manage-calendar/ui/CalendarView.tsx
  • src/views/calendar/ui/CalendarPage.tsx

Comment thread src/app/workspaces/[workspaceId]/calendar/page.tsx

@seongjinss555 seongjinss555 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

확인했습니다~ 고생하셨습니다

@JiWoongE
JiWoongE merged commit e0f180c into develop Jul 21, 2026
3 checks passed
@JiWoongE
JiWoongE deleted the Fix/#75/calendar-page-date-selection branch July 21, 2026 05:19
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.

fix: 캘린더 페이지 기본 선택 날짜 고정 및 선택 스타일 수정

2 participants