Skip to content

Conversation

@dioo1461
Copy link
Contributor

@dioo1461 dioo1461 commented Feb 23, 2025

#️⃣ 연관된 이슈>

📝 작업 내용> 이번 PR에서 작업한 내용을 간략히 설명해주세요(이미지 첨부 가능)

  • Page 이동 시에 selected index가 0으로 초기화되도록 구현 변경하여 해결했습니다.

🙏 여기는 꼭 봐주세요! > 리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

Summary by CodeRabbit

  • Refactor

    • Improved the clarity of schedule displays by updating component names from ScheduleContents to ScheduleDetails.
    • Enhanced pagination controls so that navigating pages now resets selections, promoting a smoother user experience with updated interaction labels.
    • Streamlined data handling in the FinishedScheduleList by passing the entire sharedEventDto object to child components, simplifying data management.
    • Removed visual feedback for interactivity by eliminating the pointer cursor style from the schedule item container.
  • New Features

    • Introduced a new CheckGraphic component for enhanced iconography.
  • Bug Fixes

    • Updated import paths for ClockGraphic and CheckGraphic components to reflect their new locations, ensuring proper functionality across the application.

@dioo1461 dioo1461 requested a review from hamo-o as a code owner February 23, 2025 06:09
@dioo1461 dioo1461 self-assigned this Feb 23, 2025
@dioo1461 dioo1461 added the 🖥️ FE Frontend label Feb 23, 2025
@coderabbitai
Copy link

coderabbitai bot commented Feb 23, 2025

Note

Reviews paused

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Walkthrough

This PR introduces several naming updates in schedule-related components. In the OngoingScheduleList component, the imported component ScheduleContents is renamed to ScheduleDetails, and the pagination callback variable onPageChange is updated to handlePageChange, utilizing an inline function that resets selectedIndex before invocation. Similar renaming is applied in the ScheduleDetails component file and the usePagination hook, while the overall functionality remains unchanged. Additionally, the schema for SharedEventDtoSchema is modified to allow null values, and adjustments are made to how data is passed to the FinishedScheduleListItem.

Changes

File Path(s) Summary
frontend/src/features/shared-schedule/ui/OngoingSchedules/OngoingScheduleList.tsx
frontend/src/features/shared-schedule/ui/OngoingSchedules/ScheduleDetails.tsx
Renamed ScheduleContents to ScheduleDetails.
Updated pagination callback: onPageChangehandlePageChange (inline callback now resets selectedIndex before invoking it).
frontend/src/hooks/usePagination.ts Renamed onPageChange to handlePageChange with unchanged functionality.
frontend/src/features/shared-schedule/model/finishedSchedules.ts Updated SharedEventDtoSchema to allow null values, altering the validation logic.
frontend/src/features/shared-schedule/ui/FinishedSchedules/FinishedScheduleList.tsx
frontend/src/features/shared-schedule/ui/FinishedSchedules/FinishedScheduleListItem.tsx
Removed endDate and startDate properties from FinishedScheduleListItemProps and added sharedEventDto. Updated data passing to FinishedScheduleListItem.
frontend/src/features/shared-schedule/ui/FinishedSchedules/finishedScheduleListItem.css.ts Removed cursor: 'pointer' style from scheduleItemContainerStyle.
frontend/src/components/Icon/component/CheckGraphic.tsx Removed CheckGraphic component.
frontend/src/components/Icon/custom/CheckGraphic.tsx Added new CheckGraphic component with updated props.
frontend/src/components/Icon/custom/ClockGraphic.tsx Modified attributes of <rect> elements and <linearGradient> in ClockGraphic.
frontend/src/components/Icon/index.ts Removed exports for CheckGraphic and ClockGraphic.
frontend/src/features/shared-schedule/ui/Fallbacks/FinishedFallback.tsx
frontend/src/features/shared-schedule/ui/Fallbacks/OngoingFallback.tsx
frontend/src/features/shared-schedule/ui/Fallbacks/UpcomingFallback.tsx
Updated import paths for ClockGraphic and CheckGraphic components.

Possibly related PRs

  • [FE-Fix] 일정 조율 CSS 수정 #252: The changes in the main PR are related to the renaming of the ScheduleContents component to ScheduleDetails, which is directly connected to the modifications made in the retrieved PR that also involve the same component name change.
  • [FE-Feat] 홈 화면 API 연결 #213: The changes in the main PR are related to the modifications of the CheckGraphic component, which is referenced in both the main PR and the retrieved PR, specifically regarding its import paths and usage.
  • [FE-Feat] 홈 화면 마크업 #159: The changes in the main PR are related to the renaming of the ScheduleContents component to ScheduleDetails, which is also reflected in the retrieved PR where the same component is renamed, indicating a direct connection at the code level.

Suggested labels

🛠️ BE

Suggested reviewers

  • hamo-o

Poem

I'm a little rabbit with code so bright,
Hopping through changes in the morning light.
"ScheduleDetails" now shines in the UI,
And "handlePageChange" makes the pages fly.
With a twitch of my nose and a happy heart,
I celebrate refactor fun—a fresh new start! 🐰🥕


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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. (Beta)
  • @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.

@dioo1461 dioo1461 force-pushed the bugfix/fe/ongoing-pagination branch from f21c302 to b3e06b6 Compare February 24, 2025 07:50
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 (2)
frontend/src/features/shared-schedule/ui/FinishedSchedules/FinishedScheduleListItem.tsx (2)

17-20: Remove commented-out code.

The commented-out props are no longer needed and should be removed to maintain clean code.

-  sharedEventDto: SharedEventDto;
-  // startDate: Date;
-  // endDate: Date;
+  sharedEventDto: SharedEventDto;

56-63: Consider internationalizing the fallback message.

The fallback message for unspecified schedules is hardcoded in Korean. Consider using an i18n solution for better maintainability and future localization support.

-    {sharedEventDto ? getDateTimeRangeString(
-      sharedEventDto.startDateTime, 
-      sharedEventDto.endDateTime)
-      : '조율되지 않은 일정이에요'}
+    {sharedEventDto ? getDateTimeRangeString(
+      sharedEventDto.startDateTime, 
+      sharedEventDto.endDateTime)
+      : t('schedule.unspecified')}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b3e06b60f6b95ee17d887d2c73217dd7c979f093 and 7a8b23142b5fee22c3f2c6b6ef0647128ed69284.

📒 Files selected for processing (4)
  • frontend/src/features/shared-schedule/model/finishedSchedules.ts (1 hunks)
  • frontend/src/features/shared-schedule/ui/FinishedSchedules/FinishedScheduleList.tsx (1 hunks)
  • frontend/src/features/shared-schedule/ui/FinishedSchedules/FinishedScheduleListItem.tsx (3 hunks)
  • frontend/src/features/shared-schedule/ui/FinishedSchedules/finishedScheduleListItem.css.ts (0 hunks)
💤 Files with no reviewable changes (1)
  • frontend/src/features/shared-schedule/ui/FinishedSchedules/finishedScheduleListItem.css.ts
🔇 Additional comments (2)
frontend/src/features/shared-schedule/model/finishedSchedules.ts (1)

5-12:

Details

❓ Verification inconclusive

LGTM! Schema change properly handles unspecified schedules.

The modification to allow null values in SharedEventDtoSchema is well-implemented and aligns with the need to handle unspecified schedules. The use of z.union with explicit null handling maintains type safety.

Let's verify the schema's usage across the codebase:


🏁 Script executed:

#!/bin/bash
# Search for usages of SharedEventDto type and SharedEventDtoSchema
rg "SharedEventDto|SharedEventDtoSchema" -t typescript

Length of output: 91


Below is a new script to search for the schema and type usages in TypeScript files. (The earlier use of -t typescript caused an error since that file type isn’t recognized. Please run the following command to verify manually that the schema is referenced where expected.)

