Skip to content

Conversation

@young-jin-son
Copy link
Collaborator

@young-jin-son young-jin-son commented Jul 16, 2025

Issue Number

close #294

As-Is

To-Be

Check List

  • 테스트가 전부 통과되었나요?
  • 모든 commit이 push 되었나요?
  • merge할 branch를 확인했나요?
  • Assignee를 지정했나요?
  • Label을 지정했나요?

Test Screenshot

변경 전 변경 후
image image

(Optional) Additional Description

Summary by CodeRabbit

  • New Features

    • Added a "Completed Goals" title to the weekly category list.
    • Introduced a visual marker for the current day in the weekly day list.
    • Ensured all mood categories are always displayed, even if data is missing.
  • Style

    • Updated text colors and font styles for category and mood items to improve readability.
    • Adjusted spacing, margins, and container padding for a cleaner layout.
    • Applied new styles to date range and category list titles.
  • Bug Fixes

    • The current day indicator is now consistently shown using a dedicated marker.
  • Chores

    • Updated mock data structure and content for weekly statistics.
  • Refactor

    • Simplified and standardized date range formatting in weekly statistics.
    • Reorganized component structure for better maintainability.
  • Revert

    • Removed the "Weekly Overview" title from the overview section.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 16, 2025

Walkthrough

This update refactors the weekly statistics page's UI and mock data to align with new design specifications. It modifies date formatting, restructures mock data, adjusts component layouts and styles, introduces new styled components, and updates logic for mood data normalization and today marker display.

Changes

File(s) Change Summary
frontend/src/mocks/data/statistics/weekStatistics.json Updated mock data structure: removed summary fields, added memberCreateDate, restructured day/category arrays, updated dates/values.
frontend/src/pages/WeekStatisticsPage/WeekStatisticsPage.utils.ts Changed getWeekDateRange output format to use slashes and simplified date representation.
frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekCategoryList/WeekCategoryItem/... Adjusted gap, changed text color and font styles for time/count components.
frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekCategoryList/WeekCategoryItem/index.tsx Reordered JSX: moved usage time display after category badge.
frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekCategoryList/WeekCategoryList.styled.ts Added new styled component CategoryListTitle.
frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekCategoryList/index.tsx Added new title element "수행한 목표" (Completed Goals) at the top of the list.
frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekDayList/WeekDayItem/WeekDayItem.styled.ts Removed $isToday prop and styling; added IconContainer, UsageTimeContainer, and TodayMarker styled components.
frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekDayList/WeekDayItem/index.tsx Refactored JSX: wrapped icon/usage time in containers; moved today marker logic to a new component.
frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekDayList/WeekDayList.styled.ts Added new styled component WeekDateRange.
frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekDayList/index.tsx Replaced plain div with styled WeekDateRange for date range display.
frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekOverview/WeekOverview.styled.ts Reduced border-radius, updated font styles/colors, removed WeekOverviewTitle styled component.
frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekOverview/index.tsx Removed rendering of the WeekOverviewTitle component.
frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekStatisticsMain.styled.ts Increased padding-bottom of WeekAchievementContainer.
frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/index.tsx Added mood data normalization logic to always display all mood categories with zero counts if missing.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant WeekStatisticsMain
  participant WeekDayList
  participant WeekDayItem
  participant WeekCategoryList
  participant MoodDataNormalizer

  User->>WeekStatisticsMain: Visit Weekly Statistics Page
  WeekStatisticsMain->>MoodDataNormalizer: Normalize moodCounts
  MoodDataNormalizer-->>WeekStatisticsMain: moodCounts (all categories)
  WeekStatisticsMain->>WeekDayList: Render weekDays
  WeekDayList->>WeekDayItem: For each day, render Day
  WeekDayItem->>WeekDayItem: Display TodayMarker if today
  WeekStatisticsMain->>WeekCategoryList: Render categories with new title
Loading

Assessment against linked issues

