- Convert non-binary upstream Xunfei WebSocket messages to UTF-8 strings before forwarding them to browser clients.
- Export and test raw WebSocket data to text conversion for speech proxy forwarding.
- Log unparseable speech responses in the report editor instead of silently swallowing them.
- Update report editor, progress, and testing documentation for text-message forwarding.
- Resample microphone input from the actual browser AudioContext sample rate to 16k before sending it to the speech proxy.
- Encode speech input as 16-bit PCM and send it in small 1280-byte frames instead of relying on the browser to create a 16k audio context.
- Flush pending audio before sending the standard Xunfei IAT end frame.
- Extract PCM helpers and cover downsampling, PCM encoding, base64 conversion, and byte concatenation with unit tests.
- Update report editor, testing, and progress documentation for the corrected speech audio pipeline.
- Allow system frame position percentages to keep two decimal places without reordering saved values.
- Stop frontend and backend settings normalization from sorting framePositions on load or save.
- Capture automatic video frames in timeline order while retaining each configured position index.
- Insert automatically selected frames into report placeholders according to the configured percentage order.
- Add frame position utilities and unit coverage for two-decimal rounding, clamping, order preservation, and timeline capture planning.
- Update README, AGENTS, feature, requirement, report editor, system settings, progress, and testing docs for the new frame ordering behavior.
- Extract AI region scanning into a reusable utility with unit coverage.
- Refresh AI region dropdown state after drafts, reports, default templates, and selected templates write HTML into the editor.
- Keep the existing MutationObserver path for later DOM edits and inserted AI regions.
- Add E2E coverage for existing template AI regions appearing on initial report editor load.
- Update README, AGENTS, report editor, progress, and testing docs for AI region synchronization behavior.
- Extract AI prompt construction into a tested utility for report editor generation.
- Make doctor instructions and structured report fields higher priority than old template body and target-region HTML.
- Tell the AI not to carry over default gallbladder or liver descriptions when the doctor asks for another procedure or body part.
- Limit old full-report context length to reduce anchoring on default template content.
- Update README, AGENTS, report editor, design, progress, and testing docs for the AI prompt priority model.
- Add unit tests covering AI prompt priority and old-content truncation.
- Track report editor AI regions in React state instead of only scanning contentEditable DOM during render.
- Observe editor AI region mutations and refresh the AI writing target dropdown without requiring page navigation or refresh.
- Select newly inserted AI regions immediately after insertion and keep a live DOM fallback for generation.
- Harden AI region insertion so it still appends the region if execCommand has no active editor selection.
- Escape AI region names before injecting template HTML and add an accessible label for the insert button.
- Add Playwright coverage for inserting an AI region and seeing it immediately in the AI writing dropdown.
- Update report editor, feature, progress, testing, and AGENTS documentation for AI region synchronization.
- Add a self-signed HTTPS Nginx entrypoint on Docker port 4443 so browser microphone APIs can run in demo mode.
- Keep the existing HTTP port 4002 unchanged while exposing container port 443 and generating the demo certificate during image build.
- Update CORS defaults and Compose environment for the HTTPS frontend origin.
- Clarify the report editor microphone message with localhost, HTTPS, and browser trusted-origin demo options.
- Document the browser HTTP microphone limitation, HTTPS demo URL, and Chrome/Edge insecure-origin workaround in README and docs.
- Allow draft reports to be saved without patient name or hospital ID while keeping completed reports strictly validated.
- Preserve completed-report identity validation when updating existing reports by checking merged old and new values.
- Show real API save errors in the report editor and send expired sessions back to login instead of reporting a generic backend outage.
- Guard speech startup for missing getUserMedia or AudioContext support and explain localhost/HTTPS microphone requirements.
- Add report schema tests covering draft identity fields and completed-report validation.
- Update AGENTS and docs for report editor behavior, feature status, progress, and testing coverage.