Repository navigation
fix(pixel): retain dictation that exceeds composer capacity - #5546
Merged
gabsprogrammer merged 3 commits intoSep 19, 2026
Merged
gabsprogrammer merged 3 commits into
gabsprogrammer merged 3 commits into
Conversation
# Conflicts: # ods/extensions/services/dashboard/src/pages/Pixel.jsx
usePortalContext now POSTs /api/pixel/chat/context on mount. The dictation-capacity test asserted zero POSTs, which the read-only context poll broke. Scope the assertion to state-changing POSTs so the test again proves retained dictation never starts a send.
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.
Pass the real draft and 16,384-character limit into dictation. Bound complete final transcripts using the composer's separator/slash rules and reserve accepted text immediately across back-to-back speech events. On overflow, stop the recognition session, preserve the draft and expose the rejected words for manual copying, insertion after editing, or explicit discard.
Why this matters
A final browser speech result currently appends without checking the existing draft, making the message unsendable. Merely truncating or ignoring the result would lose the user's spoken words; checking only rendered props also misses multiple final events in one render batch.
Behavioral invariant: Dictation never makes the composer exceed its page limit or silently truncates speech. The overflowing final text remains recoverable within the current conversation, and cancelled-session callbacks cannot overwrite it or insert into a new chat.
Overlap check
Searched open/closed PRs for dictation draft limit, dictation overflow and speech draft length, plus PixelDictation.jsx/Pixel.jsx history. #4151 adds send-key preferences; #5008 concerns offline draft availability. No earlier PR covers dictation capacity/recovery. Batch #5528 selects speech language and #5535 bounds selected-passage actions; those independent controls do not handle asynchronous speech results or retain rejected speech. Their combined behavior will be tested together.
Production/test paths:
ods/extensions/services/dashboard/src/components/PixelDictation.jsx,ods/extensions/services/dashboard/src/pages/Pixel.jsx,ods/extensions/services/dashboard/src/pages/Pixel.dictation-capacity.test.jsx. The original main was fast-forwarded from verified upstream before branching; the explicitly requested target ispublic-betaat3c186f3f12ba21dad7b7266ec5449393529abb00.Regression and validation
Exact candidate:
9bad03b5f22c2e59d8db23467cd1be6a761650d3.npx vitest run src/pages/Pixel.dictation-capacity src/components/PixelDictation --maxWorkers=4: 11 passed on Windows Node 24.14.1. 3 new public-boundary assertions fail with untouched beta production code, demonstrating the behavior addressed here.git diff --check, and changed-file secret/private-key/large-file hooks pass.make lint, smoke and simulation passed. Full gate remains limited by two existing no-sudo Docker assertions under root; BATS has five baseline WSL/root/disk-space failures. Full-tree hooks also find dummy private-key fixtures and missing Windows awk. These are not represented as successful runtime gates.Compatibility and review
Uses the same JavaScript character count as the composer, not model-token estimation. Retained speech is temporary UI state and clears on conversation/availability changes or unmount; no new storage or automatic submit. Speech events are simulated and no microphone/browser-provider qualification is claimed. Revert removes the capacity guard and recovery UI.
Implementation and relevant local checks are complete, so this PR is Ready for review immediately. Independent review remains outstanding. No upstream merge or deployment is authorized by this PR.
Codex assisted with implementation and validation.