Repository navigation
Commit 05302ca
fix(desktop): keep the draft space when typing right after a mention pick
Desktop Smoke E2E (2) failed on mentions.spec.ts ("typing a mention
before existing text does not interleave spaces"): picking a suggestion
mid-draft and typing immediately could swallow the draft's space
("hello @bob abcworld"). Chromium sometimes rewrites the whole
whitespace run around the caret as replace(" " -> "\u00A0a"), and the
settling-time text-input redirect only recognized a caret or a selected
trailing space, so the rewrite fell through to the destructive default
replacement.
Teach the redirect to recognize a space-run rewrite (space or NBSP) and
insert only the typed remainder after the mention's trailing space. The
race pre-dates this branch (reproduces on main at ~5-25% per local run);
300+ consecutive passes after the fix.
Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Matt Toohey <[email protected]>1 parent f5506a0 commit 05302ca
2 files changed
Lines changed: 81 additions & 31 deletions
File tree
- desktop/src/features/messages/lib
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | | - | |
| 255 | + | |
256 | 256 | | |
257 | 257 | | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
258 | 262 | | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
| 263 | + | |
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
268 | | - | |
| 268 | + | |
269 | 269 | | |
270 | 270 | | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
271 | 293 | | |
272 | | - | |
273 | | - | |
| 294 | + | |
| 295 | + | |
274 | 296 | | |
275 | 297 | | |
276 | 298 | | |
277 | | - | |
| 299 | + | |
278 | 300 | | |
279 | 301 | | |
280 | | - | |
281 | 302 | | |
282 | | - | |
283 | | - | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
284 | 309 | | |
285 | 310 | | |
286 | 311 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
61 | 66 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
66 | 80 | | |
67 | | - | |
| 81 | + | |
68 | 82 | | |
69 | 83 | | |
70 | 84 | | |
71 | | - | |
| 85 | + | |
| 86 | + | |
72 | 87 | | |
73 | 88 | | |
74 | | - | |
| 89 | + | |
75 | 90 | | |
76 | | - | |
77 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
78 | 98 | | |
79 | 99 | | |
80 | 100 | | |
| |||
84 | 104 | | |
85 | 105 | | |
86 | 106 | | |
87 | | - | |
| 107 | + | |
88 | 108 | | |
89 | 109 | | |
90 | 110 | | |
| 111 | + | |
91 | 112 | | |
92 | | - | |
| 113 | + | |
93 | 114 | | |
94 | | - | |
| 115 | + | |
95 | 116 | | |
96 | 117 | | |
97 | 118 | | |
| |||
396 | 417 | | |
397 | 418 | | |
398 | 419 | | |
399 | | - | |
| 420 | + | |
400 | 421 | | |
401 | 422 | | |
402 | 423 | | |
| 424 | + | |
403 | 425 | | |
404 | 426 | | |
405 | | - | |
| 427 | + | |
406 | 428 | | |
407 | 429 | | |
408 | 430 | | |
409 | | - | |
410 | | - | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
411 | 436 | | |
412 | 437 | | |
413 | 438 | | |
| |||
0 commit comments