Move Pandoc validation to the start of file selection.

This commit is contained in:
Thorsten Sommer 2025-12-15 12:41:24 +01:00
parent 253f28b268
commit c4b4d597c9
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 13 additions and 5 deletions

View File

@ -30,6 +30,18 @@ public partial class ReadFileContent : MSGComponentBase
private async Task SelectFile()
{
// Ensure that Pandoc is installed and ready:
var pandocState = await this.PandocAvailabilityService.EnsureAvailabilityAsync(
showSuccessMessage: false,
showDialog: true);
// Check if Pandoc is available after the check / installation:
if (!pandocState.IsAvailable)
{
this.Logger.LogWarning("The user cancelled the Pandoc installation or Pandoc is not available. Aborting file selection.");
return;
}
var selectedFile = await this.RustService.SelectFile(T("Select file to read its content"));
if (selectedFile.UserCancelled)
{
@ -64,11 +76,6 @@ public partial class ReadFileContent : MSGComponentBase
await MessageBus.INSTANCE.SendWarning(new(Icons.Material.Filled.FeaturedVideo, this.T("Videos are not supported yet")));
return;
}
// Ensure that Pandoc is installed and ready:
await this.PandocAvailabilityService.EnsureAvailabilityAsync(
showSuccessMessage: false,
showDialog: true);
try
{

View File

@ -8,6 +8,7 @@
- Improved the ID handling for configuration plugins.
- Improved error handling, logging, and code quality.
- Improved error handling for Microsoft Word export.
- Improved file reading, e.g. for the translation, summarization, and legal assistants, by performing the Pandoc validation in the first step. This prevents unnecessary selection of files that cannot be processed.
- Fixed a bug in the local data sources info dialog (preview feature) for data directories that could cause the app to crash. The error was caused by a background thread producing data while the frontend attempted to display it.
- Fixed a visual bug where a function's preview status was misaligned. You might have seen it in document analysis or the ERI server assistant.
- Fixed a rare bug in the Microsoft Word export for huge documents.