Skip to content

chore: split UloopPausePointRegistry co-located types into class-per-file - #1654

Merged
hatayama merged 1 commit into
v3-betafrom
refactor/hatayama/split-pause-point-registry-types
Jul 9, 2026
Merged

hatayama merged 1 commit into
v3-betafrom
refactor/hatayama/split-pause-point-registry-types

Conversation

@hatayama

@hatayama hatayama commented Jul 9, 2026 •

Copy link
Copy Markdown
Owner

Refs: R3-6 in Unity CLI Loop refactor round 3 ToDo

Summary

  • UloopPausePointRegistry.cs (525 lines) mixed the registry facade with 8 other top-level types: UloopPausePointEditorStateCapturedAt, UloopPausePointEditorStateSnapshot, IUloopPausePointPauseController, UnityEditorPausePointPauseController, UloopPausePointSnapshot, UloopPausePointClearAllResult, UloopPausePointEntry, UloopPausePointStatus.
  • Moved each of the 8 types to its own file, byte-equal, preserving the #if UNITY_EDITOR ... #endif guard on every new file (required since this is a Runtime asmdef and UnityEditorPausePointPauseController references UnityEditor.EditorApplication).
  • The registry class (with its mutable static state) stays at its original file path, so no StaticFacadeStateGuardTests tracking update is needed.

Verification

  • Normalized two-way diff between the original file and the combined new files: zero residue (only using statement redistribution across files, no line lost or added).
  • Unity compile: 0 errors / 0 warnings.
  • PausePointTests (Editor): 25/25 passed.
  • No protocol version change; this is a pure structural move with no behavior change.

Review in cubic

UloopPausePointRegistry.cs mixed the registry facade with 8 other
top-level types (snapshot, entry, pause controller, DTOs, status
constants) in one 525-line file. Move each type to its own file,
byte-equal, keeping the registry's mutable static state at its
original path so no test tracking needs updating.
@coderabbitai

coderabbitai Bot commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6663efab-d4e2-4eb5-abbe-a3670f937b5a

📥 Commits

Reviewing files that changed from the base of the PR and between 50fd5b9 and 20b0e6a.

⛔ Files ignored due to path filters (8)
  • Packages/src/Runtime/PausePoints/IUloopPausePointPauseController.cs.meta is excluded by none and included by none
  • Packages/src/Runtime/PausePoints/UloopPausePointClearAllResult.cs.meta is excluded by none and included by none
  • Packages/src/Runtime/PausePoints/UloopPausePointEditorStateCapturedAt.cs.meta is excluded by none and included by none
  • Packages/src/Runtime/PausePoints/UloopPausePointEditorStateSnapshot.cs.meta is excluded by none and included by none
  • Packages/src/Runtime/PausePoints/UloopPausePointEntry.cs.meta is excluded by none and included by none
  • Packages/src/Runtime/PausePoints/UloopPausePointSnapshot.cs.meta is excluded by none and included by none
  • Packages/src/Runtime/PausePoints/UloopPausePointStatus.cs.meta is excluded by none and included by none
  • Packages/src/Runtime/PausePoints/UnityEditorPausePointPauseController.cs.meta is excluded by none and included by none
📒 Files selected for processing (9)
  • Packages/src/Runtime/PausePoints/IUloopPausePointPauseController.cs
  • Packages/src/Runtime/PausePoints/UloopPausePointClearAllResult.cs
  • Packages/src/Runtime/PausePoints/UloopPausePointEditorStateCapturedAt.cs
  • Packages/src/Runtime/PausePoints/UloopPausePointEditorStateSnapshot.cs
  • Packages/src/Runtime/PausePoints/UloopPausePointEntry.cs
  • Packages/src/Runtime/PausePoints/UloopPausePointRegistry.cs
  • Packages/src/Runtime/PausePoints/UloopPausePointSnapshot.cs
  • Packages/src/Runtime/PausePoints/UloopPausePointStatus.cs
  • Packages/src/Runtime/PausePoints/UnityEditorPausePointPauseController.cs
💤 Files with no reviewable changes (1)
  • Packages/src/Runtime/PausePoints/UloopPausePointRegistry.cs

📝 Walkthrough

Walkthrough

Extracts pause-point supporting types previously embedded in UloopPausePointRegistry.cs into separate editor-only files: IUloopPausePointPauseController, UloopPausePointEditorStateCapturedAt, UloopPausePointEditorStateSnapshot, UloopPausePointEntry, UloopPausePointSnapshot, UloopPausePointClearAllResult, UloopPausePointStatus, and UnityEditorPausePointPauseController. The registry file is stripped of these definitions.

Changes

Pause-point type extraction

Layer / File(s) Summary
Pause controller interface and editor state snapshot
Packages/src/Runtime/PausePoints/IUloopPausePointPauseController.cs, Packages/src/Runtime/PausePoints/UloopPausePointEditorStateCapturedAt.cs, Packages/src/Runtime/PausePoints/UloopPausePointEditorStateSnapshot.cs, Packages/src/Runtime/PausePoints/UnityEditorPausePointPauseController.cs
New interface exposes IsPlaying, IsPaused, Pause(); new constants class names snapshot capture points; new immutable snapshot class with FromController factory; new Unity editor adapter implementing the interface via EditorApplication.
Pause-point entry state machine
Packages/src/Runtime/PausePoints/UloopPausePointEntry.cs, Packages/src/Runtime/PausePoints/UloopPausePointStatus.cs
New status constants class; new entry type tracking enablement window, hit metadata, and status with ExpireIfNeeded, MarkCleared, RecordHit, and ToSnapshot methods.
Snapshot DTO and clear-all result
Packages/src/Runtime/PausePoints/UloopPausePointSnapshot.cs, Packages/src/Runtime/PausePoints/UloopPausePointClearAllResult.cs
New immutable DTO with normalized properties and NotEnabled factory; new result type wrapping cleared count, UTC timestamp, and editor state.
Registry cleanup
Packages/src/Runtime/PausePoints/UloopPausePointRegistry.cs
Removes using UnityEditor; and deletes all previously embedded supporting type definitions, leaving only registry logic.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the refactor of moving co-located registry types into separate files.
Description check ✅ Passed The description matches the changeset and explains the class-per-file refactor plus verification.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/hatayama/split-pause-point-registry-types

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.

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.

1 participant