Skip to content

Fix Timer MAX View moon/sun ratio scaling#8

Merged
c0d3rb4b4 merged 1 commit into
mainfrom
codex/fix-max-view-size-ratios-and-add-tests
Feb 23, 2026
Merged

Fix Timer MAX View moon/sun ratio scaling#8
c0d3rb4b4 merged 1 commit into
mainfrom
codex/fix-max-view-size-ratios-and-add-tests

Conversation

@c0d3rb4b4
Copy link
Copy Markdown
Owner

Motivation

  • The compact MAX View on the Timer hero used a much smaller stage but moon sizes were effectively fixed for the full preview scale, producing wrong proportions in the timer UI.
  • The intent is to make the compact (Timer) rendering use the same preview geometry scale so moon/sun ratios and tangency behavior match the full preview.
  • Assumed the correct behavior is strict proportional scaling of sun radius and derived moon radii/offsets from the same base preview constants.

Description

  • Parameterized moon radius and approach-offset math in apps/mobile/src/utils/previewGeometry.ts so both are computed relative to the supplied sunRadius instead of hard-coded numbers, and added ratio constants for annular/total/partial/none sizing and margins.
  • Derived the compact hero sun radius in apps/mobile/src/screens/TimerScreen.tsx from the canonical preview scale using PREVIEW_STAGE_SIZE/PREVIEW_SUN_RADIUS so the Timer MAX View stage uses a proportional sun radius.
  • Added regression tests in apps/mobile/tests/preview-geometry.test.ts that verify (1) moon/sun size ratio consistency between full preview and compact stage and (2) preservation of C1/C4 tangency distance in the compact stage.
  • Bumped apps/mobile version to 1.1.19 and documented the bugfix in CHANGELOG.md.

Testing

  • Ran unit tests: pnpm -C apps/mobile test tests/preview-geometry.test.ts, which executed the preview-geometry suite and resulted in all tests passing (1 file, 9 tests passed).
  • Ran typecheck: pnpm -C apps/mobile typecheck, which completed successfully with no TypeScript errors.

Codex Task

@c0d3rb4b4 c0d3rb4b4 merged commit 0b98114 into main Feb 23, 2026
1 check passed
@c0d3rb4b4 c0d3rb4b4 deleted the codex/fix-max-view-size-ratios-and-add-tests 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