#!/bin/bash
# Searching for usages of SharedEventDto and SharedEventDtoSchema in TypeScript files
rg "SharedEventDto|SharedEventDtoSchema" -g "*.ts"

LGTM with a note for manual verification

The change to allow null values in SharedEventDtoSchema is well implemented and aligns with our needs to handle unspecified schedules. However, because our initial automated search didn’t yield results due to file type filtering, please ensure by manually verifying (using the script above) that this schema is used appropriately throughout the codebase.

frontend/src/features/shared-schedule/ui/FinishedSchedules/FinishedScheduleList.tsx (1)

38-38: LGTM! Simplified prop passing improves maintainability.

The change to pass the entire sharedEventDto instead of individual date properties reduces prop drilling and improves maintainability.

@dioo1461 dioo1461 force-pushed the bugfix/fe/ongoing-pagination branch from 7a8b231 to 0f28440 Compare February 24, 2025 09:23
@dioo1461
Copy link
Contributor Author

@coderabbitai 이 pr에는 리뷰를 멈춰주세요.

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 (4)
frontend/src/features/shared-schedule/ui/FinishedSchedules/FinishedScheduleListItem.tsx (2)

18-19: Remove commented code.

Remove the commented-out props as they are no longer needed and maintaining commented code can lead to confusion.

-  // startDate: Date;
-  // endDate: Date;

56-63: Consider i18n for the fallback text and performance optimization.

Two suggestions for improvement:

  1. The hardcoded Korean text '조율되지 않은 일정이에요' should be moved to an i18n configuration for better maintainability and internationalization support.
  2. Consider memoizing the component to prevent unnecessary re-renders.
+import { memo } from 'react';
+import { useTranslation } from 'react-i18next';

-const MeetDate = ({ sharedEventDto }: { sharedEventDto: SharedEventDto }) => (
+const MeetDate = memo(({ sharedEventDto }: { sharedEventDto: SharedEventDto }) => {
+  const { t } = useTranslation();
+  return (
   <Text color={vars.color.Ref.Netural[600]} typo='b3R'>
     {sharedEventDto ? getDateTimeRangeString(
       sharedEventDto.startDateTime, 
       sharedEventDto.endDateTime)
-      : '조율되지 않은 일정이에요'}
+      : t('schedule.unspecified')}
   </Text>
+  );
+});
+
+MeetDate.displayName = 'MeetDate';
frontend/src/components/Icon/custom/CheckGraphic.tsx (2)

2-4: Remove unused props stroke and fill.

The stroke and fill props are declared but not utilized in the SVG. Consider removing them to avoid confusion.

