Skip to content

refactor: rewrite Timer in constraints in mind#58

Merged
V3RON merged 3 commits intomainfrom
refactor/timer
Feb 3, 2026
Merged

refactor: rewrite Timer in constraints in mind#58
V3RON merged 3 commits intomainfrom
refactor/timer

Conversation

@V3RON
Copy link
Contributor

@V3RON V3RON commented Feb 2, 2026

This pull request includes a complete rewrite of the Timer component, taking into account all constraints of Live Activity and Widget environments. As part of this work, TimelineView was removed and, as a consequence, autoHideOnEnd was also removed. The completed label will still be shown, but only when the Live Activity is updated via push notifications or the on-device API.

See #20

@vercel
Copy link

vercel bot commented Feb 2, 2026

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

Project Deployment Actions Updated (UTC)
voltra Ready Ready Preview, Comment Feb 2, 2026 6:13pm

Request Review

@alex-vance
Copy link

@V3RON Curious if you had any issues with counting up on times (stopwatch functionality). I needed to add this patch to get it to work, is this a problem any longer?


diff --git a/node_modules/voltra/ios/ui/Views/VoltraTimer.swift b/node_modules/voltra/ios/ui/Views/VoltraTimer.swift
index 613cc55..336b335 100644
--- a/node_modules/voltra/ios/ui/Views/VoltraTimer.swift
+++ b/node_modules/voltra/ios/ui/Views/VoltraTimer.swift
@@ -80,7 +80,7 @@ public struct VoltraTimer: VoltraView {
       } else if style == "relative" {
         Text(range.lowerBound, style: .relative)
       } else {
-        Text(timerInterval: range.lowerBound ... context.date, countsDown: false, showsHours: showHours)
+        Text(timerInterval: range.lowerBound ... .distantFuture, countsDown: false, showsHours: showHours)
           .monospacedDigit()
       }
     }

Basically this uses .distantFuture instead of context.date. This was the only way I could render a stopwatch style timer.

@V3RON
Copy link
Contributor Author

V3RON commented Feb 2, 2026

@alex-vance

It should work just fine now as long as you omit the duration and end time. There's a new playground in the example app where you can try it out.

@V3RON
Copy link
Contributor Author

V3RON commented Feb 3, 2026

See #62

@V3RON V3RON merged commit a607e75 into main Feb 3, 2026
4 of 6 checks passed
@V3RON V3RON deleted the refactor/timer branch February 3, 2026 15:20
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.

Timer doesn't count live in Live Activities - TimelineView.animation frozen by ActivityKit Countdown Timer starts counting upward on end

2 participants