refactor(#275): expose payload-less RevealPhase from HeaderPresenter#284
Conversation
`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).
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
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 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Closes #275
背景
HeaderPresenter.titleState/artistStateはFetchState<String>で、decode の target 文字列 を public な@Publishedpayload として保持していた。これはdisplayTitle/displayArtistと完全に重複しており、View は可視性ゲート(!= .idle)にしか使わず、target 自体は内部 dedup 専用だった。#273 でartworkDataを private 化したのと同じ構造の問題。変更
RevealPhase(.idle/.revealing/.revealed)を Entity に追加titleState/artistState→titlePhase/artistPhase: RevealPhaseに置き換えtitleTarget/artistTargetに分離HeaderViewの可視性ゲートをtitlePhase != .idleに更新titleState == .success("Song"))をdisplayTitle+ lifecycle 観測に置き換え表示挙動・decode animation・artwork 表示は変更なし。
棚卸し(類似 Presenter state)
完了条件「類似する Presenter state を棚卸しし、残すものには理由がある」に対応。
lyricsStatepayloadcolumns(in:)/updateActiveLineTick()が実データとして消費(doc 追記)isLoadingshowLoadingIndicatorとは別物)isAnimatingRippleViewのTimelineView(paused:)が消費layout唯一 payload を漏らしていたのは Header の
titleState/artistStateのみ。テスト
swift test全 937 件 green。バージョン
2.13.18→2.13.19(patch / refactor)