forge
Explore
Log in

Don't you dare go Hollow

Subtitle row's second line reads the timeline, not a constant

Browse files at this commit

a7683f58216ddf632b585b25f50d61f25259859fAhmet Kaan GümüşParent: 8a81f1f
  • fix
    • subtitle row's second line reads the timeline, not a constant
Show full message
🐛 fix(app): subtitle row's second line reads the timeline, not a constant

A dropped track's row kept saying "not placed" forever -- the detail was a
literal fallback, never a placement check. It now names the subtitle lane(s)
holding the track's captions (S1), falling back to "not placed" only when
none does.
crates/app/src/ui/dock_stance.rsmodified+19 -0
@@ -630,6 +630,24 @@ fn subtitle_tab_rows(player: &Player, cx: &mut Context<Player>) -> (usize, Vec<A
630 Some(session) => subtitle_rows(session.subtitles()),630 Some(session) => subtitle_rows(session.subtitles()),
631 None => Vec::new(),631 None => Vec::new(),
632 };632 };
633+ // Which lane(s) actually hold each track's captions right now -- the
634+ // row's second line answers "is it showing?", so it has to read the
635+ // timeline, not stay the literal "not placed" it was born saying (the
636+ // old palette's badge never updated after a drop).
637+ let placed_on = |track: usize| -> Option<String> {
638+ let session = player.session.as_ref()?;
639+ let lanes: Vec<String> = session
640+ .lanes()
641+ .into_iter()
642+ .filter(|lane| session.sub_lane(*lane).iter().any(|sub| sub.track == track))
643+ .map(|lane| lane.label())
644+ .collect();
645+ if lanes.is_empty() {
646+ None
647+ } else {
648+ Some(lanes.join(" "))
649+ }
650+ };
633 let count: usize = groups.iter().map(|group| group.rows.len()).sum();651 let count: usize = groups.iter().map(|group| group.rows.len()).sum();
634 let rows: Vec<_> = groups652 let rows: Vec<_> = groups
635 .into_iter()653 .into_iter()
@@ -653,6 +671,7 @@ fn subtitle_tab_rows(player: &Player, cx: &mut Context<Player>) -> (usize, Vec<A
653 .into();671 .into();
654 let detail: SharedString = row672 let detail: SharedString = row
655 .refused673 .refused
674+ .or_else(|| placed_on(track))
656 .unwrap_or_else(|| "not placed".to_string())675 .unwrap_or_else(|| "not placed".to_string())
657 .into();676 .into();
658 let ghost = title.clone();677 let ghost = title.clone();