From f04c77410146dcb1c24f211e04d5754bc451b918 Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Tue, 3 Nov 2026 14:45:12 +0100 Subject: [PATCH] Focus review hover on diagnostics and open source cells on double click --- crates/rundown-converter/src/gui/review.rs | 118 +++++++++++++-------- docs/rundown-converter.md | 5 +- 2 files changed, 75 insertions(+), 48 deletions(-) diff --git a/crates/rundown-converter/src/gui/review.rs b/crates/rundown-converter/src/gui/review.rs index fc58981..638b60a 100644 --- a/crates/rundown-converter/src/gui/review.rs +++ b/crates/rundown-converter/src/gui/review.rs @@ -645,7 +645,7 @@ impl App { ui.strong(label); } } - ui.strong("Title, source contents & issues"); + ui.strong("Title & issues"); ui.strong("Row type / duration"); ui.end_row(); for row in &rows { @@ -667,7 +667,7 @@ impl App { egui::Label::new(RichText::new(row.row.to_string()).color(color)) .sense(egui::Sense::click()), ); - if response.clicked() { + if response.double_clicked() { details = Some(row.row); } if jump == Some(row.row) { @@ -697,17 +697,6 @@ impl App { } ui.vertical(|ui| { ui.set_width(title_width); - if ui - .add( - egui::Label::new(RichText::new(&row.title).color(color)) - .wrap() - .sense(egui::Sense::click()), - ) - .on_hover_text("Open all original cells") - .clicked() - { - details = Some(row.row); - } let status = if ignored { "Ignored" } else if row.source_only { @@ -717,34 +706,35 @@ impl App { } else { "Timed" }; - ui.small(RichText::new(status).color(color)) - .on_hover_text(&row.decisions); - if let Some(table) = table { - let contents = table - .rows - .get(row.row.saturating_sub(1)) - .map(|cells| { - cells - .iter() - .enumerate() - .filter(|(_, c)| { - !c.text.trim().is_empty() && c.text != row.title - }) - .map(|(col, c)| { - format!("{}: {}", column_name(col), c.text) - }) - .collect::>() - .join(" · ") - }) - .unwrap_or_default(); - if !contents.is_empty() { - ui.label( - RichText::new(short(&contents, 220)) - .size(12.0) - .color(color), - ) - .on_hover_text(contents); - } + let mut explanation = status.to_owned(); + if !row.decisions.is_empty() { + explanation.push_str("\n\n"); + explanation.push_str(&row.decisions); + } + for index in &row.issues { + let diagnostic = &a.diagnostics[*index]; + explanation.push_str("\n\n"); + explanation.push_str( + diagnostic + .message + .split("\nRow preview:") + .next() + .unwrap_or_default(), + ); + } + explanation.push_str( + "\n\nDouble-click the title or row number to view original cells.", + ); + if ui + .add( + egui::Label::new(RichText::new(&row.title).color(color)) + .wrap() + .sense(egui::Sense::click()), + ) + .on_hover_text(&explanation) + .double_clicked() + { + details = Some(row.row); } if !row.issues.is_empty() { let index = row @@ -752,11 +742,6 @@ impl App { .iter() .find(|i| !needs_information(&a.diagnostics[**i])) .unwrap_or(&row.issues[0]); - let d = &a.diagnostics[*index]; - let message = - d.message.split("\nRow preview:").next().unwrap_or_default(); - ui.label(RichText::new(short(message, 140)).small().color(color)) - .on_hover_text(message); if ui .small_button( RichText::new(if error { @@ -766,6 +751,7 @@ impl App { }) .color(color), ) + .on_hover_text(&explanation) .clicked() { resolve = Some(*index); @@ -956,6 +942,46 @@ mod tests { render(app, ctx, size, events) } + #[test] + fn source_cells_require_double_click_and_hover_explains_issues() { + let mut app = sample(); + app.row_filter = RowFilter::Attention; + let ctx = egui::Context::default(); + configure_style(&ctx); + ctx.style_mut(|style| { + style.interaction.tooltip_delay = 0.0; + style.interaction.tooltip_grace_time = 0.0; + }); + let size = [860.0, 620.0]; + render(&mut app, &ctx, size, vec![]); + let labels = render(&mut app, &ctx, size, vec![]); + assert!( + !labels + .iter() + .any(|(s, _)| s.contains("This row has content but no timing")) + ); + let title = labels + .iter() + .find(|(s, _)| s == "Stage direction 0") + .unwrap() + .1 + .center(); + render(&mut app, &ctx, size, vec![egui::Event::PointerMoved(title)]); + let labels = render(&mut app, &ctx, size, vec![]); + assert!( + labels + .iter() + .any(|(s, _)| s.contains("Source row · not a timer") + && s.contains("This row has content but no timing")) + ); + assert!(!labels.iter().any(|(s, _)| s.contains("Row preview:"))); + click_size(&mut app, &ctx, title, size); + assert!(!app.row_details); + click_size(&mut app, &ctx, title, size); + assert!(app.row_details); + assert_eq!(app.selected_row, Some(3)); + } + #[test] fn compact_review_keeps_corrections_visible_and_clickable() { let mut app = sample(); diff --git a/docs/rundown-converter.md b/docs/rundown-converter.md index 743aafa..a78645b 100644 --- a/docs/rundown-converter.md +++ b/docs/rundown-converter.md @@ -36,7 +36,7 @@ In the desktop app, choose or drop one file, read its sheets, select a sheet and click **Analyze rundown**. Review has two views: - **Schedule & corrections** combines the schedule preview and row editing in one - table. Start/end/duration, source contents, colored issues, row type and + table. Start/end/duration, titles, colored issues, row type and duration corrections are visible together. **All rows** includes ignored rows; **Included rows** hides ignored rows and rows containing only ignored columns, while keeping notes, markers and breaks; **Needs attention** shows rows with @@ -44,7 +44,8 @@ click **Analyze rundown**. Review has two views: Notes attached to another event keep their own source row and identify their parent timer instead of duplicating it. Amber means unresolved, red means an error, and gray means ignored. Unknown values show `?`. - Click a row number/title to read all original cells. **Issues** opens the issue + Hover over a title or issue button for row status and full diagnostic explanations. + Double-click a row number/title to read all original cells. **Issues** opens the issue navigator, including sheet-level and gap errors; row issue buttons open the relevant explanation. The table fills the remaining space. On narrow windows, timing values stack so corrections remain accessible. Changes require recheck;