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

@@ -91,7 +91,6 @@ private struct PlayerControlsSettingsContent: View {
)
LayoutSectionsSection(viewModel: viewModel)
#if os(iOS)
CommentsPillSection(viewModel: viewModel)
GesturesSectionsSection(viewModel: viewModel)
#endif
SystemControlsSection(viewModel: viewModel)
@@ -426,39 +425,6 @@ private struct LayoutSectionsSection: View {
}
}
// MARK: - Comments Pill Section
private struct CommentsPillSection: View {
@Bindable var viewModel: PlayerControlsSettingsViewModel
// Local state for immediate UI updates
@State private var commentsPillMode: CommentsPillMode = .pill
var body: some View {
Section {
Picker(
String(localized: "commentsPill.mode.title"),
selection: $commentsPillMode
) {
ForEach(CommentsPillMode.allCases, id: \.self) { mode in
Text(mode.displayName).tag(mode)
}
}
.disabled(!viewModel.canEditActivePreset)
.onChange(of: commentsPillMode) { _, newValue in
guard newValue != viewModel.commentsPillMode else { return }
viewModel.syncCommentsPillMode(newValue)
}
}
.onAppear {
commentsPillMode = viewModel.commentsPillMode
}
.onChange(of: viewModel.activePreset?.id) { _, _ in
commentsPillMode = viewModel.commentsPillMode
}
}
}
// MARK: - Gestures Sections Section (iOS only)
#if os(iOS)