Revert "fix(workbench): cap visible timing ticker steps (#2007)"

This reverts commit b61fb4e65c.
This commit is contained in:
lyon
2026-06-24 19:23:29 +08:00
parent e390becd72
commit 452524f80a
@@ -4,7 +4,6 @@
import { onBeforeUnmount, readonly, ref, watch, type Ref } from "vue";
const TICK_INTERVAL_MS = 1000;
const MAX_VISIBLE_TICK_STEP_MS = TICK_INTERVAL_MS;
const nowMs = ref(Date.now());
const activeSubscribers = new Map<symbol, boolean>();
@@ -31,18 +30,8 @@ export function useWorkbenchNowTicker(enabled: Ref<boolean>) {
return { nowMs: readonly(nowMs), refreshNow };
}
function refreshNow(reset = false): void {
const wallNow = Date.now();
if (reset) {
nowMs.value = wallNow;
return;
}
const previous = Number(nowMs.value);
if (!Number.isFinite(previous) || wallNow <= previous) {
nowMs.value = wallNow;
return;
}
nowMs.value = Math.min(wallNow, previous + MAX_VISIBLE_TICK_STEP_MS);
function refreshNow(): void {
nowMs.value = Date.now();
}
function reconcileTimer(): void {
@@ -51,7 +40,7 @@ function reconcileTimer(): void {
// elapsed/recent labels advance monotonically instead of jumping on resume.
const shouldRun = isBrowser() && hasActiveSubscriber();
if (shouldRun && timer === null) {
refreshNow(true);
refreshNow();
timer = window.setInterval(refreshNow, TICK_INTERVAL_MS);
return;
}