Skip to content

chore: Extract settings Tool Settings presenter - #1567

Merged
hatayama merged 1 commit into
v3-betafrom
codex/c4-12-extract-tool-settings-presenter
Jul 6, 2026
Merged

chore: Extract settings Tool Settings presenter#1567
hatayama merged 1 commit into
v3-betafrom
codex/c4-12-extract-tool-settings-presenter

Conversation

@hatayama

@hatayama hatayama commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Extract UnityCliLoopSettingsToolSettingsPresenter for Settings Tool Settings section data assembly.
  • Keep dirty catalog state, registry warmup scheduling, model updates, and tool toggle side effects in UnityCliLoopSettingsWindow.
  • Treat the Settings Skills slice as no-op because PR chore: Keep settings CLI setup data separate from the window #1566 already moved Skills display data through UnityCliLoopSettingsCliSetupPresenter; the remaining Skills code is async orchestration and side effects.

User Impact

  • No intended behavior change. Tool Settings header, loading, unavailable, and loaded list data are built from the same inputs and passed to the same UI section.

Deviations

  • UpdateCatalog updates the view and returns ToolSettingsSectionData so the window can keep ShouldKeepToolSettingsCatalogDirty and warmup policy unchanged. This is the approved minimal deviation from a pure void presenter update.
  • showToolSettings is parameterized instead of reading _model.UI.ShowToolSettings directly inside the moved code.
  • No new presenter-specific tests were added because constructing UnityCliLoopSettingsWindowUI just for the presenter would make the seam heavier than the moved logic; existing ToolSettingsSectionTests and UnityCliLoopSettingsWindowRefreshPolicyTests continue to pin the UI and dirty/warmup seams.

Verification

  • dist/darwin-arm64/uloop compile --project-path "$(git rev-parse --show-toplevel)" -> 0 errors / 0 warnings
  • dist/darwin-arm64/uloop run-tests --project-path "$(git rev-parse --show-toplevel)" --test-mode EditMode --filter-type exact --filter-value "io.github.hatayama.UnityCliLoop.Tests.Editor.ToolSettingsSectionTests" -> 11/11 passed
  • dist/darwin-arm64/uloop run-tests --project-path "$(git rev-parse --show-toplevel)" --test-mode EditMode --filter-type exact --filter-value "io.github.hatayama.UnityCliLoop.Tests.Editor.ToolSettingsUseCaseTests" -> 3/3 passed
  • dist/darwin-arm64/uloop run-tests --project-path "$(git rev-parse --show-toplevel)" --test-mode EditMode --filter-type exact --filter-value "io.github.hatayama.UnityCliLoop.Tests.Editor.UnityCliLoopSettingsWindowRefreshPolicyTests" -> 30/30 passed

Review in cubic

Move Tool Settings section data assembly out of UnityCliLoopSettingsWindow while leaving dirty catalog state, registry warmup scheduling, and tool toggle side effects in the window.
@coderabbitai

coderabbitai Bot commented Jul 6, 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: 8fa88c49-4698-4132-92dc-6b5238e8cdd8

📥 Commits

Reviewing files that changed from the base of the PR and between fe9de60 and 418cf3b.

⛔ Files ignored due to path filters (1)
  • Packages/src/Editor/Presentation/UnityCliLoopSettingsToolSettingsPresenter.cs.meta is excluded by none and included by none
📒 Files selected for processing (2)
  • Packages/src/Editor/Presentation/UnityCliLoopSettingsToolSettingsPresenter.cs
  • Packages/src/Editor/Presentation/UnityCliLoopSettingsWindow.cs

📝 Walkthrough

Walkthrough

A new presenter class, UnityCliLoopSettingsToolSettingsPresenter, was introduced to construct tool settings section data (header-only and catalog-based) by querying ToolSettingsUseCase. UnityCliLoopSettingsWindow was refactored to delegate header/catalog refresh logic to this presenter, removing previously inline helper methods.

Changes

Tool Settings Presenter Refactor

Layer / File(s) Summary
Presenter construction and data factories
Packages/src/Editor/Presentation/UnityCliLoopSettingsToolSettingsPresenter.cs
New internal presenter validates injected view and toolSettingsUseCase, exposes UpdateHeader/UpdateCatalog, and builds ToolSettingsSectionData via header-only and catalog-based factories that filter development-only tools, partition built-in/third-party tools, compute enabled state, and sort by tool name.
Window lifecycle wiring and refresh delegation
Packages/src/Editor/Presentation/UnityCliLoopSettingsWindow.cs
Adds _toolSettingsPresenter field, initializes it in InitializeView, nulls it in OnDestroy/OnDisable, and refactors RefreshToolSettingsHeader/RefreshToolSettingsCatalog to delegate to the presenter, removing the local CreateToolSettingsHeaderData/CreateToolSettingsData helpers.

Estimated code review effort: 2 (Simple) | ~12 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Window as UnityCliLoopSettingsWindow
  participant Presenter as UnityCliLoopSettingsToolSettingsPresenter
  participant UseCase as ToolSettingsUseCase
  participant View as UnityCliLoopSettingsWindowUI

  Window->>Presenter: UpdateCatalog(showToolSettings)
  Presenter->>UseCase: TryGetToolCatalog(...)
  UseCase-->>Presenter: tools or unavailable
  Presenter->>Presenter: filter, partition, sort tools
  Presenter->>View: update with ToolSettingsSectionData
  Presenter-->>Window: return ToolSettingsSectionData
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: extracting the Tool Settings presenter.
Description check ✅ Passed The description matches the code changes and explains the presenter extraction and preserved behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 codex/c4-12-extract-tool-settings-presenter

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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 3 files

Re-trigger cubic

@hatayama
hatayama merged commit cd1a9fc into v3-beta Jul 6, 2026
10 checks passed
@hatayama
hatayama deleted the codex/c4-12-extract-tool-settings-presenter branch July 6, 2026 17:41
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