8000 Fix UI Timers Not Starting/Stopping Correctly (Countdown & Countup Support) by Copilot · Pull Request #28 · SergeiGolos/wod-wiki · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix UI Timers Not Starting/Stopping Correctly (Countdown & Countup Support) #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 23, 2025

Conversation

Copilot
Copy link
@Copilot Copilot AI commented May 23, 2025

This PR resolves the issue with UI timers not starting or updating correctly by implementing a comprehensive timer state management system.

Problem

  • Timer displays weren't updating properly when started
  • No distinction between countdown vs countup timers
  • Timers weren't properly stopped when blocks were completed

Solution

The implementation adds a proper timer state system with several key improvements:

  1. Fixed core timer functionality:

    • Updated SetClockAction to use the actual timeSpans from the current block
    • Modified CompleteTimerAction to properly stop the timer before popping the block
  2. Implemented timer state system:

    • Created SetTimerStateAction with TimerState enum (RUNNING_COUNTDOWN, RUNNING_COUNTUP, PAUSED, STOPPED)
    • Updated EffortBlock to use appropriate timer states based on duration
    • Enhanced TimedGroupBlock to properly manage timer states for group timers
  3. Updated UI components:

    • Refactored useClockRegistry hook to track both duration and state information
    • Updated WodTimer component to use timer state for proper rendering
    • Modified ClockContext to include timer state information
  4. Added tests and documentation:

    • Created test cases for the timer components and actions
    • Added documentation in TimerStateManagement.md

These changes ensure that all the required timer use cases are now properly supported:

  • ✅ Effort blocks with a countdown timer show the countdown timer
  • ✅ Effort blocks with no duration show a count-up timer until the "Complete" button is clicked
  • ✅ Repeating blocks as timer groups show the repeating timer group timer

