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.
This commit is contained in:
Arkadiusz Fal
2026-09-28 23:47:59 +02:00
parent 309d17941d
commit e0a07e93d2
2 changed files with 11 additions and 20 deletions

View File

@@ -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" : {

View File

@@ -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()
}
}
}