Skip to content

Honor preview moon travel direction and bump mobile to v1.1.11#4

Merged
c0d3rb4b4 merged 1 commit into
mainfrom
codex/ensure-accurate-moon-direction-in-preview-mode
Feb 22, 2026
Merged

Honor preview moon travel direction and bump mobile to v1.1.11#4
c0d3rb4b4 merged 1 commit into
mainfrom
codex/ensure-accurate-moon-direction-in-preview-mode

Conversation

@c0d3rb4b4
Copy link
Copy Markdown
Owner

Motivation

  • Make the preview moon horizontal travel direction reflect local contact-bearing progression so the animation matches real-world geometry and fixes cases where the moon moved the wrong way.
  • Surface contact bearing inputs in the preview payload so geometry calculations can choose a direction when bearings exist.
  • Add regression tests to prevent regressions around bearing-driven direction selection and fallback behavior.

Description

  • Added PreviewDirectionBearings and helper functions normalizeSignedDeltaDeg, resolveDirectionalBearingPair, and determinePreviewTravelDirection in apps/mobile/src/utils/previewGeometry.ts to derive a signed travel direction (1 or -1) from available contact bearings.
  • Extended calculatePreviewMoonGeometry to accept an optional travelDirection parameter and applied it to the computed moonOffsetX so geometry can flip horizontally when required.
  • Wired c1BearingDeg/c2BearingDeg/c3BearingDeg/c4BearingDeg into the PreviewPayload in apps/mobile/src/navigation/RootNavigator.tsx and consumed them in EclipsePreviewScreen.tsx by calling determinePreviewTravelDirection(...) and adding the result to the calculatePreviewMoonGeometry call while updating memo dependencies.
  • Added regression tests in apps/mobile/tests/preview-geometry.test.ts covering C1/C2/MAX/C3 tangency behavior, bearing-driven direction flips, and fallback to default direction when bearings are missing, and updated CHANGELOG.md and apps/mobile/package.json (bumped to 1.1.11).

Testing

  • Ran pnpm -C apps/mobile test tests/preview-geometry.test.ts and all tests passed (5 passed).
  • Ran pnpm -C apps/mobile typecheck and TypeScript checking completed with no errors.

Codex Task

@c0d3rb4b4 c0d3rb4b4 merged commit a7ae3b0 into main Feb 22, 2026
1 check passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c4d5d3d0cf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}

function normalizeSignedDeltaDeg(fromDeg: number, toDeg: number) {
const delta = ((toDeg - fromDeg + 540) % 360) - 180;
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 Preserve bearing sweep direction across >180° contacts

determinePreviewTravelDirection currently relies on normalizeSignedDeltaDeg, which forces the C1→C4 bearing delta into [-180, 180]; this flips the sign when the true contact progression spans just over 180° (for example, catalog case 2038-07-02T has increasing bearings from ~90° at C1 to ~270° at C4, while C2/C3 are also increasing, but this normalization yields a negative delta). In those cases the preview gets travelDirection = -1 and animates the moon in the opposite horizontal direction from the chronological contact progression.

Useful? React with 👍 / 👎.

@c0d3rb4b4 c0d3rb4b4 deleted the codex/ensure-accurate-moon-direction-in-preview-mode 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