Fixes #27.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits May 23, 2025 06:21
… timers

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>
Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>
Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>
@SergeiGolos SergeiGolos marked this pull request as ready for review May 23, 2025 06:27
@Copilot Copilot AI changed the title [WIP] Issue: Deep Dive & Fix – UI Timers Not Starting (Start/Stop Actions) Fix UI Timers Not Starting/Stopping Correctly (Countdown & Countup Support) May 23, 2025
@Copilot Copilot AI requested a review from SergeiGolos May 23, 2025 06:28
Copilot finished work on behalf of SergeiGolos May 23, 2025 06:28
@SergeiGolos SergeiGolos merged commit fc96f13 into main May 23, 2025
SergeiGolos added a commit that referenced this pull request May 23, 2025
* Fix UI Timers Not Starting/Stopping Correctly (Countdown & Countup Support) (#28)

* Initial plan for issue

* Fix SetClockAction and CompleteTimerAction to properly start and stop timers

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Implement timer state management and UI integration

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Add tests for timer functionality

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Convert Jest tests to Vitest for consistent testing framework (#30)

* Initial plan for issue

* Convert Jest tests to Vitest in ActionOverhaul.test.ts

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Add vitest.config.ts file for test configuration

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Add fade-in animation for newly added efforts (#32)

* Initial plan for issue

* Add fade-in animation for new effort rows

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>
SergeiGolos added a commit that referenced this pull request May 23, 2025
* Fix UI Timers Not Starting/Stopping Correctly (Countdown & Countup Support) (#28)

* Initial plan for issue

* Fix SetClockAction and CompleteTimerAction to properly start and stop timers

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Implement timer state management and UI integration

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Add tests for timer functionality

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Convert Jest tests to Vitest for consistent testing framework (#30)

* Initial plan for issue

* Convert Jest tests to Vitest in ActionOverhaul.test.ts

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Add vitest.config.ts file for test configuration

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Add fade-in animation for newly added efforts (#32)

* Initial plan for issue

* Add fade-in animation for new effort rows

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Fix efforts rows order to show newest entries at the top (#33)

* Initial plan for issue

* Fix efforts rows sorting order to show newest efforts at the top

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Implement ResultSpanAggregate Interface and Aggregation Framework (#35)

* Initial plan for issue

* Implement ResultSpanAggregate interface and aggregation functionality

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* some unit test updates

* license file added

* Fix failing unit tests in core metrics and runtime modules (#39)

* Initial plan for issue

* Fix unit test failures

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* fixed tests

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>
SergeiGolos added a commit that referenced this pull request May 23, 2025
* Fix UI Timers Not Starting/Stopping Correctly (Countdown & Countup Support) (#28)

* Initial plan for issue

* Fix SetClockAction and CompleteTimerAction to properly start and stop timers

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Implement timer state management and UI integration

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Add tests for timer functionality

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Convert Jest tests to Vitest for consistent testing framework (#30)

* Initial plan for issue

* Convert Jest tests to Vitest in ActionOverhaul.test.ts

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Add vitest.config.ts file for test configuration

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Add fade-in animation for newly added efforts (#32)

* Initial plan for issue

* Add fade-in animation for new effort rows

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Fix efforts rows order to show newest entries at the top (#33)

* Initial plan for issue

* Fix efforts rows sorting order to show newest efforts at the top

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Implement ResultSpanAggregate Interface and Aggregation Framework (#35)

* Initial plan for issue

* Implement ResultSpanAggregate interface and aggregation functionality

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* some unit test updates

* license file added

* Fix failing unit tests in core metrics and runtime modules (#39)

* Initial plan for issue

* Fix unit test failures

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* fixed tests

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>
SergeiGolos added a commit that referenced this pull request May 23, 2025
* Fix UI Timers Not Starting/Stopping Correctly (Countdown & Countup Support) (#28)

* Initial plan for issue

* Fix SetClockAction and CompleteTimerAction to properly start and stop timers

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Implement timer state management and UI integration

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Add tests for timer functionality

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Convert Jest tests to Vitest for consistent testing framework (#30)

* Initial plan for issue

* Convert Jest tests to Vitest in ActionOverhaul.test.ts

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Add vitest.config.ts file for test configuration

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Add fade-in animation for newly added efforts (#32)

* Initial plan for issue

* Add fade-in animation for new effort rows

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Fix efforts rows order to show newest entries at the top (#33)

* Initial plan for issue

* Fix efforts rows sorting order to show newest efforts at the top

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Implement ResultSpanAggregate Interface and Aggregation Framework (#35)

* Initial plan for issue

* Implement ResultSpanAggregate interface and aggregation functionality

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* some unit test updates

* license file added

* Fix failing unit tests in core metrics and runtime modules (#39)

* Initial plan for issue

* Fix unit test failures

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* fixed tests

* Update GitHub Actions to conditionally run steps when secrets are available (#41)

* Initial plan for issue

* Add conditional secret handling for NPM_TOKEN and QODANA_TOKEN

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Add conditional handling for G_TAG variable

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Make Qodana scan step conditional on QODANA_TOKEN availability

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Fix GitHub workflow errors with secrets in reusable workflows (#43)

* Initial plan for issue

* Fix GitHub workflow error in _code_quality.yml

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Fix GitHub workflow errors in _build-qwik.yml

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Fix conditionals for secrets in reusable workflows

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Add 'n/a' check to skip workflow steps with special token value

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Fix wiki-sync workflow by changing strategy from clone to init (#45)

* Initial plan for issue

* Fix wiki-sync workflow by changing strategy from clone to init

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Update .github/workflows/sync-wiki.yml

* Update .github/workflows/sync-wiki.yml

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>
Co-authored-by: Sergei Golos <sergei.golos@gmail.com>

* Fix wiki publishing workflow by using GITHUB_TOKEN (#47)

* Initial plan for issue

* Update wiki publishing workflow to use GITHUB_TOKEN

Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>

* Update sync-wiki.yml

* Update sync-wiki.yml

* Update sync-wiki.yml

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SergeiGolos <660992+SergeiGolos@users.noreply.github.com>
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.

Issue: Deep Dive & Fix – UI Timers Not Starting (Start/Stop Actions)
2 participants
0