Commit a76724d
authored
refactor: replace snackbars with persistent info popups (#315)
ui.showSnackbar has a few issues that make it unreliable for surfacing
errors and notifications:
- Limited lifetime: a snackbar launched while the window is hidden is
often never shown if more than a few seconds pass before the window
becomes visible.
- Only the last of several snackbars launched in a row is displayed.
- Toolbox keeps the coroutine suspended for the snackbar's lifetime and
cancels (rather than resumes) it on dismissal, propagating the cancel to
the caller and skipping any follow-up code such as resetting the busy
state.
Switch to ui.showInfoPopup, which is backed by a persistent dialog
state: it is still rendered once the window becomes visible, resumes
normally on dismissal, and is serialized via a mutex so popups are shown
one after another instead of overwriting each other.
Since popups render after the window becomes visible, the ErrorReporter
buffer-and-flush abstraction is no longer needed. Remove it along with
the parallel errorBuffer in CoderRemoteProvider and the visibilityState
plumbing threaded through the setup wizard steps; errors are now shown
directly where they occur.
- resolves https://linear.app/codercom/issue/DEVEX-408/1 parent 8783eb8 commit a76724d
14 files changed
Lines changed: 129 additions & 286 deletions
File tree
- src
- main/kotlin/com/coder/toolbox
- util
- views
- test/kotlin/com/coder/toolbox
- cli
- sdk
- util
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
Lines changed: 13 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | 95 | | |
102 | 96 | | |
103 | 97 | | |
| |||
109 | 103 | | |
110 | 104 | | |
111 | 105 | | |
112 | | - | |
113 | | - | |
114 | 106 | | |
115 | 107 | | |
116 | 108 | | |
| |||
158 | 150 | | |
159 | 151 | | |
160 | 152 | | |
161 | | - | |
162 | 153 | | |
163 | 154 | | |
164 | 155 | | |
165 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
166 | 161 | | |
167 | 162 | | |
| 163 | + | |
168 | 164 | | |
169 | 165 | | |
170 | 166 | | |
| |||
331 | 327 | | |
332 | 328 | | |
333 | 329 | | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | 330 | | |
338 | 331 | | |
339 | 332 | | |
| |||
378 | 371 | | |
379 | 372 | | |
380 | 373 | | |
381 | | - | |
| 374 | + | |
382 | 375 | | |
383 | 376 | | |
384 | 377 | | |
| |||
458 | 451 | | |
459 | 452 | | |
460 | 453 | | |
461 | | - | |
| 454 | + | |
462 | 455 | | |
463 | 456 | | |
464 | 457 | | |
| |||
555 | 548 | | |
556 | 549 | | |
557 | 550 | | |
558 | | - | |
| 551 | + | |
559 | 552 | | |
560 | 553 | | |
561 | 554 | | |
562 | 555 | | |
563 | | - | |
| 556 | + | |
564 | 557 | | |
565 | 558 | | |
566 | 559 | | |
567 | 560 | | |
568 | 561 | | |
569 | 562 | | |
570 | | - | |
| 563 | + | |
571 | 564 | | |
572 | 565 | | |
573 | 566 | | |
574 | 567 | | |
575 | 568 | | |
576 | 569 | | |
577 | | - | |
578 | | - | |
| 570 | + | |
| 571 | + | |
579 | 572 | | |
580 | 573 | | |
581 | 574 | | |
582 | | - | |
583 | | - | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | 575 | | |
589 | 576 | | |
590 | 577 | | |
| |||
Lines changed: 22 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
37 | | - | |
38 | 36 | | |
| 37 | + | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
78 | 83 | | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
86 | 88 | | |
87 | | - | |
88 | | - | |
| 89 | + | |
| 90 | + | |
89 | 91 | | |
90 | | - | |
91 | | - | |
| 92 | + | |
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
97 | | - | |
| 98 | + | |
98 | 99 | | |
99 | | - | |
| 100 | + | |
100 | 101 | | |
101 | 102 | | |
102 | 103 | | |
| |||
Lines changed: 0 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | 47 | | |
55 | 48 | | |
56 | 49 | | |
| |||
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
| |||
273 | 272 | | |
274 | 273 | | |
275 | 274 | | |
276 | | - | |
277 | | - | |
| 275 | + | |
278 | 276 | | |
279 | 277 | | |
280 | 278 | | |
| |||
Lines changed: 7 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | 9 | | |
15 | 10 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 11 | + | |
20 | 12 | | |
21 | 13 | | |
22 | 14 | | |
| |||
34 | 26 | | |
35 | 27 | | |
36 | 28 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
43 | 33 | | |
44 | 34 | | |
45 | 35 | | |
46 | 36 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 37 | + | |
Lines changed: 3 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
16 | | - | |
17 | 15 | | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
21 | 19 | | |
22 | 20 | | |
23 | 21 | | |
24 | | - | |
25 | 22 | | |
26 | 23 | | |
27 | 24 | | |
| |||
31 | 28 | | |
32 | 29 | | |
33 | 30 | | |
34 | | - | |
| 31 | + | |
35 | 32 | | |
36 | 33 | | |
37 | 34 | | |
38 | 35 | | |
39 | | - | |
40 | 36 | | |
41 | 37 | | |
42 | 38 | | |
43 | 39 | | |
44 | | - | |
45 | 40 | | |
46 | 41 | | |
47 | 42 | | |
| |||
58 | 53 | | |
59 | 54 | | |
60 | 55 | | |
61 | | - | |
62 | 56 | | |
63 | 57 | | |
64 | 58 | | |
| |||
153 | 147 | | |
154 | 148 | | |
155 | 149 | | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | 150 | | |
163 | 151 | | |
164 | 152 | | |
165 | 153 | | |
166 | | - | |
167 | 154 | | |
168 | 155 | | |
169 | 156 | | |
170 | | - | |
| 157 | + | |
171 | 158 | | |
172 | 159 | | |
173 | 160 | | |
174 | 161 | | |
175 | 162 | | |
176 | 163 | | |
177 | 164 | | |
178 | | - | |
179 | 165 | | |
180 | 166 | | |
181 | 167 | | |
182 | 168 | | |
183 | 169 | | |
184 | | - | |
| 170 | + | |
185 | 171 | | |
186 | 172 | | |
187 | 173 | | |
| |||
0 commit comments