Objective Addressed Explanation
오늘날짜 표시 디자인 수정 (#294)
수행한 목표 디자인 수정 (#294)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes found.

Possibly related PRs

  • #131: Introduces initial weekly statistics API integration and UI, which is directly built upon and refactored in this PR.
  • #190: Refactors backend weekly statistics data structure and API, corresponding to the frontend model and UI updates in this PR.

Suggested labels

refactor, design, FE

Poem

A bunny hopped through stats this week,
With colors bold and fonts unique.
Today’s green bar now shines so bright,
“Completed Goals” in tidy sight.
Mood counts sorted, data neat—
This page is now a UI treat!
🐰✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • 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 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 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 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 for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@young-jin-son young-jin-son self-assigned this Jul 16, 2025
@young-jin-son young-jin-son added design css와 같은 스타일링 FE 프론트엔드 작업 labels Jul 16, 2025
Copy link
Contributor

@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

🔭 Outside diff range comments (1)
frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekDayList/WeekDayItem/index.tsx (1)

21-27: Normalize the today timestamp to midnight to avoid edge-case mis-classification
today keeps the current hours/minutes while currentDate is set to 00:00.
If the user opens the page precisely at 00:00, currentDate > today will be false for tomorrow, unintentionally enabling navigation to a future date for ~1 second.
Align both sides by zeroing today as well:

-  const today = new Date();
+  const today = new Date();
+  today.setHours(0, 0, 0, 0);
🧹 Nitpick comments (4)
frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekDayList/WeekDayList.styled.ts (1)

21-24: Prefer semantic heading element over bare div
WeekDateRange represents a section title/date range and would benefit accessibility/searchability if rendered as h3 (or appropriate heading level) instead of a generic div.

-export const WeekDateRange = styled.div`
+export const WeekDateRange = styled.h3`
frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekCategoryList/WeekCategoryList.styled.ts (1)

9-13: Use heading tag for list title
Similar to the previous comment, CategoryListTitle is effectively a section heading. Switching from div to h3/ h4 improves semantic structure and screen-reader navigation at virtually zero cost.

-export const CategoryListTitle = styled.div`
+export const CategoryListTitle = styled.h3`
frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekDayList/WeekDayItem/index.tsx (1)

37-52: Minor accessibility touch-ups

  1. When <S.DayButton> is disabled, it is automatically removed from tab order, but visually nothing indicates it’s inactive. Consider adding aria-disabled or style feedback for keyboard users.
  2. Icon appears decorative; add aria-hidden to prevent redundant screen-reader narration if not already handled inside the component.
frontend/src/mocks/data/statistics/weekStatistics.json (1)

4-25: Consider using more recent mock dates.

The mock data uses July 2025 dates, which appears to be the current timeframe. Consider whether these dates should be more dynamic or relative to the current date for better testing scenarios.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6b43870 and f1e0c21.

📒 Files selected for processing (14)
  • frontend/src/mocks/data/statistics/weekStatistics.json (1 hunks)
  • frontend/src/pages/WeekStatisticsPage/WeekStatisticsPage.utils.ts (1 hunks)
  • frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekCategoryList/WeekCategoryItem/WeekCategoryItem.styled.ts (2 hunks)
  • frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekCategoryList/WeekCategoryItem/index.tsx (1 hunks)
  • frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekCategoryList/WeekCategoryList.styled.ts (1 hunks)
  • frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekCategoryList/index.tsx (1 hunks)
  • frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekDayList/WeekDayItem/WeekDayItem.styled.ts (1 hunks)
  • frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekDayList/WeekDayItem/index.tsx (1 hunks)
  • frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekDayList/WeekDayList.styled.ts (1 hunks)
  • frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekDayList/index.tsx (1 hunks)
  • frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekOverview/WeekOverview.styled.ts (4 hunks)
  • frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekOverview/index.tsx (0 hunks)
  • frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekStatisticsMain.styled.ts (1 hunks)
  • frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/index.tsx (2 hunks)
💤 Files with no reviewable changes (1)
  • frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekOverview/index.tsx
🧰 Additional context used
🧬 Code Graph Analysis (1)
frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekDayList/index.tsx (1)
frontend/src/pages/WeekStatisticsPage/WeekStatisticsPage.utils.ts (1)
  • getWeekDateRange (36-43)
🔇 Additional comments (18)
frontend/src/pages/WeekStatisticsPage/WeekStatisticsPage.utils.ts (1)

42-42: Date format simplification looks good.

The updated date format provides a cleaner, more concise representation while maintaining Korean day-of-week labels. This change aligns well with the design refactoring objectives.

frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekOverview/WeekOverview.styled.ts (3)

9-9: Border-radius adjustment improves visual consistency.

The reduced border-radius from 2.8rem to 1.6rem creates a more subtle, refined appearance that likely aligns better with the overall design system.


42-42: Typography hierarchy improvements look good.

The color change from gray400 to gray900 for CompareTitle and the font upgrade from body15Med to headline17Med for CompareValue enhance readability and establish better visual hierarchy.

Also applies to: 46-46


62-62: Mood section styling updates enhance user experience.

The increased gap spacing (0.8rem to 1.6rem) and typography improvements (label13Med to label14Med, body16 to heading20) create better visual separation and hierarchy in the mood display section.

Also applies to: 74-76, 79-81

frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekStatisticsMain.styled.ts (1)

13-13: Confirm bottom padding necessity on WeekStatisticsPage

I didn’t find any fixed or floating elements within the WeekStatisticsPage components (e.g., no local bottom-fixed nav, modal, or floating button) that would strictly require an 8rem bottom gap. Please double-check that:

  • This padding is intended to accommodate a global bottom navigation or overlay on this page.
  • It doesn’t introduce excessive whitespace on pages or viewports where no bottom overlay is present.

If this spacing is for a global layout element, consider adding a brief comment in the styled file to clarify its purpose.

frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekDayList/index.tsx (1)

79-79: Good use of styled component for consistent styling.

Replacing the plain div with the styled S.WeekDateRange component ensures consistent styling for the date range display and aligns well with the updated date format from the utils file.

frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekCategoryList/index.tsx (1)

17-17: Good addition of section title for better UX.

Adding the "수행한 목표" (Completed Goals) title improves the information architecture and makes the interface more self-explanatory for users.

frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekCategoryList/WeekCategoryItem/index.tsx (1)

19-21: Element order change LGTM
Re-ordering <S.CategoryTime> after <CategoryBadge> does not affect logic and better matches the new visual hierarchy.

frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekCategoryList/WeekCategoryItem/WeekCategoryItem.styled.ts (1)

28-32: Style tweak looks good
Darker text color and smaller body font make the usage time consistent with other typography. No issues found.

frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/index.tsx (3)

12-16: Well-structured default mood data constant.

The DEFAULT_MOOD_DATA constant provides a clear contract for expected mood categories and ensures consistent data structure. The use of as const prevents accidental mutations.


18-27: Excellent data normalization implementation.

The normalizeMoodData function effectively handles missing mood data by ensuring all predefined categories are present with appropriate fallback values. The logic is clean and defensive.


52-52: Improved data consistency with normalization.

Using normalizeMoodData ensures the mood data structure is consistent regardless of what the server returns, preventing potential runtime errors from missing mood categories.

frontend/src/mocks/data/statistics/weekStatistics.json (2)

3-3: memberCreateDate format verified

The new memberCreateDate value ("YYYY-MM-DD") is ISO-8601 compliant and is parsed correctly by the frontend components (e.g. new Date(memberCreateDate) in WeekDayList, WeekDayItem, DayDate). No changes are required.


27-58: No Action Needed: categoryTodoCounts structure and ordering are correct

The mock data in weekStatistics.json matches the expected props for both components:

  • Week API & mocks define each entry as { category: string; count: number; usageTime: number }, matching WeekCategoryList’s categoryRanking shape.
  • Day API & mocks use { category: string; count: number } as expected by DayCategoryAchievement.
  • The array order reflects server-side ranking (descending usageTime) and is intentionally consumed in display order.
frontend/src/pages/WeekStatisticsPage/components/WeekStatisticsMain/WeekDayList/WeekDayItem/WeekDayItem.styled.ts (4)

18-23: Good addition of semantic container components.

The IconContainer provides consistent layout for icons with fixed height and centered content, improving visual consistency.


25-40: Improved Day component with cleaner prop interface.

Removing the $isToday prop simplifies the component interface while adding position: relative supports the new absolutely positioned TodayMarker. The color logic is now focused solely on the disabled state.


42-47: Consistent container styling for usage time.

The UsageTimeContainer mirrors the IconContainer styling, providing layout consistency across the component.


54-62: Well-positioned today marker component.

The TodayMarker is properly positioned as an absolute element with centered alignment. The green color provides good visual distinction for the current day.

@young-jin-son young-jin-son merged commit b7ed49d into develop Jul 16, 2025
3 checks passed
@young-jin-son young-jin-son deleted the refactor/#294 branch July 16, 2025 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

design css와 같은 스타일링 FE 프론트엔드 작업

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REFACTOR] 주간 통계 페이지 디자인 수정 사항 반영

2 participants