Focus message composer when it becomes available (#822)
Some checks are pending
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg,app,updater, dmg) (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, nsis) (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,updater, appimage) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Determine run mode (push) Waiting to run
Build and Release / Read metadata (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg,app,updater, dmg) (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, nsis) (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,updater, appimage) (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions

This commit is contained in:
Dominic Neuburg 2026-06-23 09:02:40 +02:00 committed by GitHub
parent 2acb6f2a57
commit fc53278c60
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 1 deletions

View File

@ -69,6 +69,9 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
private bool mustLoadChat; private bool mustLoadChat;
private LoadChat loadChat; private LoadChat loadChat;
private bool autoSaveEnabled; private bool autoSaveEnabled;
private bool previousInputForbidden = true;
private Guid lastSeenChatId = Guid.Empty;
private AIStudio.Settings.Provider lastSeenProvider = AIStudio.Settings.Provider.NONE;
private string currentWorkspaceName = string.Empty; private string currentWorkspaceName = string.Empty;
private Guid currentWorkspaceId = Guid.Empty; private Guid currentWorkspaceId = Guid.Empty;
private Guid currentChatThreadId = Guid.Empty; private Guid currentChatThreadId = Guid.Empty;
@ -288,11 +291,24 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
} }
} }
var inputForbidden = this.IsInputForbidden();
if (!inputForbidden && this.previousInputForbidden)
await this.inputField.FocusAsync();
this.previousInputForbidden = inputForbidden;
await base.OnAfterRenderAsync(firstRender); await base.OnAfterRenderAsync(firstRender);
} }
protected override async Task OnParametersSetAsync() protected override async Task OnParametersSetAsync()
{ {
var incomingChatId = this.ChatThread?.ChatId ?? Guid.Empty;
if (incomingChatId != this.lastSeenChatId || this.Provider != this.lastSeenProvider)
{
this.lastSeenChatId = incomingChatId;
this.lastSeenProvider = this.Provider;
this.previousInputForbidden = true;
}
await this.ApplyLoadedChatParameterAsync(); await this.ApplyLoadedChatParameterAsync();
await this.SyncForegroundChatAsync(); await this.SyncForegroundChatAsync();
await base.OnParametersSetAsync(); await base.OnParametersSetAsync();
@ -1124,7 +1140,10 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
{ {
this.ChatThread = this.AIJobService.TryGetLiveChatThread(snapshot.SubjectId) ?? this.ChatThread; this.ChatThread = this.AIJobService.TryGetLiveChatThread(snapshot.SubjectId) ?? this.ChatThread;
if (!snapshot.IsActive) if (!snapshot.IsActive)
{
this.hasUnsavedChanges = false; this.hasUnsavedChanges = false;
this.previousInputForbidden = true;
}
this.StateHasChanged(); this.StateHasChanged();
} }

View File

@ -1 +1,2 @@
# v26.6.3, build 243 (2026-06-xx xx:xx UTC) # v26.6.3, build 243 (2026-06-xx xx:xx UTC)
- Improved the chat experience by automatically focusing the message composer again when it becomes available. Thanks, Dominic Neuburg (`donework`), for the contribution.