Show detected row types alongside Auto

This commit is contained in:
Dandaedre 2026-11-03 14:44:09 +01:00
parent ef604c6004
commit 9e5c870a5f
2 changed files with 34 additions and 5 deletions

View File

@ -369,11 +369,17 @@ impl App {
ui.add_space(4.0);
}
fn row_kind_control(ui: &mut egui::Ui, profile: &mut Profile, number: usize) {
fn row_kind_control(
ui: &mut egui::Ui,
profile: &mut Profile,
number: usize,
detected: Option<&str>,
) {
let mut kind = profile.row_kinds.get(&number).cloned().unwrap_or_default();
let auto = format!("Auto ({})", detected.unwrap_or("?"));
egui::ComboBox::from_id_salt(("kind", number))
.width(90.0)
.selected_text(if kind.is_empty() { "Auto" } else { &kind })
.selected_text(if kind.is_empty() { &auto } else { &kind })
.show_ui(ui, |ui| {
ui.selectable_value(&mut kind, String::new(), "Auto");
for (value, label) in [
@ -385,7 +391,8 @@ impl App {
] {
ui.selectable_value(&mut kind, value.into(), label);
}
});
})
.response.on_hover_text("Auto shows the row type from the current analysis. ? means unresolved or awaiting recheck.");
if kind.is_empty() {
profile.row_kinds.remove(&number);
} else {
@ -768,7 +775,20 @@ impl App {
ui.vertical(|ui| {
ui.set_width(105.0);
ui.push_id(("schedule_kind", row.row), |ui| {
Self::row_kind_control(ui, &mut profile, row.row)
let detected = if self.dirty {
None
} else if ignored {
Some("Ignore")
} else {
match row.kind.as_str() {
"event" => Some("Event"),
"marker" => Some("Marker"),
kind if kind.starts_with("Gap") => Some("Gap"),
kind if kind.starts_with("Note") => Some("Note"),
_ => None,
}
};
Self::row_kind_control(ui, &mut profile, row.row, detected)
});
let mut duration =
profile.durations.get(&row.row).cloned().unwrap_or_default();
@ -947,7 +967,12 @@ mod tests {
assert!(labels.iter().any(|(s, _)| s == "Stage direction 0"));
assert!(labels.iter().any(|(s, _)| s == "Start ?"));
assert!(labels.iter().any(|(s, _)| s == "Apply & recheck"));
let auto = labels.iter().find(|(s, _)| s == "Auto").unwrap().1.center();
let auto = labels
.iter()
.find(|(s, _)| s == "Auto (?)")
.unwrap()
.1
.center();
click(&mut app, &ctx, auto);
let menu = render(&mut app, &ctx, [560.0, 400.0], vec![]);
let note = menu
@ -1104,6 +1129,7 @@ mod tests {
configure_style(&ctx);
render(&mut app, &ctx, [860.0, 900.0], vec![]);
let labels = render(&mut app, &ctx, [860.0, 900.0], vec![]);
assert!(labels.iter().any(|(s, _)| s == "Auto (Event)"));
let resolve = labels
.iter()
.find(|(s, _)| s == "Unresolved · details")

View File

@ -58,6 +58,9 @@ click **Analyze rundown**. Review has two views:
opens Setup with mapping settings expanded for header row, duration units and
advanced JSON settings.
The row type selector shows the detected type in parentheses, such as **Auto (Event)**.
**Auto (?)** means unresolved or awaiting recheck.
Click **Apply & recheck** after corrections. Pending edits retain the issue list
and previous preview so you can resolve several rows without losing your place;
export and remembering a resolution remain blocked until validation succeeds.