Commit 1035b3f
authored
refactor: improve Agent Settings popup UI components (#12901)
### What this PR does
Before this PR:
- Agent settings popup used a complex `ToolingSettings` component (574
lines) that handled both permission modes and MCP tools in a single
monolithic component
- Permission mode settings had verbose descriptions and lacked clear
visual feedback for selected modes
- Some UI layouts were not optimally responsive
After this PR:
- Split `ToolingSettings` into two focused components:
`PermissionModeSettings` and `ToolsAndMCPSettings` for better separation
of concerns
- Permission mode selection now uses a cleaner card-based UI with
CheckCircle icons for visual feedback
- Added comprehensive i18n support for permission modes and tools
settings across 11 languages
- Improved layout responsiveness in `NameSetting` and `PromptSettings`
components
- Simplified modal handling in permission settings using
`window.modal.confirm`
### Why we need it and why it was done in this way
The following tradeoffs were made:
- Chose to split the monolithic component into smaller focused
components for better maintainability, at the cost of slightly more
files
- Removed detailed behavior descriptions from permission mode UI to
reduce visual clutter while keeping essential information
The following alternatives were considered:
- Keeping the single component but it was becoming too complex to
maintain
- Different UI patterns for permission mode selection, but the
card-based approach provides the clearest visual hierarchy
### Breaking changes
None. This is a pure refactor with UI improvements and i18n additions.
### Special notes for your reviewer
- The overall functionality remains the same, this is primarily a
refactoring and UI polish effort
- i18n files for non-English locales may need review from native
speakers
- Total: +816 lines, -1006 lines (net reduction of ~190 lines)
### Checklist
- [x] PR: The PR description is expressive enough and will help future
contributors
- [x] Code: Write code that humans can understand and Keep it simple
- [x] Refactor: Left the code cleaner than found it (Boy Scout Rule)
- [ ] Upgrade: N/A - no upgrade flow impact
- [ ] Documentation: N/A - internal refactor, no user-facing
documentation needed
### Release note
```release-note
Refactor Agent Settings popup with improved UI components, better permission mode selection, and comprehensive i18n support for 11 languages.
```1 parent 6ae1cb0 commit 1035b3f
38 files changed
Lines changed: 1493 additions & 1348 deletions
File tree
- src/renderer/src
- components/Popups/agent
- config
- hooks/agents
- i18n
- locales
- translate
- pages
- home/Messages
- settings/AgentSettings
- components
- PluginsSettings
- components
- types
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
420 | 419 | | |
421 | 420 | | |
422 | 421 | | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | 422 | | |
434 | 423 | | |
435 | 424 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
| 31 | + | |
34 | 32 | | |
35 | 33 | | |
36 | 34 | | |
37 | 35 | | |
38 | 36 | | |
39 | | - | |
| 37 | + | |
40 | 38 | | |
41 | | - | |
42 | | - | |
43 | | - | |
| 39 | + | |
44 | 40 | | |
45 | 41 | | |
46 | 42 | | |
47 | 43 | | |
48 | 44 | | |
49 | | - | |
| 45 | + | |
50 | 46 | | |
51 | | - | |
52 | | - | |
53 | | - | |
| 47 | + | |
54 | 48 | | |
55 | 49 | | |
56 | 50 | | |
57 | 51 | | |
58 | 52 | | |
59 | | - | |
| 53 | + | |
60 | 54 | | |
61 | | - | |
62 | | - | |
63 | | - | |
| 55 | + | |
64 | 56 | | |
65 | 57 | | |
66 | 58 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
156 | 160 | | |
157 | 161 | | |
158 | 162 | | |
| |||
223 | 227 | | |
224 | 228 | | |
225 | 229 | | |
| 230 | + | |
226 | 231 | | |
227 | 232 | | |
228 | 233 | | |
229 | 234 | | |
230 | 235 | | |
231 | | - | |
232 | | - | |
233 | | - | |
| 236 | + | |
| 237 | + | |
234 | 238 | | |
235 | 239 | | |
236 | | - | |
237 | | - | |
238 | | - | |
| 240 | + | |
| 241 | + | |
239 | 242 | | |
240 | 243 | | |
241 | 244 | | |
242 | 245 | | |
243 | 246 | | |
244 | 247 | | |
245 | 248 | | |
246 | | - | |
247 | | - | |
248 | | - | |
| 249 | + | |
| 250 | + | |
249 | 251 | | |
250 | 252 | | |
251 | 253 | | |
252 | 254 | | |
253 | | - | |
254 | | - | |
255 | | - | |
| 255 | + | |
| 256 | + | |
256 | 257 | | |
257 | 258 | | |
258 | 259 | | |
259 | 260 | | |
260 | 261 | | |
261 | 262 | | |
| 263 | + | |
262 | 264 | | |
263 | 265 | | |
264 | 266 | | |
265 | 267 | | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
| 268 | + | |
| 269 | + | |
294 | 270 | | |
295 | 271 | | |
296 | 272 | | |
| |||
300 | 276 | | |
301 | 277 | | |
302 | 278 | | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
303 | 288 | | |
304 | 289 | | |
305 | 290 | | |
| |||
349 | 334 | | |
350 | 335 | | |
351 | 336 | | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
352 | 380 | | |
353 | 381 | | |
354 | 382 | | |
| |||
0 commit comments