Commit 34895ca
authored
🤖 feat: add visual feedback when terminating background processes (#1062)
When clicking the terminate button on a background process, the X icon
immediately swaps to a spinner and the row dims, giving instant visual
feedback.
## Changes
- Track `terminatingIds` in `useBackgroundBashHandlers` hook
- Pass to `BackgroundProcessesBanner` for visual styling
- Show spinning `Loader2` icon instead of X while terminating
- Dim row with `opacity-50` + `pointer-events-none`
- Clear stale IDs when processes change (via subscription) to handle
process restarts
## Why only clear on failure?
Clearing on success causes a flash: the promise resolves slightly before
the subscription arrives, briefly showing the X again. By only clearing
on failure, the spinner stays until the subscription removes the row.
_Generated with mux_1 parent 32a26d9 commit 34895ca
File tree
3 files changed
+75
-32
lines changed- src/browser
- components
- hooks
3 files changed
+75
-32
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
129 | 130 | | |
130 | 131 | | |
131 | 132 | | |
| |||
682 | 683 | | |
683 | 684 | | |
684 | 685 | | |
| 686 | + | |
685 | 687 | | |
686 | 688 | | |
687 | 689 | | |
| |||
Lines changed: 45 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
99 | 130 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | 131 | | |
119 | | - | |
120 | | - | |
| 132 | + | |
| 133 | + | |
121 | 134 | | |
122 | 135 | | |
123 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| |||
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| 41 | + | |
| 42 | + | |
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
| |||
86 | 90 | | |
87 | 91 | | |
88 | 92 | | |
| 93 | + | |
89 | 94 | | |
90 | 95 | | |
91 | 96 | | |
| |||
104 | 109 | | |
105 | 110 | | |
106 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
107 | 123 | | |
108 | 124 | | |
109 | 125 | | |
| |||
122 | 138 | | |
123 | 139 | | |
124 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
125 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
126 | 152 | | |
127 | 153 | | |
128 | 154 | | |
| |||
150 | 176 | | |
151 | 177 | | |
152 | 178 | | |
| 179 | + | |
153 | 180 | | |
154 | 181 | | |
155 | 182 | | |
| |||
158 | 185 | | |
159 | 186 | | |
160 | 187 | | |
| 188 | + | |
161 | 189 | | |
162 | 190 | | |
163 | 191 | | |
| |||
0 commit comments