Skip to content

Event card front end pb#55

Open
pramukhbhushan wants to merge 2 commits intomainfrom
event-card-front-end-PB
Open

Event card front end pb#55
pramukhbhushan wants to merge 2 commits intomainfrom
event-card-front-end-PB

Conversation

@pramukhbhushan
Copy link
Collaborator

@pramukhbhushan pramukhbhushan commented Dec 3, 2025

Summary

  • Added new EventCardSteps component for displaying Events with multiple steps
  • Created SchedulerTest page to test the new component
  • Added test route in App.tsx (for testing purposes - can be removed after review)

Features

  • Displays event with clickable checklist items
  • Progress bar that updates as steps are completed
  • "Mark as Done" button (enabled only when all steps complete)
  • Integrates with Event type (extends Task with steps array)

Testing
Navigate to /test-event-card to see the component in action with sample data

Files Changed

  • rise-dc-app/src/scheduling_components/EventCardSteps.tsx (NEW)
  • rise-dc-app/src/pages/SchedulerTest.tsx (NEW)
  • rise-dc-app/src/App.tsx (test route added)

Summary by CodeRabbit

  • New Features
    • Added a new event card component featuring step-by-step progress tracking with a visual progress bar.
    • Implemented individual step completion tracking with a checklist interface.
    • Added a "Mark as Done" button that activates once all event steps are completed.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 3, 2025

Walkthrough

This PR introduces a new test page component for testing event card functionality, along with a new EventCardSteps component that displays events with a step-by-step checklist and progress tracking. A test route is registered in App.tsx.

Changes

Cohort / File(s) Summary
Routing setup
rise-dc-app/src/App.tsx
Adds EventCardTest route at /test-event-card with inline comment indicating it is temporary test code to be removed.
Test component
rise-dc-app/src/pages/SchedulerTest.tsx
Introduces EventCardTest functional component with selectedActivity state, back navigation, sampleEvent data, and handlers for activity selection, step toggling, and marking events as done. Renders DayDisplay, PlanYourDayButton, EventCardSteps, and back button.
New feature component
rise-dc-app/src/scheduling_components/EventCardSteps.tsx
New EventCardSteps component that displays event details with header, animated progress bar, step checklist, and completion tracking. Manages selectedIcon state and completedSteps array. Computes progress metrics (completedCount, totalSteps, progressPercentage). Provides handlers for step toggling and marking events as done when all steps are complete.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Progress calculation logic and step completion state management warrant careful review
  • Verify handler signatures and prop contracts match expectations between EventCardTest and EventCardSteps
  • Note the "test code to be removed" comment in App.tsx—confirm whether this temporary route should be gated or removed before merge

Possibly related PRs

Suggested reviewers

  • cc13985

Poem

🐰 A card with steps, all shiny and new!
Progress bars dancing in orange hue,
Checkboxes click, the work marches on,
Until every task is complete and done! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Event card front end pb' is vague and unclear; it uses an unexplained abbreviation ('pb') and does not clearly convey what the change accomplishes. Clarify the title to describe the actual change, e.g., 'Add EventCardSteps component with progress tracking' or 'Implement event card UI with step completion.'
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch event-card-front-end-PB

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 and usage tips.

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: 1

🧹 Nitpick comments (6)
rise-dc-app/src/scheduling_components/EventCardSteps.tsx (4)

6-10: Remove unused type definition.

The TimeSlot type is defined but never used in this file. Consider removing it to keep the code clean.

-type TimeSlot = {
-  hour: number;
-  minute: number;
-  period: "AM" | "PM";
-};
-

26-26: Fix typo in comment.

The comment contains a typo: "Intializesset SelectedIcon or it to None" should be "Initializes selectedIcon or sets it to null".

-  } | null>(null);//Intializesset SelectedIcon or  it to None
+  } | null>(null); // Initializes selectedIcon or sets it to null

32-35: Implement time formatting or clarify the stub.

The formatTime function is a stub that returns the raw string. Since the component displays time ranges (line 69), consider implementing proper time formatting or document why this is deferred.

For example, if event.startTime and event.endTime are already formatted strings, update the comment to clarify this. If they need formatting, implement the function:

const formatTime = (timeString: string) => {
  // Parse and format time string as needed
  // Example: convert "14:30" to "2:30 PM"
  return timeString; // Implement actual formatting logic
};

37-37: Fix typo in comment.

The comment contains a typo: "checkbod" should be "checkbox".

-  const handleStepToggle = (stepIndex: number) => { //Handles user clicking checkbod
+  const handleStepToggle = (stepIndex: number) => { // Handles user clicking checkbox
rise-dc-app/src/pages/SchedulerTest.tsx (2)

13-21: Remove unused state and handler.

The selectedActivity state and handleActivityChosen function are defined but never used in the component. Consider removing them to keep the test page focused.

-  const [selectedActivity, setSelectedActivity] = useState<QuietHobby | null>(
-    null,
-  );
   const navigate = useNavigate();
 
-  const handleActivityChosen = (hobby: QuietHobby) => {
-    setSelectedActivity(hobby);
-    console.log("Activity chosen:", hobby);
-  };
-

Also remove the unused import:

-import { QuietHobby } from "../scheduling_components/quiet_hobbies/types";

23-37: Consider improving test data quality.

The sample event has a few areas that could be enhanced for better testing:

  1. startTime and endTime are both "00:00", which doesn't provide a realistic time range for testing the display.
  2. The category field uses an as any cast, which bypasses type safety.

Consider updating the sample data:

   const sampleEvent: Event = {
     id: "1",
     userId: "user123",
     name: "Clean Bedroom",
     icon: "🧹",
     complete: false,
-    startTime: "00:00",
-    endTime: "00:00",
-    category: "chores" as any,
+    startTime: "2:00 PM",
+    endTime: "3:30 PM",
+    category: "chores",
     steps: [
       "Make Bed",
       "Put books away",
       "Put clothes away"
     ]
   };
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e2c9369 and 6830c1c.

⛔ Files ignored due to path filters (1)
  • rise-dc-app/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • rise-dc-app/src/App.tsx (2 hunks)
  • rise-dc-app/src/pages/SchedulerTest.tsx (1 hunks)
  • rise-dc-app/src/scheduling_components/EventCardSteps.tsx (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
rise-dc-app/src/pages/SchedulerTest.tsx (3)
rise-dc-app/src/scheduling_components/quiet_hobbies/types.ts (1)
  • QuietHobby (49-56)
rise-dc-app/src/scheduling_components/DayDisplay.tsx (1)
  • DayDisplay (3-29)
rise-dc-app/src/scheduling_components/PlanYourDayButton.tsx (1)
  • PlanYourDayButton (15-146)
🪛 Biome (2.1.2)
rise-dc-app/src/App.tsx

[error] 41-41: Wrap comments inside children within braces.

Unsafe fix: Wrap the comments with braces

(lint/suspicious/noCommentText)

🔇 Additional comments (2)
rise-dc-app/src/pages/SchedulerTest.tsx (2)

39-45: LGTM!

The console-based handlers are appropriate for a test page and properly demonstrate the EventCardSteps component's callback functionality.


47-77: LGTM!

The test page layout effectively demonstrates the EventCardSteps component alongside other scheduling components. The navigation and component integration are properly implemented.

element={<RecipeComplete />}
/>
<Route path="/scheduler" element={<Scheduler />} />
<Route path="/test-event-card" element={<EventCardTest />} />//testing remove after
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix JSX comment syntax.

Comments inside JSX must be wrapped in braces {/* */} instead of using // syntax. This will cause a syntax error.

Apply this diff to fix the syntax:

-        <Route path="/test-event-card" element={<EventCardTest />} />//testing remove after
+        <Route path="/test-event-card" element={<EventCardTest />} /> {/* testing remove after */}

Consider also updating the comment on line 14 for consistency:

-import EventCardTest from "./pages/SchedulerTest";// added test page
+import EventCardTest from "./pages/SchedulerTest"; // added test page
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Route path="/test-event-card" element={<EventCardTest />} />//testing remove after
<Route path="/test-event-card" element={<EventCardTest />} /> {/* testing remove after */}
🧰 Tools
🪛 Biome (2.1.2)

[error] 41-41: Wrap comments inside children within braces.

Unsafe fix: Wrap the comments with braces

(lint/suspicious/noCommentText)

🤖 Prompt for AI Agents
In rise-dc-app/src/App.tsx around line 41, the JSX trailing comment uses
JavaScript line-comment syntax causing a syntax error; replace the trailing
"//testing remove after" with a JSX comment wrapped in braces like {/* testing
remove after */} or remove the comment entirely, and for consistency update the
comment on line 14 to use the same JSX comment format if it appears inside JSX.

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.

2 participants