Improved file reading in assistants (#591)
Some checks are pending
Build and Release / Read metadata (push) Waiting to run
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage deb updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage deb updater) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions

This commit is contained in:
Thorsten Sommer 2025-12-15 12:45:54 +01:00 committed by GitHub
parent 253f28b268
commit 9966b7b765
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 7 deletions

View File

@ -83,7 +83,7 @@ public partial class AttachDocuments : MSGComponentBase
// If Pandoc is not available (user cancelled installation), abort file drop: // If Pandoc is not available (user cancelled installation), abort file drop:
if (!pandocState.IsAvailable) if (!pandocState.IsAvailable)
{ {
this.Logger.LogInformation("The user cancelled the Pandoc installation or Pandoc is not available. Aborting file drop."); this.Logger.LogWarning("The user cancelled the Pandoc installation or Pandoc is not available. Aborting file drop.");
this.ClearDragClass(); this.ClearDragClass();
this.StateHasChanged(); this.StateHasChanged();
return; return;
@ -122,7 +122,7 @@ public partial class AttachDocuments : MSGComponentBase
// If Pandoc is not available (user cancelled installation), abort file selection: // If Pandoc is not available (user cancelled installation), abort file selection:
if (!pandocState.IsAvailable) if (!pandocState.IsAvailable)
{ {
this.Logger.LogInformation("The user cancelled the Pandoc installation or Pandoc is not available. Aborting file selection."); this.Logger.LogWarning("The user cancelled the Pandoc installation or Pandoc is not available. Aborting file selection.");
return; return;
} }

View File

@ -30,6 +30,18 @@ public partial class ReadFileContent : MSGComponentBase
private async Task SelectFile() 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")); var selectedFile = await this.RustService.SelectFile(T("Select file to read its content"));
if (selectedFile.UserCancelled) if (selectedFile.UserCancelled)
{ {
@ -65,11 +77,6 @@ public partial class ReadFileContent : MSGComponentBase
return; return;
} }
// Ensure that Pandoc is installed and ready:
await this.PandocAvailabilityService.EnsureAvailabilityAsync(
showSuccessMessage: false,
showDialog: true);
try try
{ {
var fileContent = await UserFile.LoadFileData(selectedFile.SelectedFilePath, this.RustService, this.DialogService); var fileContent = await UserFile.LoadFileData(selectedFile.SelectedFilePath, this.RustService, this.DialogService);

View File

@ -8,6 +8,7 @@
- Improved the ID handling for configuration plugins. - Improved the ID handling for configuration plugins.
- Improved error handling, logging, and code quality. - Improved error handling, logging, and code quality.
- Improved error handling for Microsoft Word export. - 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 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 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. - Fixed a rare bug in the Microsoft Word export for huge documents.