Skip to content

refactor(Counter): recreate component - #3

Merged
IvanGodinez21 merged 1 commit into
mainfrom
refactor/counter-component
Apr 4, 2026
Merged

refactor(Counter): recreate component#3
IvanGodinez21 merged 1 commit into
mainfrom
refactor/counter-component

Conversation

@IvanGodinez21

@IvanGodinez21 IvanGodinez21 commented Oct 24, 2025

Copy link
Copy Markdown
Member

Description

Describe the changes made by this pull request.

Refactor the counter component.
Note: This component may be renamed in the future; for now, we'll keep this name.

Related issues

List related issues (if any) and/or @mentions of the person or team responsible for reviewing proposed changes (left blank if not applicable).
List by using - [ ] and the issue number, e.g. - [ ] #1 or - [x] #1 if the issue is closed/solved.

Testing

Help me how can I test or look at the changes (left blank if not applicable).

Screenshots

Include screenshots of the results or screenshots that help to see changes (left blank if not applicable).

Notes

Some additional notes if necessary (left blank if not applicable).

Copilot AI review requested due to automatic review settings October 24, 2025 05:46
@IvanGodinez21
IvanGodinez21 force-pushed the refactor/counter-component branch from 8ddc2b0 to dfb2a11 Compare October 24, 2025 05:47

Copilot AI 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.

Pull Request Overview

This PR refactors the counter component by replacing JavaScript's native Date with the Temporal API from @js-temporal/polyfill. The changes include a new timeAgo utility function, migration of the incident date type to Temporal.Instant, and a complete redesign of the Counter component with a digital display aesthetic.

Key Changes:

  • Migrated from Date to Temporal.Instant for incident timestamps
  • Created a timeAgo utility function for relative time formatting
  • Redesigned Counter component with digital display and real-time updates

Reviewed Changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/utils/timeAgo.ts New utility for formatting relative time using Temporal API and Intl formatters
src/types/incident.ts Changed incident date type from Date to Temporal.Instant
src/lib/mockData.ts Updated mock data to use Temporal.Instant instead of Date
src/components/IncidentCard.tsx Updated date formatting to work with Temporal.Instant
src/components/Counter.tsx Complete refactor with new digital display UI and real-time updates
src/app/page.tsx Removed standalone Counter, now renders Counter for each incident
package.json Added @js-temporal/polyfill dependency
Comments suppressed due to low confidence (1)

src/components/Counter.tsx:1

  • Using string slicing on toString() to extract date components is fragile. Use the Temporal API's built-in methods instead: lastIncidentDate.toZonedDateTimeISO(timeZone).toPlainDate() to properly convert Instant to PlainDate.
import React, { useEffect, useState } from 'react';

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/utils/timeAgo.ts Outdated
Comment thread src/components/Counter.tsx
Comment thread src/components/Counter.tsx Outdated
Comment thread src/app/page.tsx Outdated
@IvanGodinez21 IvanGodinez21 changed the title refactor(): recreate component refactor(Counter): recreate component Oct 24, 2025
@IvanGodinez21
IvanGodinez21 force-pushed the refactor/counter-component branch from dfb2a11 to dd4959c Compare October 24, 2025 05:52
Copilot AI review requested due to automatic review settings October 25, 2025 04:35
@IvanGodinez21
IvanGodinez21 force-pushed the refactor/counter-component branch from dd4959c to 0c73649 Compare October 25, 2025 04:35

Copilot AI 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.

Pull Request Overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.


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

Comment thread src/components/Counter.tsx Outdated
Comment thread src/components/Counter.tsx Outdated
@IvanGodinez21
IvanGodinez21 force-pushed the refactor/counter-component branch from 0c73649 to d2abf75 Compare October 25, 2025 06:17
Copilot AI review requested due to automatic review settings October 25, 2025 19:10
@IvanGodinez21
IvanGodinez21 force-pushed the refactor/counter-component branch from d2abf75 to 27a6fc5 Compare October 25, 2025 19:10
@vercel

vercel Bot commented Oct 25, 2025

Copy link
Copy Markdown

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

Project Deployment Preview Comments Updated (UTC)
zeroday Ready Ready Preview Comment Nov 9, 2025 6:14pm

Copilot AI 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.

Pull Request Overview

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


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

Comment thread src/lib/mockData.ts Outdated
Comment thread src/components/Counter.tsx
Comment thread src/components/Counter.tsx Outdated
Comment thread src/components/Counter.tsx Outdated
Comment thread src/components/Counter.tsx Outdated

Copilot AI 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.

Pull Request Overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.


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

Comment thread src/components/Counter.tsx Outdated
Comment thread src/app/page.tsx

Copilot AI 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.

Pull Request Overview

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


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

Comment thread src/components/IncidentForm.tsx Outdated
Comment thread src/components/IncidentCard.tsx Outdated
Comment thread src/components/Counter.tsx Outdated
Comment thread src/components/Counter.tsx Outdated
Comment thread src/components/Counter.tsx Outdated
@IvanGodinez21
IvanGodinez21 force-pushed the refactor/counter-component branch from b6b1b0f to 35cee71 Compare November 2, 2025 22:26
Copilot AI review requested due to automatic review settings November 2, 2025 22:28
@IvanGodinez21
IvanGodinez21 force-pushed the refactor/counter-component branch from 35cee71 to c9376ea Compare November 2, 2025 22:28

Copilot AI 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.

Pull Request Overview

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


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

Comment thread src/components/Counter.tsx
Comment thread src/components/Counter.tsx
Comment thread src/lib/mockData.ts
Comment thread src/components/Counter.tsx Outdated
Comment thread src/components/Counter.tsx
@IvanGodinez21
IvanGodinez21 requested a review from Copilot November 2, 2025 23:21

Copilot AI 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.

Pull Request Overview

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


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

Comment thread src/components/Counter.tsx
Comment thread src/components/Counter.tsx
Comment thread src/components/Counter.tsx
Comment thread src/components/Counter.tsx
Comment thread src/components/Counter.tsx
Co-Authored-By: Cristian C. Giraldo <52677987+imchriistian@users.noreply.github.com>

Copilot AI 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.

Pull Request Overview

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


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

Comment thread src/components/Counter.tsx
Comment thread src/components/Counter.tsx
Comment thread src/components/Counter.tsx
Comment thread src/components/IncidentForm.tsx
@IvanGodinez21
IvanGodinez21 marked this pull request as ready for review November 9, 2025 18:24
@IvanGodinez21
IvanGodinez21 requested a review from a team as a code owner November 9, 2025 18:24
@IvanGodinez21
IvanGodinez21 enabled auto-merge (squash) November 9, 2025 18:25
@IvanGodinez21

Copy link
Copy Markdown
Member Author

@QuackDuster and @imchriistian, I request the approval, and please help me to resolve the @copilot comments. You can commit and/or amend commit, I will squash everything anyway

Copilot AI commented Nov 9, 2025

Copy link
Copy Markdown

@IvanGodinez21 I've opened a new pull request, #4, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI 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.

Pull request overview

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


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

Comment thread src/components/Counter.tsx
Comment thread src/app/page.tsx
@IvanGodinez21
IvanGodinez21 merged commit 4d760e6 into main Apr 4, 2026
15 checks passed
@IvanGodinez21
IvanGodinez21 deleted the refactor/counter-component branch April 4, 2026 07:26
@IvanGodinez21 IvanGodinez21 added the refactor Changes that neither fixes a bug nor adds a feature label Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Changes that neither fixes a bug nor adds a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants