Skip to content

refactor(#275): expose payload-less RevealPhase from HeaderPresenter#284

Merged
GeneralD merged 1 commit into
mainfrom
refactor/275/presenter-state-separation
Jun 14, 2026
Merged

refactor(#275): expose payload-less RevealPhase from HeaderPresenter#284
GeneralD merged 1 commit into
mainfrom
refactor/275/presenter-state-separation

Conversation

@GeneralD

Copy link
Copy Markdown
Owner

type breaking scope diff files tests review

Closes #275

背景

HeaderPresenter.titleState / artistStateFetchState<String> で、decode の target 文字列 を public な @Published payload として保持していた。これは displayTitle / displayArtist と完全に重複しており、View は可視性ゲート(!= .idle)にしか使わず、target 自体は内部 dedup 専用だった。#273artworkData を private 化したのと同じ構造の問題。

変更

  • payload なしの RevealPhase.idle / .revealing / .revealed)を Entity に追加
  • titleState / artistStatetitlePhase / artistPhase: RevealPhase に置き換え
  • dedup target を private titleTarget / artistTarget に分離
  • HeaderView の可視性ゲートを titlePhase != .idle に更新
  • tests は target payload assert(titleState == .success("Song"))を displayTitle + lifecycle 観測に置き換え

表示挙動・decode animation・artwork 表示は変更なし。

棚卸し(類似 Presenter state)

完了条件「類似する Presenter state を棚卸しし、残すものには理由がある」に対応。

Presenter state 判定
Lyrics lyricsState payload 残す — columns(in:) / updateActiveLineTick() が実データとして消費(doc 追記)
Wallpaper isLoading 残す — debounce 元かつ lifecycle 観測対象(View 向けの showLoadingIndicator とは別物)
Ripple isAnimating 残す — RippleViewTimelineView(paused:) が消費
App layout 残す — window geometry、View 必須

唯一 payload を漏らしていたのは Header の titleState / artistState のみ。

テスト

swift test 全 937 件 green。

バージョン

2.13.182.13.19(patch / refactor)

`titleState` / `artistState: FetchState<String>` carried the decode
target string as public `@Published` payload, duplicating `displayTitle`
/ `displayArtist`. The View only gated visibility on `!= .idle` and the
target was used solely for internal dedup.

Replace them with payload-less `titlePhase` / `artistPhase: RevealPhase`
(`.idle` / `.revealing` / `.revealed`) and move the dedup target to
private `titleTarget` / `artistTarget`. Behaviour, decode animation, and
artwork handling are unchanged.

Tests now observe `displayTitle` / `displayArtist` + the lifecycle phase
instead of the target payload. Documented why `LyricsPresenter.lyricsState`
legitimately keeps its payload (consumed by columns / active-line tick).
Copilot AI review requested due to automatic review settings June 14, 2026 13:28
@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.

@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 22 minutes and 58 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: d3dab3ec-9666-418c-a925-cf76ec89bd0c

📥 Commits

Reviewing files that changed from the base of the PR and between 3aae13e and 7fc38de.

📒 Files selected for processing (9)
  • .claude/CLAUDE.md
  • Sources/Entity/RevealPhase.swift
  • Sources/Presenters/Track/HeaderPresenter.swift
  • Sources/Presenters/Track/LyricsPresenter.swift
  • Sources/VersionHandler/Resources/version.txt
  • Sources/Views/Header/HeaderView.swift
  • Tests/PresentersTests/HeaderPresenterDuplicateTests.swift
  • Tests/PresentersTests/HeaderPresenterTests.swift
  • Tests/ViewsTests/ViewRenderingTests.swift
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/275/presenter-state-separation

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.

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.

@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 c455ac4 into main Jun 14, 2026
4 checks passed
@GeneralD GeneralD deleted the refactor/275/presenter-state-separation branch June 14, 2026 13:31
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.

refactor: Presenter の公開 state と内部 target/cache を分離する

2 participants