-export const CheckGraphic = ({ clickable = false, className, width = 24, height = 24 , stroke = "white", fill = "white", ...rest }: IconProps) => {
+export const CheckGraphic = ({ clickable = false, className, width = 24, height = 24, ...rest }: IconProps) => {

17-147: Consider making filter IDs unique per instance.

The SVG uses fixed IDs for filters and masks (e.g., clip0_894_193, mask0_894_193). This could cause conflicts if multiple instances of the component are rendered on the same page.

Consider generating unique IDs using a hook or prop:

import { useId } from 'react';

export const CheckGraphic = ({ ... }) => {
  const uniqueId = useId();
  return (
    <svg ...>
      <g clipPath={`url(#clip-${uniqueId})`}>
        {/* Update other IDs similarly */}
      </g>
      <defs>
        <clipPath id={`clip-${uniqueId}`}>
          {/* ... */}
        </clipPath>
      </defs>
    </svg>
  );
};
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7a8b23142b5fee22c3f2c6b6ef0647128ed69284 and 0f28440.

📒 Files selected for processing (14)
  • frontend/src/components/Icon/component/CheckGraphic.tsx (0 hunks)
  • frontend/src/components/Icon/custom/CheckGraphic.tsx (1 hunks)
  • frontend/src/components/Icon/custom/ClockGraphic.tsx (1 hunks)
  • frontend/src/components/Icon/index.ts (0 hunks)
  • frontend/src/features/shared-schedule/model/finishedSchedules.ts (1 hunks)
  • frontend/src/features/shared-schedule/ui/Fallbacks/FinishedFallback.tsx (1 hunks)
  • frontend/src/features/shared-schedule/ui/Fallbacks/OngoingFallback.tsx (1 hunks)
  • frontend/src/features/shared-schedule/ui/Fallbacks/UpcomingFallback.tsx (1 hunks)
  • frontend/src/features/shared-schedule/ui/FinishedSchedules/FinishedScheduleList.tsx (1 hunks)
  • frontend/src/features/shared-schedule/ui/FinishedSchedules/FinishedScheduleListItem.tsx (3 hunks)
  • frontend/src/features/shared-schedule/ui/FinishedSchedules/finishedScheduleListItem.css.ts (0 hunks)
  • frontend/src/features/shared-schedule/ui/OngoingSchedules/OngoingScheduleList.tsx (3 hunks)
  • frontend/src/features/shared-schedule/ui/OngoingSchedules/ScheduleDetails.tsx (2 hunks)
  • frontend/src/hooks/usePagination.ts (1 hunks)
💤 Files with no reviewable changes (3)
  • frontend/src/features/shared-schedule/ui/FinishedSchedules/finishedScheduleListItem.css.ts
  • frontend/src/components/Icon/component/CheckGraphic.tsx
  • frontend/src/components/Icon/index.ts
✅ Files skipped from review due to trivial changes (3)
  • frontend/src/features/shared-schedule/ui/Fallbacks/FinishedFallback.tsx
  • frontend/src/features/shared-schedule/ui/Fallbacks/OngoingFallback.tsx
  • frontend/src/features/shared-schedule/ui/Fallbacks/UpcomingFallback.tsx
🚧 Files skipped from review as they are similar to previous changes (5)
  • frontend/src/hooks/usePagination.ts
  • frontend/src/features/shared-schedule/ui/OngoingSchedules/OngoingScheduleList.tsx
  • frontend/src/features/shared-schedule/model/finishedSchedules.ts
  • frontend/src/features/shared-schedule/ui/OngoingSchedules/ScheduleDetails.tsx
  • frontend/src/features/shared-schedule/ui/FinishedSchedules/FinishedScheduleList.tsx
🔇 Additional comments (5)
frontend/src/components/Icon/custom/ClockGraphic.tsx (2)

10-10: Verify the clock hand orientation after rotation change.

The rotation angle change from 135 to -135 degrees will affect the clock hand's orientation. Please verify that this adjustment correctly positions the clock hand as intended.


14-14: Verify the gradient appearance after coordinate adjustment.

The linearGradient's x1 coordinate has been significantly adjusted from a large positive value to a very small negative value (-1.8593e-06). While this value is more typical for gradient coordinates, please verify that the gradient renders as expected across different screen sizes and resolutions.

frontend/src/features/shared-schedule/ui/FinishedSchedules/FinishedScheduleListItem.tsx (1)

23-28: LGTM! Clean prop restructuring.

The component prop changes are well-implemented, maintaining clean code structure while adapting to the new data model.

frontend/src/components/Icon/custom/CheckGraphic.tsx (2)

6-16: Well-structured SVG root element with proper accessibility!

The SVG element is well-implemented with:

  • Proper dimension handling with width/height props
  • Accessibility support via aria-label
  • Clean conditional styling for clickable state

152-152: LGTM! Proper display name setup.

Setting the display name helps with debugging and follows React best practices.

@coderabbitai
Copy link

coderabbitai bot commented Feb 24, 2025

@dioo1461: I'll pause the automated reviews for this PR.

✅ Actions performed

Reviews paused.

@dioo1461 dioo1461 merged commit ebfd9f5 into dev Feb 24, 2025
1 check passed
@dioo1461 dioo1461 deleted the bugfix/fe/ongoing-pagination branch February 24, 2025 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🖥️ FE Frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants