Skip to content

C24 Crow - May Lee #17

Open
maychanlee wants to merge 11 commits intoAda-C24:mainfrom
maychanlee:main
Open

C24 Crow - May Lee #17
maychanlee wants to merge 11 commits intoAda-C24:mainfrom
maychanlee:main

Conversation

@maychanlee
Copy link
Copy Markdown

No description provided.

Copilot AI review requested due to automatic review settings December 16, 2025 01:18
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements a chat application interface using React components. The implementation includes a new ChatLog component to display multiple chat entries, updates to the ChatEntry component to handle user interactions (likes), and state management in the App component.

Key Changes

  • Created ChatLog component to render a list of chat entries with proper prop validation
  • Enhanced ChatEntry component with interactive like functionality and dynamic data rendering
  • Implemented state management in App.jsx to handle chat data and like toggling
  • Updated package dependencies (vite and vitest versions)

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/components/ChatLog.jsx New component that maps over entries data and renders ChatEntry components with appropriate props
src/components/ChatEntry.jsx Updated to render dynamic data (sender, body, timestamp) and handle like toggling with event handlers
src/App.jsx Added state management for chat entries, like toggling logic, and total likes count display
package.json Updated vite to 7.3.0 and vitest to 4.0.15
package-lock.json Lock file updates corresponding to package.json changes
.vscode/settings.json Added "Besties" to custom spell check dictionary

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

sender: PropTypes.string.isRequired,
body: PropTypes.string.isRequired,
timeStamp: PropTypes.string.isRequired,
isLiked: PropTypes.bool,
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

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

The PropTypes definition for 'isLiked' should be marked as 'isRequired' to match the PropTypes definition in ChatLog.jsx where 'liked' is marked as required. This inconsistency could lead to runtime errors if the prop is not provided.

Suggested change
isLiked: PropTypes.bool,
isLiked: PropTypes.bool.isRequired,

Copilot uses AI. Check for mistakes.
body: PropTypes.string.isRequired,
timeStamp: PropTypes.string.isRequired,
isLiked: PropTypes.bool,
onToggleLiked: PropTypes.func,
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

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

The PropTypes definition for 'onToggleLiked' should be marked as 'isRequired' since it is being called in the component's event handler without any null check. If this prop is not provided, clicking the like button will cause a runtime error.

Suggested change
onToggleLiked: PropTypes.func,
onToggleLiked: PropTypes.func.isRequired,

Copilot uses AI. Check for mistakes.
timeStamp: PropTypes.string.isRequired,
liked: PropTypes.bool.isRequired,
})),
onToggleLiked: PropTypes.func,
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

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

The PropTypes definition for 'onToggleLiked' should be marked as 'isRequired' since it is being used in the ChatLog component and passed down to ChatEntry. Marking it as optional here while it's required in the child component creates an inconsistency.

Suggested change
onToggleLiked: PropTypes.func,
onToggleLiked: PropTypes.func.isRequired,

Copilot uses AI. Check for mistakes.
timeStamp={entry.timeStamp}
isLiked={entry.liked}
onToggleLiked={props.onToggleLiked}
></ChatEntry>
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

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

The closing tag for ChatEntry component is unnecessarily self-closing with ">". Since the component has no children, it should use a self-closing tag format like "/>" for consistency and brevity.

Suggested change
></ChatEntry>
/>

Copilot uses AI. Check for mistakes.
<p className="entry-time">Replace with TimeStamp component</p>
<button className="like">🤍</button>
<p>{props.body}</p>
<p className="entry-time"><Timestamp time={props.timeStamp}></Timestamp></p>
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

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

The closing tag for Timestamp component is unnecessarily verbose with ">". Since the component has no children, it should use a self-closing tag format like "/>" for consistency and brevity.

Suggested change
<p className="entry-time"><Timestamp time={props.timeStamp}></Timestamp></p>
<p className="entry-time"><Timestamp time={props.timeStamp} /></p>

Copilot uses AI. Check for mistakes.
Comment thread src/App.jsx
{/* Wave 01: Render one ChatEntry component
Wave 02: Render ChatLog component */}
<ChatLog entries={entriesData}
onToggleLiked={toggleLiked}></ChatLog>
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

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

The closing tag for ChatLog component is unnecessarily verbose with ">". Since the component has no children, it should use a self-closing tag format like "/>" for consistency and brevity.

Suggested change
onToggleLiked={toggleLiked}></ChatLog>
onToggleLiked={toggleLiked} />

Copilot uses AI. Check for mistakes.
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