mirror of
https://github.com/yattee/yattee.git
synced 2026-11-03 10:27:19 +00:00
Add per-page element customization and panel settings polish
Phase 5 of the player panels redesign: - Per-page element toggles now rendered and editable for every page: comments (author avatars), related (thumbnails), chapters (thumbnails), queue (previously played section), tracks (video/audio/subtitles/speed sections) - Page bar labels toggle (icons-only bar shows the selected page's name) - Layout mode schematic diagram in the details panel settings - NEW badge machinery for future page types (versionAdded on PanelPageType) - Typed per-page settings accessors on PanelPageConfiguration and VM update helpers for each page kind - Unit tests for per-page settings round-trip and accessor fallbacks The standalone quality selector sheet is unaffected: section gating defaults to everything visible and only the embedded tracks page passes preset settings through.
This commit is contained in:
@@ -15,6 +15,7 @@ struct CommentView: View {
|
||||
let videoID: String?
|
||||
let source: ContentSource?
|
||||
let isReply: Bool
|
||||
let showAvatar: Bool
|
||||
|
||||
@State private var replies: [Comment] = []
|
||||
@State private var isLoadingReplies = false
|
||||
@@ -26,18 +27,21 @@ struct CommentView: View {
|
||||
private var navigationCoordinator: NavigationCoordinator? { appEnvironment?.navigationCoordinator }
|
||||
private var accentColor: Color { appEnvironment?.settingsManager.resolvedAccentColor ?? .accentColor }
|
||||
|
||||
init(comment: Comment, videoID: String? = nil, source: ContentSource? = nil, isReply: Bool = false) {
|
||||
init(comment: Comment, videoID: String? = nil, source: ContentSource? = nil, isReply: Bool = false, showAvatar: Bool = true) {
|
||||
self.comment = comment
|
||||
self.videoID = videoID
|
||||
self.source = source
|
||||
self.isReply = isReply
|
||||
self.showAvatar = showAvatar
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
HStack(alignment: .top, spacing: 12) {
|
||||
// Author avatar
|
||||
authorAvatar
|
||||
if showAvatar {
|
||||
authorAvatar
|
||||
}
|
||||
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
// Author name and badges
|
||||
@@ -224,7 +228,7 @@ struct CommentView: View {
|
||||
if showReplies {
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
ForEach(replies) { reply in
|
||||
CommentView(comment: reply, source: source, isReply: true)
|
||||
CommentView(comment: reply, source: source, isReply: true, showAvatar: showAvatar)
|
||||
.padding(.leading, 44)
|
||||
|
||||
if reply.id != replies.last?.id {
|
||||
|
||||
Reference in New Issue
Block a user