Improved grammar & spelling check and rewrite assistants (#154)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2024-09-15 22:46:48 +02:00
1 parent 95da4c6410
commit 8715054dda
6 files changed
+7 -6

No files matched your search

@@ -32,6 +32,9 @@
<div id="@RESULT_DIV_ID" class="mr-2 mt-3"> <div id="@RESULT_DIV_ID" class="mr-2 mt-3">
</div> </div>
<div id="@BEFORE_RESULT_DIV_ID" class="mt-3">
</div>
@if (this.ShowResult && this.resultingContentBlock is not null) @if (this.ShowResult && this.resultingContentBlock is not null)
{ {
<ContentBlockComponent Role="@(this.resultingContentBlock.Role)" Type="@(this.resultingContentBlock.ContentType)" Time="@(this.resultingContentBlock.Time)" Content="@(this.resultingContentBlock.Content)"/> <ContentBlockComponent Role="@(this.resultingContentBlock.Role)" Type="@(this.resultingContentBlock.ContentType)" Time="@(this.resultingContentBlock.Time)" Content="@(this.resultingContentBlock.Content)"/>
@@ -37,8 +37,9 @@ public abstract partial class AssistantBase : ComponentBase, IMessageBusReceiver
[Inject] [Inject]
private MessageBus MessageBus { get; init; } = null!; private MessageBus MessageBus { get; init; } = null!;
internal const string AFTER_RESULT_DIV_ID = "afterAssistantResult";
internal const string RESULT_DIV_ID = "assistantResult"; internal const string RESULT_DIV_ID = "assistantResult";
internal const string BEFORE_RESULT_DIV_ID = "beforeAssistantResult";
internal const string AFTER_RESULT_DIV_ID = "afterAssistantResult";
protected abstract string Title { get; } protected abstract string Title { get; }
@@ -24,8 +24,6 @@ public partial class AssistantGrammarSpelling : AssistantBaseCore
"""; """;
protected override bool AllowProfiles => false; protected override bool AllowProfiles => false;
protected override bool ShowResult => false;
protected override bool ShowDedicatedProgress => true; protected override bool ShowDedicatedProgress => true;
@@ -26,8 +26,6 @@ public partial class AssistantRewriteImprove : AssistantBaseCore
protected override bool AllowProfiles => false; protected override bool AllowProfiles => false;
protected override bool ShowResult => false;
protected override bool ShowDedicatedProgress => true; protected override bool ShowDedicatedProgress => true;
protected override Func<string> Result2Copy => () => this.rewrittenText; protected override Func<string> Result2Copy => () => this.rewrittenText;
@@ -6,7 +6,7 @@ public static class JsRuntimeExtensions
{ {
public static async Task GenerateAndShowDiff(this IJSRuntime jsRuntime, string text1, string text2) public static async Task GenerateAndShowDiff(this IJSRuntime jsRuntime, string text1, string text2)
{ {
await jsRuntime.InvokeVoidAsync("generateDiff", text1, text2, AssistantBase.RESULT_DIV_ID, AssistantBase.AFTER_RESULT_DIV_ID); await jsRuntime.InvokeVoidAsync("generateDiff", text1, text2, AssistantBase.RESULT_DIV_ID, AssistantBase.BEFORE_RESULT_DIV_ID);
} }
public static async Task ClearDiv(this IJSRuntime jsRuntime, string divId) public static async Task ClearDiv(this IJSRuntime jsRuntime, string divId)
@@ -1,6 +1,7 @@
# v0.9.12, build 187 (2024-09-xx xx:xx UTC) # v0.9.12, build 187 (2024-09-xx xx:xx UTC)
- Added a job posting assistant to the business category. - Added a job posting assistant to the business category.
- Improved text diff viewer by line-through deleted text. - Improved text diff viewer by line-through deleted text.
- Improved grammar & spelling check and rewrite assistants by showing the final text as well.
- Fixed the dark theme for the text diff viewer, e.g., in the grammar check assistant. - Fixed the dark theme for the text diff viewer, e.g., in the grammar check assistant.
- Fixed margin-related issue in the `ConfigurationText` component. - Fixed margin-related issue in the `ConfigurationText` component.
- Fixed chat conversion of job posting, legal check, and my task assistants. - Fixed chat conversion of job posting, legal check, and my task assistants.