Time update is skipping second — it's only updated server side; render on frontend and sync periodically from backend.
The sim clock in the left pane previously re-rendered once per 1s poll, so seconds jumped. Now:
New lib/useSimClock.ts hook (+ pure unit-testable core advanceSimClock): keeps an anchor {clockMs, at, timeScale, paused} updated on every snapshot (re-sync = snap to server truth — error bounded by network latency only) and derives the display clock ~10×/s: anchor.clockMs + (now − at) × timeScale while running, frozen at the anchor while paused. This mirrors the server's own tick-on-read model (clockMs += Δreal × timeScale).
LeftPane feeds it effective controls {timeScale: pendingScale ?? snap.timeScale, paused} so pause/scale changes take effect on click/drag without waiting for a confirming snapshot; render shape unchanged ({clock}{paused ? ' (paused)' : ''}).
RightPane deadline/penalty previews untouched (snapshot-based). No server/OpenAPI changes.
E2E
New test in e2e/panes.spec.ts: at scale 1000 the displayed clock advances strictly monotonically across three ~1.3s samples, with a total-advance sanity bound. All existing clock assertions pass unchanged (format identical; paused clock frozen).
Version
package.json → 0.16.1
CHANGELOG.md — v0.16.1 entry at top
Checks (local)
tsc --noEmit clean; unit 261/261 green (was 256, +5 core tests); playwright test --list = 35 tests
e2e not run locally by design — CI verifies against the isolated stack
## What (issue #7)
*Time update is skipping second — it's only updated server side; render on frontend and sync periodically from backend.*
The sim clock in the left pane previously re-rendered once per 1s poll, so seconds jumped. Now:
- New **`lib/useSimClock.ts`** hook (+ pure unit-testable core `advanceSimClock`): keeps an anchor `{clockMs, at, timeScale, paused}` updated on every snapshot (re-sync = snap to server truth — error bounded by network latency only) and derives the display clock ~10×/s: `anchor.clockMs + (now − at) × timeScale` while running, frozen at the anchor while paused. This mirrors the server's own tick-on-read model (`clockMs += Δreal × timeScale`).
- LeftPane feeds it effective controls `{timeScale: pendingScale ?? snap.timeScale, paused}` so pause/scale changes take effect on click/drag without waiting for a confirming snapshot; render shape unchanged (`{clock}{paused ? ' (paused)' : ''}`).
- RightPane deadline/penalty previews untouched (snapshot-based). No server/OpenAPI changes.
## E2E
New test in `e2e/panes.spec.ts`: at scale 1000 the displayed clock advances strictly monotonically across three ~1.3s samples, with a total-advance sanity bound. All existing clock assertions pass unchanged (format identical; paused clock frozen).
## Version
- `package.json` → **0.16.1**
- `CHANGELOG.md` — v0.16.1 entry at top
## Checks (local)
- `tsc --noEmit` clean; unit **261/261** green (was 256, +5 core tests); `playwright test --list` = 35 tests
- e2e not run locally by design — CI verifies against the isolated stack
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What (issue #7)
Time update is skipping second — it's only updated server side; render on frontend and sync periodically from backend.
The sim clock in the left pane previously re-rendered once per 1s poll, so seconds jumped. Now:
lib/useSimClock.tshook (+ pure unit-testable coreadvanceSimClock): keeps an anchor{clockMs, at, timeScale, paused}updated on every snapshot (re-sync = snap to server truth — error bounded by network latency only) and derives the display clock ~10×/s:anchor.clockMs + (now − at) × timeScalewhile running, frozen at the anchor while paused. This mirrors the server's own tick-on-read model (clockMs += Δreal × timeScale).{timeScale: pendingScale ?? snap.timeScale, paused}so pause/scale changes take effect on click/drag without waiting for a confirming snapshot; render shape unchanged ({clock}{paused ? ' (paused)' : ''}).E2E
New test in
e2e/panes.spec.ts: at scale 1000 the displayed clock advances strictly monotonically across three ~1.3s samples, with a total-advance sanity bound. All existing clock assertions pass unchanged (format identical; paused clock frozen).Version
package.json→ 0.16.1CHANGELOG.md— v0.16.1 entry at topChecks (local)
tsc --noEmitclean; unit 261/261 green (was 256, +5 core tests);playwright test --list= 35 tests