Skip to content

Fix preview moon direction: use bearing-based 2D travel vector#5

Merged
c0d3rb4b4 merged 1 commit into
mainfrom
codex/fix-moon-direction-update-for-2024-eclipse
Feb 22, 2026
Merged

Fix preview moon direction: use bearing-based 2D travel vector#5
c0d3rb4b4 merged 1 commit into
mainfrom
codex/fix-moon-direction-update-for-2024-eclipse

Conversation

@c0d3rb4b4
Copy link
Copy Markdown
Owner

Motivation

  • The preview moon animation was constrained to a horizontal left/right axis and produced incorrect-looking motion for some locations (notably 2024-like paths); the intent is to compute and apply the true direction between contact bearings so the moon can move diagonally.

Description

  • Replaced the 1D travel direction logic with a 2D travel vector: added determinePreviewTravelVector and bearingDegToUnitCirclePoint and applied the vector to both X and Y positioning in calculatePreviewMoonGeometry so the moon path can include vertical drift. (apps/mobile/src/utils/previewGeometry.ts)
  • Added describePreviewTravelDirection to produce a short user-facing label for the computed vector and wired it into the preview UI as Moon path: .... (apps/mobile/src/utils/previewGeometry.ts, apps/mobile/src/screens/EclipsePreviewScreen.tsx)
  • Updated EclipsePreviewScreen to compute and pass travelVector into the geometry calculation and to display the direction label. (apps/mobile/src/screens/EclipsePreviewScreen.tsx)
  • Extended/rewrote tests in apps/mobile/tests/preview-geometry.test.ts to validate diagonal travel vectors, fallback behavior when bearings are missing, and the user-facing direction string. (apps/mobile/tests/preview-geometry.test.ts)
  • Bumped the mobile package version to 1.1.12 and added a 1.1.12 entry to CHANGELOG.md. (apps/mobile/package.json, CHANGELOG.md)

Testing

  • Ran unit tests with pnpm -C apps/mobile test and all mobile tests passed (5 files, 15 tests passed) including preview-geometry.test.ts (6 tests) which passed.
  • Ran targeted test run pnpm -C apps/mobile test -- preview-geometry.test.ts and it passed.
  • Ran type checking with pnpm -C apps/mobile typecheck with no errors.
  • Ran lint with pnpm -C apps/mobile lint and fixed the reported unused-variable warning; the linter now reports clean.

Codex Task

@c0d3rb4b4 c0d3rb4b4 merged commit 63f4ae0 into main Feb 22, 2026
1 check passed
@c0d3rb4b4 c0d3rb4b4 deleted the codex/fix-moon-direction-update-for-2024-eclipse branch February 26, 2026 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant