Move comments pill mode into the comments page settings

The pill mode now lives on CommentsPageSettings and is edited in the
comments page editor instead of a standalone settings section. The
legacy value on PlayerPillSettings is kept for decoding old presets
and migrated by effectivePanelSettings. Comments are loaded when
either the comments page is enabled or the pill is not disabled.
This commit is contained in:
Arkadiusz Fal
2026-09-23 22:45:38 +02:00
parent 924facacc4
commit e7458ba629
10 changed files with 84 additions and 115 deletions

View File

@@ -100,8 +100,18 @@ struct PlayerControlsLayout: Codable, Hashable, Sendable {
// MARK: - Panel Settings
/// Returns the effective details panel settings, using defaults if not set.
/// Migrates the legacy comments pill mode (once stored on the player pill
/// settings) into the comments page settings; the migrated value persists
/// the first time the panel settings are edited and saved.
var effectivePanelSettings: PanelSettings {
panelSettings ?? .default
var settings = panelSettings ?? .default
if let legacyMode = playerPillSettings?.commentsPillMode,
settings.configuration(for: .comments)?.commentsSettings.pillMode == nil {
var comments = settings.configuration(for: .comments)?.commentsSettings ?? CommentsPageSettings()
comments.pillMode = legacyMode
settings.updateSettings(.comments(comments), for: .comments)
}
return settings
}
// MARK: - Defaults