Commit 178803f
authored
refactor sending prompt to agent from UI (#1539)
## Problem
trying to add more things that prompt the agent automatically, and more annotations to the review panel, was getting messy
<!-- Who is this for and what problem does it solve? -->
<!-- Closes #ISSUE_ID -->
## Changes
small refactor:
- adds `sendPromptToAgent` util that:
- takes in a prompt+task
- puts the review panel back to split view if it's open in full view
- focuses the main session tab
- sends the prompt to the agent
- broke out the prompt builders into a new util `reviewPrompts.ts`
- made `CommentAnnotation`self-contained -- now it handles building prompt and sending to agent -- so we don't have to thread a million things through a million components
- also updated the comment box to match new font styles
i still don't like how `task`/`taskId` are getting drilled a million levels deep everywhere, but that happens throughout the whole codebase... i considered a small task context, but it's pretty deeps, i'll revisit that later... for now this just avoids drilling _allll_ the annotation stuff
<!-- What did you change and why? -->
<!-- If there are frontend changes, include screenshots. -->
## How did you test this?
manually
<!-- Describe what you tested -- manual steps, automated tests, or both. -->
<!-- If you're an agent, only list tests you actually ran. -->1 parent 1f73cb4 commit 178803f
File tree
9 files changed
+136
-149
lines changed- apps/code/src/renderer/features
- code-review
- components
- hooks
- utils
- git-interaction/hooks
- sessions/utils
9 files changed
+136
-149
lines changedLines changed: 5 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
| 8 | + | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| |||
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
29 | | - | |
30 | 28 | | |
31 | 29 | | |
32 | 30 | | |
| |||
102 | 100 | | |
103 | 101 | | |
104 | 102 | | |
| 103 | + | |
105 | 104 | | |
106 | 105 | | |
107 | 106 | | |
108 | 107 | | |
109 | | - | |
110 | 108 | | |
111 | 109 | | |
112 | 110 | | |
| |||
117 | 115 | | |
118 | 116 | | |
119 | 117 | | |
| 118 | + | |
120 | 119 | | |
121 | 120 | | |
122 | 121 | | |
123 | 122 | | |
124 | | - | |
125 | 123 | | |
126 | 124 | | |
| 125 | + | |
127 | 126 | | |
128 | 127 | | |
129 | 128 | | |
130 | 129 | | |
131 | | - | |
132 | 130 | | |
133 | 131 | | |
134 | 132 | | |
| |||
158 | 156 | | |
159 | 157 | | |
160 | 158 | | |
161 | | - | |
| 159 | + | |
162 | 160 | | |
163 | 161 | | |
164 | 162 | | |
| |||
Lines changed: 46 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
1 | 5 | | |
| 6 | + | |
2 | 7 | | |
3 | 8 | | |
4 | | - | |
5 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
6 | 15 | | |
7 | 16 | | |
8 | 17 | | |
9 | | - | |
10 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
11 | 24 | | |
12 | 25 | | |
13 | 26 | | |
| |||
23 | 36 | | |
24 | 37 | | |
25 | 38 | | |
26 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
27 | 44 | | |
28 | | - | |
| 45 | + | |
29 | 46 | | |
30 | 47 | | |
31 | 48 | | |
| |||
35 | 52 | | |
36 | 53 | | |
37 | 54 | | |
38 | | - | |
| 55 | + | |
39 | 56 | | |
40 | 57 | | |
41 | | - | |
| 58 | + | |
42 | 59 | | |
43 | 60 | | |
44 | 61 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
71 | 83 | | |
72 | 84 | | |
73 | 85 | | |
| |||
Lines changed: 22 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | 81 | | |
98 | 82 | | |
99 | 83 | | |
| |||
150 | 134 | | |
151 | 135 | | |
152 | 136 | | |
| 137 | + | |
153 | 138 | | |
154 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
155 | 147 | | |
156 | 148 | | |
157 | 149 | | |
| |||
184 | 176 | | |
185 | 177 | | |
186 | 178 | | |
187 | | - | |
| 179 | + | |
188 | 180 | | |
189 | 181 | | |
190 | 182 | | |
| |||
214 | 206 | | |
215 | 207 | | |
216 | 208 | | |
217 | | - | |
| 209 | + | |
218 | 210 | | |
219 | 211 | | |
220 | 212 | | |
| |||
231 | 223 | | |
232 | 224 | | |
233 | 225 | | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | 226 | | |
245 | 227 | | |
246 | 228 | | |
| 229 | + | |
247 | 230 | | |
248 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
249 | 239 | | |
250 | 240 | | |
251 | | - | |
| 241 | + | |
252 | 242 | | |
253 | 243 | | |
254 | 244 | | |
| |||
Lines changed: 6 additions & 12 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 | 15 | | |
| |||
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
35 | | - | |
36 | | - | |
37 | 34 | | |
38 | 35 | | |
39 | 36 | | |
| |||
79 | 76 | | |
80 | 77 | | |
81 | 78 | | |
82 | | - | |
83 | 79 | | |
84 | 80 | | |
85 | 81 | | |
| |||
118 | 114 | | |
119 | 115 | | |
120 | 116 | | |
121 | | - | |
| 117 | + | |
122 | 118 | | |
123 | 119 | | |
124 | 120 | | |
| |||
148 | 144 | | |
149 | 145 | | |
150 | 146 | | |
151 | | - | |
152 | 147 | | |
153 | 148 | | |
154 | 149 | | |
| |||
162 | 157 | | |
163 | 158 | | |
164 | 159 | | |
165 | | - | |
166 | 160 | | |
167 | 161 | | |
168 | 162 | | |
| |||
193 | 187 | | |
194 | 188 | | |
195 | 189 | | |
196 | | - | |
| 190 | + | |
197 | 191 | | |
198 | 192 | | |
199 | 193 | | |
| |||
213 | 207 | | |
214 | 208 | | |
215 | 209 | | |
| 210 | + | |
216 | 211 | | |
217 | 212 | | |
218 | 213 | | |
219 | | - | |
220 | 214 | | |
221 | 215 | | |
222 | 216 | | |
| 217 | + | |
223 | 218 | | |
224 | 219 | | |
225 | 220 | | |
226 | | - | |
227 | 221 | | |
228 | 222 | | |
229 | 223 | | |
| |||
245 | 239 | | |
246 | 240 | | |
247 | 241 | | |
248 | | - | |
| 242 | + | |
249 | 243 | | |
250 | 244 | | |
251 | 245 | | |
| |||
0 commit comments