Repository navigation
MS-26473 PDChat: Voice in the input area, dictation with auto-send, agent picker - #229
Merged
Merged
Conversation
…gent picker - Voice control moves from the header to the input row beside Send. - Recognised words are dictated into the text box; a pause sends after IChatService.VoiceAutoSendDelay (default 1000 ms) unless the box has focus. - New IChatInput abstraction, implemented by PDMessages (Text, IsFocused, AppendAsync, SendAsync), plus PDMessages parameters InputAccessories, InputFocusChanged and IsInputAutoFocused. - Optional agent picker: IChatService.Agents and SelectedAgentId, shown with two or more PDChatAgentOption entries. - The microphone is still requested only when Voice is first turned on. All public API changes are additive; new IChatService members are default interface members. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 81 |
| Duplication | -4 |
🟢 Coverage 98.85% diff coverage · +0.02% coverage variation
Metric Results Coverage variation ✅ +0.02% coverage variation Diff coverage ✅ 98.85% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (de5791a) 15743 15727 99.90% Head commit (2c58d34) 15829 (+86) 15816 (+89) 99.92% (+0.02%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#229) 87 86 98.85% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
PDChatVoiceEndpoints takes an optional ModulePath replacing the browser voice module, and PDChatVoiceEndpoints.Simulated uses one that hears that the user is talking, makes the words up and answers with the browser's own speech. DumbChatService offers it by default, plus two agents, so the demo shows Voice Mode and the agent picker with no speech service. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MS-26473. Follow-up to #228 (released in 10.0.322): Voice moves into the text entry area and becomes dictation, and an optional agent picker joins it.
Behaviour
VoiceEndpointsis not null andIsInputPermitted. The status line (Listening / Thinking / Speaking / error) is unchanged.VoiceAutoSendDelay(same path as the button, so the message is the user's in the transcript). If the box has focus, nothing is auto-sent and the status says to press Send. A new word, focusing the box, or turning Voice off cancels a pending send.OnVoiceSpokenkept. Note: a message the user sends with the Send button while Voice is listening counts too.pdchat-voice.jsis imported andstart()(the onlygetUserMedia) called only on that click; no probing at render. A test pins this.<select>("Who you are talking to") beside Voice, shown only with 2+ agents; option tooltip fromDescription, icon of the selected agent fromIconUrl. Choosing setsIChatService.SelectedAgentId. No model picker. No new event: a host that needs to react implements the setter, the simplest source-compatible option.Public API (all additive)
IChatService.VoiceAutoSendDelay(TimeSpan, settable default member, 1000 ms viaChatServiceDefaultState)IChatService.Agents(IReadOnlyList<PDChatAgentOption>?, defaultnull)IChatService.SelectedAgentId(string?, settable default member, defaultnull)record PDChatAgentOption(string Id, string Name, string? Description = null, string? IconUrl = null)interface IChatInput { string Text; bool IsFocused; Task AppendAsync(string); Task SendAsync(); }, implemented byPDMessagesPDMessagesparameters:RenderFragment? InputAccessories,EventCallback<bool> InputFocusChanged,bool IsInputAutoFocused = trueNo JavaScript changed.
Verification
dotnet build PanoramicData.Blazor.slnx: 0 errors; the only 2 warnings are the pre-existing NuGet "packaging disabled" notices on the Web and WASM hosts (same as on main).PanoramicData.Blazor.Test.exe): 3690 passed before, 3712 passed, 0 failed, 0 skipped after (+22).SelectedAgentId, unknown values ignored; PDMessagesIChatInputmembers, focus tracking, accessories placement and auto-focus switch.Dictation_is_never_auto_sent_while_the_text_box_has_focusfail ("Expected service.Sent to be empty, but found at least one item"); restored, it passes.🤖 Generated with Claude Code