Add manual block start and fix timer display labels

Blocks are now selected without auto-starting the timer. Clicking a block
makes it current (highlighted) but leaves it in a ready state. A "Start"
button (indigo) triggers timing for a fresh block; "Resume" appears for
previously-worked blocks; "Pause" remains while running.

Also fixes the sidebar duration label to show "Done!" when elapsed ≥ total
and "< 1 min" for sub-minute remaining time instead of "0 min".

Backend adds a "select" event type that records an implicit pause for the
previous block, updates current_block_id, and broadcasts is_paused=true
with prev_block_elapsed_seconds so the TV sidebar stays accurate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-03 00:09:27 -08:00
parent ca858c2050
commit cc599603cf
4 changed files with 102 additions and 26 deletions

View File

@@ -63,8 +63,9 @@ const durationLabel = computed(() => {
const totalSec = blockTotalSeconds()
if (totalSec <= 0) return ''
const remSec = Math.max(0, totalSec - props.elapsedSeconds)
if (remSec <= 0) return 'Done!'
const remMin = Math.floor(remSec / 60)
if (remMin <= 0) return '0 min'
if (remMin <= 0) return '< 1 min'
if (remMin >= 60) {
const h = Math.floor(remMin / 60)
const m = remMin % 60