Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eclipse-timer/mobile",
"version": "1.1.15",
"version": "1.1.16",
"private": true,
"main": "index.js",
"scripts": {
Expand Down
25 changes: 17 additions & 8 deletions apps/mobile/src/screens/TimerScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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,
Expand Down Expand Up @@ -742,11 +751,11 @@ export default function TimerScreen({
</Text>
</View>
<View style={styles.metricTile}>
<Text style={styles.metricLabel}>Magnitude</Text>
<Text style={styles.metricValue}>{formatMagnitude(timer.result.magnitude)}</Text>
<Text style={styles.metricLabel}>C1-C4 Duration</Text>
<Text style={styles.metricValue}>{formatC1ToC4Duration(timer.result)}</Text>
</View>
<View style={styles.metricTile}>
<Text style={styles.metricLabel}>Central Duration</Text>
<Text style={styles.metricLabel}>Totality Duration</Text>
<Text style={styles.metricValue}>
{formatDuration(timer.result.durationSeconds)}
Comment on lines +758 to 760
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep C2-C3 duration label accurate for annular eclipses

durationSeconds is derived from c2c3 for both total and annular events, so labeling it as Totality Duration is incorrect whenever kindAtLocation === "annular". In those cases the UI reports annularity time with a totality label, which is a user-facing accuracy issue; use a neutral label (e.g., central/phase duration) or switch the label by eclipse type.

Useful? React with 👍 / 👎.

</Text>
Expand Down