From d4788eb7799988866329661526c2020a4983c3a0 Mon Sep 17 00:00:00 2001 From: Lalit Sharma Date: Mon, 23 Feb 2026 15:52:26 +0000 Subject: [PATCH] Update timer metrics to show C1-C4 duration --- CHANGELOG.md | 6 ++++++ apps/mobile/package.json | 2 +- apps/mobile/src/screens/TimerScreen.tsx | 25 +++++++++++++++++-------- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a3a219..65b7d78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.1.16] — 2026-02-23 + +### Changed +- Updated Timer screen summary metrics: replaced `Magnitude` with `C1-C4 Duration` (computed from first to last contact times) and renamed `Central Duration` to `Totality Duration` for clearer eclipse-phase wording. +- Bumped `apps/mobile` version to `1.1.16`. + ## [1.1.15] — 2026-02-23 ### Removed diff --git a/apps/mobile/package.json b/apps/mobile/package.json index 05816df..26ac883 100644 --- a/apps/mobile/package.json +++ b/apps/mobile/package.json @@ -1,6 +1,6 @@ { "name": "@eclipse-timer/mobile", - "version": "1.1.15", + "version": "1.1.16", "private": true, "main": "index.js", "scripts": { diff --git a/apps/mobile/src/screens/TimerScreen.tsx b/apps/mobile/src/screens/TimerScreen.tsx index f1c6f76..30e3d7e 100644 --- a/apps/mobile/src/screens/TimerScreen.tsx +++ b/apps/mobile/src/screens/TimerScreen.tsx @@ -38,11 +38,6 @@ function localKindLabel(kind: "none" | "partial" | "total" | "annular") { return "None"; } -function formatMagnitude(magnitude?: number) { - if (typeof magnitude !== "number" || !Number.isFinite(magnitude)) return "--"; - return magnitude.toFixed(3); -} - function formatDuration(seconds?: number) { if (typeof seconds !== "number" || !Number.isFinite(seconds) || seconds <= 0) return "--"; const totalSeconds = Math.round(seconds); @@ -51,6 +46,20 @@ function formatDuration(seconds?: number) { return `${mm}m ${String(ss).padStart(2, "0")}s`; } +function parseUtcTimestamp(iso?: string) { + if (!iso) return undefined; + const timestamp = Date.parse(iso); + if (!Number.isFinite(timestamp)) return undefined; + return timestamp; +} + +function formatC1ToC4Duration(result: Circumstances) { + const c1 = parseUtcTimestamp(result.c1Utc); + const c4 = parseUtcTimestamp(result.c4Utc); + if (c1 === undefined || c4 === undefined || c4 <= c1) return "--"; + return formatDuration((c4 - c1) / 1000); +} + function formatCardinalCoord( value: number, positiveHemisphere: string, @@ -742,11 +751,11 @@ export default function TimerScreen({ - Magnitude - {formatMagnitude(timer.result.magnitude)} + C1-C4 Duration + {formatC1ToC4Duration(timer.result)} - Central Duration + Totality Duration {formatDuration(timer.result.durationSeconds)}