Skip to content

refactor(#248): ジオデシック幾何を専用 non-view ファイルへ抽出#287

Merged
GeneralD merged 1 commit into
mainfrom
refactor/extract-geodesic-geometry
Jun 14, 2026
Merged

refactor(#248): ジオデシック幾何を専用 non-view ファイルへ抽出#287
GeneralD merged 1 commit into
mainfrom
refactor/extract-geodesic-geometry

Conversation

@GeneralD

Copy link
Copy Markdown
Owner

type breaking scope diff files tests review

概要

#286(#248) で導入したジオデシック球体ローディングインジケータの幾何生成ロジックを、OverlayContentView.swift(*View.swift)から専用ファイル GeodesicGeometry.swift へ抽出する。

CodeRabbit が #286 で残した nitpick への後続対応:

Extract geometry-generation feature logic from OverlayContentView.swift.
GeodesicGeometry/Vertex3D and related construction logic are substantial feature logic in a *View.swift file.

リポジトリの .coderabbit.yaml ガイドライン(**/*View.swift: "Views do not own business logic")に沿い、View ファイルを SwiftUI View 型のみに保つ。

変更点

種別 内容
移動 Vertex3D(unit-sphere 頂点)+ GeodesicGeometry(Goldberg 多面体のエッジ生成)→ GeodesicGeometry.swift
残置 GeodesicMetrics / GeodesicGold は描画専用の private 定数 → Canvas 描画のみが参照するため View 側に残し、access control を不必要に広げない
保持 GeodesicGeometryinternal のまま → GeodesicGeometryTests@testable import Views で到達可能

動作・テスト

  • 振る舞い変更なし(純粋なファイル分割)
  • swift build 成功
  • GeodesicGeometryTests(120 edges / unit-sphere / 非退化)3件合格
  • フルスイート 942 tests 全合格

Refs #248

Move Vertex3D and GeodesicGeometry (the Goldberg-polyhedron edge
generation) out of OverlayContentView.swift into GeodesicGeometry.swift,
keeping the *View.swift file to SwiftUI view types only per the repo's
.coderabbit.yaml guideline ("Views do not own business logic").

The rendering constants GeodesicMetrics/GeodesicGold stay private in the
view file since they are only consumed by the Canvas drawing. Geometry
remains internal so GeodesicGeometryTests still reaches it via
@testable import Views. No behavior change; all 942 tests pass.

Addresses CodeRabbit nitpick on #286.
Copilot AI review requested due to automatic review settings June 14, 2026 16:17
@GeneralD GeneralD self-assigned this Jun 14, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@GeneralD, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 28 minutes and 14 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ab22484c-a1a2-47aa-8ca4-12e7874c43d5

📥 Commits

Reviewing files that changed from the base of the PR and between ea31624 and 70604a5.

📒 Files selected for processing (3)
  • Sources/VersionHandler/Resources/version.txt
  • Sources/Views/Overlay/GeodesicGeometry.swift
  • Sources/Views/Overlay/OverlayContentView.swift
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/extract-geodesic-geometry

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented Jun 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@GeneralD GeneralD merged commit 12561c7 into main Jun 14, 2026
4 checks passed
@GeneralD GeneralD deleted the refactor/extract-geodesic-geometry branch June 14, 2026 18:48
GeneralD added a commit that referenced this pull request Jun 14, 2026
![type](https://img.shields.io/badge/type-test-blue)
![breaking](https://img.shields.io/badge/breaking-no-green)
![scope](https://img.shields.io/badge/scope-geometry-blue)
![diff](https://img.shields.io/badge/diff-+23%20--1-green)
![files](https://img.shields.io/badge/files-2-green)
![tests](https://img.shields.io/badge/tests-added-green)
![review](https://img.shields.io/badge/review-quick%20look-green)

#287 で抽出した `GeodesicGeometry` のテストを補強する。

## 背景

既存テストは strut が **120 本**であることだけを固定していた。しかし面リストや細分化が壊れても、本数 120
を保ったまま**双対のトポロジーだけが崩れる**ケースは検出できない。

## 変更

各 strut 端点(= icosphere 三角形の centroid = Goldberg
双対の頂点)の**接続次数**を数え、不変条件を1つ追加する。

- ハブ(ユニーク頂点)が **80 個**ちょうど
- 全ハブの次数が **3**(閉多様体なので各三角形は3辺すべてを共有 → 三価ケージ)
- `80 × 3 / 2 = 120` で既存の 120-edge テストと整合

座標は値コピーで再利用されるため、`1e-6` 量子化キーで同一 centroid を1つの identity に畳む(最近接 centroid
間距離 ≈ 0.36 ≫ 1e-6 なので衝突しない)。Foundation 非依存。

## 補足

双対の「12 pentagon + 30 hexagon」はケージの**面**の話で、strut
端点(頂点)は一様に次数3。エッジリストから面を循環抽出するのは過剰なので、頂点レベルで効く三価性で構造を固定した。

`swift test --filter GeodesicGeometryTests` → 4 件すべてパス。


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

* **Chores**
  * Version bumped to 2.14.2.

* **Tests**
* Expanded test suite with geodesic geometry validation tests, verifying
structural integrity and proper hub formation in geometric constructs.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants