From e0a07e93d25a20e4bc6c1f456ba9bb4c842d4ed3 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Mon, 28 Sep 2026 23:47:59 +0200 Subject: [PATCH] Hide the description section when a video has no description Direct media links have no description, so the info page showed a divider and a "No description available" placeholder under the channel row. Skip the section entirely (divider included) unless there is a description or details are still loading, and drop the unused player.noDescription string. --- Yattee/Localizable.xcstrings | 11 ---------- .../Views/Player/Panels/InfoPanelPage.swift | 20 ++++++++++--------- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/Yattee/Localizable.xcstrings b/Yattee/Localizable.xcstrings index 7113c92e..2dd87fcb 100644 --- a/Yattee/Localizable.xcstrings +++ b/Yattee/Localizable.xcstrings @@ -8284,17 +8284,6 @@ } } }, - "player.noDescription" : { - "comment" : "Shown when video has no description", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "No description available" - } - } - } - }, "player.notPlaying" : { "comment" : "Placeholder when no video is playing", "localizations" : { diff --git a/Yattee/Views/Player/Panels/InfoPanelPage.swift b/Yattee/Views/Player/Panels/InfoPanelPage.swift index 5f9f700e..7b09ae2e 100644 --- a/Yattee/Views/Player/Panels/InfoPanelPage.swift +++ b/Yattee/Views/Player/Panels/InfoPanelPage.swift @@ -92,7 +92,7 @@ struct InfoPanelPage: View { PanelPageScrollView(config: scrollConfig) { proxy in videoInfo - if settings.effectiveShowDescription { + if showsDescriptionSection { Divider() .panelHorizontalPadding() @@ -167,10 +167,17 @@ struct InfoPanelPage: View { // MARK: - Description - private var descriptionContent: some View { - let description = video.description ?? "" + private var description: String { video.description ?? "" } - return VStack(alignment: .leading, spacing: 8) { + /// Nothing renders below the video info when there is no description and + /// nothing is loading — no placeholder, no divider (direct media links). + private var showsDescriptionSection: Bool { + settings.effectiveShowDescription + && (!description.isEmpty || videoDetailsState == .loading) + } + + private var descriptionContent: some View { + VStack(alignment: .leading, spacing: 8) { if !description.isEmpty { if usesCollapsedDescription { collapsibleDescription(description) @@ -189,11 +196,6 @@ struct InfoPanelPage: View { Spacer() } .padding() - } else { - Text(String(localized: "player.noDescription")) - .font(.subheadline) - .foregroundStyle(.secondary) - .panelHorizontalPadding() } } }