Commit 9aa2a51
authored
improvement(mothership): smooth streamed text reveal + dropdown z-index fix (#4947)
* fix(emcn): render dropdown menus above modals so in-modal dropdowns are clickable
The base DropdownMenuContent defaulted to --z-dropdown (100), below the
modal at --z-modal (200) — the only Radix popper that sat below the
modal (Popover/Tooltip/Toast all sit above). Since the modal overlay is
semi-transparent, an in-modal dropdown was faintly visible but
intercepted no clicks, which forced one-off z-popover overrides on
ChipDropdown and ChipSelect.
Move the DropdownMenu base to the popover layer (--z-popover, above the
modal) and drop the redundant per-component overrides, so every menu —
including the 39 raw DropdownMenu consumers — is clickable inside a chip
modal from a single source of truth. The --z-dropdown variable stays at
100 for the in-flow panels that intentionally sit below modals.
* improvement(mothership): smooth streamed text reveal and fix completion flash
Port opencode's paced word-boundary reveal into useSmoothText so streamed text builds smoothly regardless of how the model chunks deltas, and keep it smooth through completion:
- Reveal on a steady 24ms timer in tiered steps that snap to word/punctuation boundaries instead of revealing partial tokens.
- Drain the lagging tail at the paced cadence on stream end instead of snapping; the consumer holds streaming render until the reveal catches up.
- Pin a streamed message to Streamdown's streaming mode for its mounted lifetime so the static-mode swap doesn't remount and re-highlight the message.
- Key the assistant row by its owning user message id so the live->persisted id swap no longer remounts the row (whole-message blink) at completion.
* docs(emcn): trim z-index scale comment to original footprint
Correct the pre-existing scale comment in place (the old wording became
stale when DropdownMenu moved to the popover layer) rather than expanding
it. The scale tokens are global, so their documentation stays with them.1 parent bc371b0 commit 9aa2a51
7 files changed
Lines changed: 102 additions & 78 deletions
File tree
- apps/sim
- app
- _styles
- workspace/[workspaceId]/home/components
- message-content/components/chat-content
- mothership-chat
- components/emcn/components
- chip-dropdown
- chip-select
- hooks
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
| 24 | + | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
Lines changed: 14 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
295 | 300 | | |
296 | 301 | | |
297 | 302 | | |
| |||
308 | 313 | | |
309 | 314 | | |
310 | 315 | | |
311 | | - | |
312 | | - | |
| 316 | + | |
| 317 | + | |
313 | 318 | | |
314 | 319 | | |
315 | 320 | | |
| |||
365 | 370 | | |
366 | 371 | | |
367 | 372 | | |
368 | | - | |
369 | | - | |
370 | | - | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
371 | 376 | | |
372 | 377 | | |
373 | 378 | | |
| |||
383 | 388 | | |
384 | 389 | | |
385 | 390 | | |
386 | | - | |
| 391 | + | |
387 | 392 | | |
388 | 393 | | |
389 | 394 | | |
390 | 395 | | |
391 | 396 | | |
392 | 397 | | |
393 | 398 | | |
394 | | - | |
395 | | - | |
396 | | - | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
397 | 402 | | |
398 | 403 | | |
399 | 404 | | |
| |||
Lines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
226 | 240 | | |
227 | 241 | | |
228 | 242 | | |
| |||
297 | 311 | | |
298 | 312 | | |
299 | 313 | | |
300 | | - | |
| 314 | + | |
301 | 315 | | |
302 | 316 | | |
303 | 317 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
294 | | - | |
295 | 294 | | |
296 | 295 | | |
297 | 296 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
| 241 | + | |
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
7 | 11 | | |
8 | | - | |
9 | | - | |
10 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
11 | 40 | | |
12 | 41 | | |
13 | 42 | | |
| |||
31 | 60 | | |
32 | 61 | | |
33 | 62 | | |
34 | | - | |
35 | | - | |
36 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
37 | 74 | | |
38 | | - | |
39 | | - | |
40 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
41 | 82 | | |
42 | 83 | | |
43 | 84 | | |
| |||
51 | 92 | | |
52 | 93 | | |
53 | 94 | | |
54 | | - | |
55 | 95 | | |
56 | | - | |
| 96 | + | |
57 | 97 | | |
58 | 98 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | 99 | | |
64 | 100 | | |
65 | 101 | | |
| |||
74 | 110 | | |
75 | 111 | | |
76 | 112 | | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | 113 | | |
90 | 114 | | |
91 | 115 | | |
92 | 116 | | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
98 | 121 | | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | 122 | | |
105 | 123 | | |
106 | 124 | | |
107 | 125 | | |
108 | 126 | | |
| 127 | + | |
109 | 128 | | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
| 129 | + | |
124 | 130 | | |
125 | 131 | | |
126 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
127 | 135 | | |
128 | 136 | | |
129 | | - | |
130 | | - | |
| 137 | + | |
| 138 | + | |
131 | 139 | | |
132 | 140 | | |
133 | 141 | | |
134 | | - | |
135 | | - | |
136 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
137 | 145 | | |
138 | 146 | | |
139 | | - | |
| 147 | + | |
140 | 148 | | |
141 | | - | |
142 | | - | |
143 | 149 | | |
144 | 150 | | |
145 | 151 | | |
0 commit comments