Affected area
Desktop UI (agent-gui / React) and Gateway WebUI.
Version or commit
main@7de95a20bf93cfe026a57f6367c453e74a50acef
Environment
- Windows 11 desktop app (
pnpm --dir crates/agent-gui tauri dev)
- Self-hosted Gateway backend and Gateway WebUI
- The affected desktop React path is shared by Windows, macOS, and Linux
Steps to reproduce
- Paste
alpha\n\nbeta into the message composer. The clipboard may contain only text/plain or both text/plain and text/html.
- Send the message and inspect the optimistic user bubble.
- Reload the window or restore the same conversation from history.
- Repeat with LF, CRLF, CR, leading/trailing newlines, and multiple consecutive blank lines.
- Compare a manually typed message with the same logical text.
Expected behavior
- CRLF/CR may normalize to LF, but the number and position of logical newlines remain unchanged.
- A single blank line renders as one blank line.
- Composer draft, outbound payload, history/replay, desktop bubble, and Gateway WebUI bubble contain the same logical text.
- Manual input and paste produce identical payloads and rendering.
Actual behavior
- Chromium represents a pasted empty line as
DIV > BR.
- The composer serializer counts both the block boundary and the placeholder
BR, so alpha\n\nbeta becomes alpha\n\n\nbeta.
- Full-message
trim() calls remove valid leading and trailing logical newlines.
- The user bubble faithfully renders the already-expanded text, making one blank line appear roughly three lines high.
- A trailing LF remains in DOM text but Chromium does not allocate its final visual line box.
Evidence
The deterministic production-module browser reproduction records every stage:
| Stage |
Before fix for alpha\n\nbeta |
Expected |
| Clipboard |
2 newlines |
2 |
| Composer |
3 newlines |
2 |
| Outbound |
3 newlines |
2 |
| History/replay |
3 newlines |
2 |
| User bubble DOM |
3 newlines |
2 |
GUI and Gateway WebUI screenshots with the corrected five-stage counts and visual spacing are attached below.
Pre-submit checklist
Affected area
Desktop UI (
agent-gui/ React) and Gateway WebUI.Version or commit
main@7de95a20bf93cfe026a57f6367c453e74a50acefEnvironment
pnpm --dir crates/agent-gui tauri dev)Steps to reproduce
alpha\n\nbetainto the message composer. The clipboard may contain onlytext/plainor bothtext/plainandtext/html.Expected behavior
Actual behavior
DIV > BR.BR, soalpha\n\nbetabecomesalpha\n\n\nbeta.trim()calls remove valid leading and trailing logical newlines.Evidence
The deterministic production-module browser reproduction records every stage:
alpha\n\nbetaGUI and Gateway WebUI screenshots with the corrected five-stage counts and visual spacing are attached below.
Pre-submit checklist