Skip to content

feat: add Reset button to counter - #26

Draft
ks6088ts with Copilot wants to merge 3 commits into
mainfrom
copilot/reset-button-issue
Draft

feat: add Reset button to counter#26
ks6088ts with Copilot wants to merge 3 commits into
mainfrom
copilot/reset-button-issue

Conversation

Copilot AI commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

The counter had no way to reset to zero — only increment. Adds a Reset button alongside the existing counter that restores count to 0 and emits a telemetry event.

Changes

src/App.tsx

  • New Reset button resets count to 0 on click
  • Fires reset_button_clicked telemetry event with previousCount (captured before setCount(0) to avoid stale-closure issues in concurrent React)
<button
  type="button"
  className="counter"
  onClick={() => {
    const previousCount = count
    setCount(0)
    trackEvent('reset_button_clicked', { component: 'App' }, { previousCount })
  }}
>
  Reset
</button>

Tests

  • src/__tests__/e2e/app.e2e.spec.ts — asserts Reset button returns counter to Count is 0 and verifies the telemetry event fires with the correct previousCount
  • playwright/app.spec.ts — asserts Reset button is visible, clickable, and restores the counter display
Original prompt

Implement the Reset-button issue and print PR description

Created from Copilot CLI via the copilot delegate command.

Copilot AI changed the title [WIP] Implement reset button functionality feat: add Reset button to counter Jun 23, 2026
Copilot AI requested a review from ks6088ts June 23, 2026 08:46
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