From 90ab00d9319b803cf48fc2a7ce8a9f145d43dc13 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Tue, 26 Aug 2025 23:48:47 -0400 Subject: [WARP] Do not show the report in the UI if file is very large It will just end up freezing the UI for an unreasonable time, just open the generated report in a real web browser or text editor, QTextBrowser falls over and fixing it would be more effort than its worth. --- plugins/warp/src/plugin/create.rs | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'plugins/warp/src/plugin') diff --git a/plugins/warp/src/plugin/create.rs b/plugins/warp/src/plugin/create.rs index a74310a5..c9bd32ce 100644 --- a/plugins/warp/src/plugin/create.rs +++ b/plugins/warp/src/plugin/create.rs @@ -209,16 +209,25 @@ impl CreateFromCurrentView { let _ = std::fs::write(report_path, &report_string); } - match report_kind { - ReportKindField::None => {} - ReportKindField::Html => { - view.show_html_report("Generated WARP File", report_string.as_str(), ""); - } - ReportKindField::Markdown => { - view.show_markdown_report("Generated WARP File", report_string.as_str(), ""); - } - ReportKindField::Json => { - view.show_plaintext_report("Generated WARP File", report_string.as_str()); + // The ReportWidget uses a QTextBrowser, which cannot render large files very well. + if file_size > 10000000 { + log::warn!("WARP report file is too large to show in the UI. Please see the report file on disk."); + } else { + match report_kind { + ReportKindField::None => {} + ReportKindField::Html => { + view.show_html_report("Generated WARP File", report_string.as_str(), ""); + } + ReportKindField::Markdown => { + view.show_markdown_report( + "Generated WARP File", + report_string.as_str(), + "", + ); + } + ReportKindField::Json => { + view.show_plaintext_report("Generated WARP File", report_string.as_str()); + } } } } -- cgit v1.3.1