Show clear persistent confirmation after successful exports

This commit is contained in:
Dandaedre 2026-11-05 11:20:55 +01:00
parent 520144710f
commit ba86598e0e
2 changed files with 52 additions and 20 deletions

View File

@ -513,7 +513,7 @@ impl App {
self.rx = None;
self.completed = Some(p);
self.tab = Tab::Results;
self.status = "File ready".into();
self.status = "Export successful — file saved".into();
}
Update::ExportFailed(e) => {
self.rx = None;
@ -1224,23 +1224,27 @@ impl App {
});
}
if let Some(p) = &self.completed {
ui.heading("Export ready");
ui.add(egui::Label::new(p.display().to_string()).wrap());
ui.horizontal_wrapped(|ui| {
if ui.button("Open").clicked()
&& let Err(e) = open::that(p)
{
self.error = Some(e.to_string());
}
if ui.button("Open output folder").clicked()
&& let Err(e) =
open::that(p.parent().unwrap_or(std::path::Path::new(".")))
{
self.error = Some(e.to_string());
}
if ui.button("Copy path").clicked() {
ui.ctx().copy_text(p.display().to_string());
}
let color = Color32::from_rgb(100, 210, 145);
review::issue_frame(color).show(ui, |ui| {
ui.heading(RichText::new("Export successful").color(color));
ui.label("Your file has been saved.");
ui.add(egui::Label::new(p.display().to_string()).wrap());
ui.horizontal_wrapped(|ui| {
if ui.button("Open").clicked()
&& let Err(e) = open::that(p)
{
self.error = Some(e.to_string());
}
if ui.button("Open output folder").clicked()
&& let Err(e) =
open::that(p.parent().unwrap_or(std::path::Path::new(".")))
{
self.error = Some(e.to_string());
}
if ui.button("Copy path").clicked() {
ui.ctx().copy_text(p.display().to_string());
}
});
});
ui.add(egui::Label::new(if self.export_choice == ExportChoice::NeutralJson {
"This neutral JSON contains the intermediate representation for inspection or use with other tools. Use Ontime project JSON to import into Ontime."
@ -1312,6 +1316,15 @@ impl App {
});
});
egui::TopBottomPanel::bottom("action").show(ctx, |ui| {
if let Some(path) = &self.completed {
ui.horizontal_wrapped(|ui| {
ui.label(RichText::new("Export successful").color(Color32::from_rgb(100, 210, 145)).strong());
ui.label(path.file_name().unwrap_or_default().to_string_lossy());
if self.tab != Tab::Results && ui.link("View exported file").clicked() {
self.tab = Tab::Results;
}
});
}
if let Some(e) = &self.error && !self.export_error {
let color = Color32::from_rgb(245, 125, 120);
review::issue_frame(color).show(ui, |ui| {
@ -1401,7 +1414,8 @@ impl App {
});
}
});
if busy {
// An export can start during this frame, after `busy` was captured.
if self.rx.is_some() {
ctx.request_repaint_after(Duration::from_millis(50));
}
}
@ -1558,7 +1572,19 @@ mod tests {
app.export();
wait(&mut app);
assert!(app.completed.as_ref().unwrap().exists());
frame(&mut app, 560.0, 400.0);
assert!(app.tab == Tab::Results);
let labels = frame(&mut app, 560.0, 400.0);
assert!(labels.iter().any(|label| label == "Export successful"));
assert!(
labels
.iter()
.any(|label| label == "Your file has been saved.")
);
assert!(labels.iter().any(|label| label == "show.json"));
app.tab = Tab::Review;
let labels = frame(&mut app, 560.0, 400.0);
assert!(labels.iter().any(|label| label == "Export successful"));
assert!(labels.iter().any(|label| label == "View exported file"));
app.export();
wait(&mut app);
assert!(app.error.as_ref().unwrap().contains("exists"));
@ -1575,6 +1601,7 @@ mod tests {
assert!(labels.iter().any(|label| label == text));
}
assert!(!labels.iter().any(|label| label.contains("--overwrite")));
assert!(!labels.iter().any(|label| label == "Export successful"));
app.overwrite = true;
app.export();
wait(&mut app);

View File

@ -317,6 +317,11 @@ use Ontime's Partial Load when you want to keep an existing project's settings.
## Output choice
After saving, the GUI opens Results with a green **Export successful** panel,
the saved path, and Open / Open output folder / Copy path actions. A confirmation
with the filename remains in the bottom bar when switching tabs. Starting another
operation clears the previous confirmation; failed exports show an error instead.
Native Ontime JSON is the primary target: it lets the exporter control time
relationships and project structure without a second column-mapping step.
XLSX export writes one `Ontime` worksheet with `Time Start`, `Time End`, `Duration`, `Cue`,