Commit c568369
authored
🐛 fix(operation): isolate loading state to current active topic (#10360)
* fix(operation): isolate loading state to current active topic
- Modified isMainWindowAgentRuntimeRunning to only check operations in current active topic
- Prevents loading state from other topics affecting the send button
- Added comprehensive test case to verify topic isolation
- Fixes issue where switching topics would still show loading state from previous topic
* test: fix isMainWindowAgentRuntimeRunning tests to set active context
- Added activeId and activeTopicId setup in test cases
- Ensured operation context matches active context for proper filtering
- Fixed tests to align with new getCurrentContextOperations-based implementation
* fix: change activeTopicId from null to undefined in tests
- Fixed TypeScript type error where null is not assignable to string | undefined
- Changed all activeTopicId: null to activeTopicId: undefined
* fix: check if operation's message is in current displayed messages
- Changed from using getCurrentContextOperations to checking message presence
- Prevents loading state from showing when switching back to default topic
- Operation's context topicId is captured at creation time and doesn't update
- Now checks if operation's message is in activeDisplayMessages instead
* refactor
* refactor to fix
* try to fix stylelint ci issue
* fix tests
* fix tests1 parent 19f7d74 commit c568369
File tree
24 files changed
+341
-300
lines changed- packages
- database/src/repositories/knowledge
- types/src/user/settings
- src
- features/ChatList/Error
- services
- __tests__
- store
- chat
- agents
- __tests__/createAgentExecutors
- helpers
- slices
- aiChat/actions
- builtinTool/actions
- __tests__
- message/actions
- operation
- __tests__
- plugin/actions
- user/slices/settings/selectors
24 files changed
+341
-300
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
399 | 402 | | |
400 | 403 | | |
401 | 404 | | |
402 | | - | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
403 | 409 | | |
404 | 410 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | 132 | | |
139 | 133 | | |
140 | 134 | | |
| |||
308 | 302 | | |
309 | 303 | | |
310 | 304 | | |
311 | | - | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
312 | 309 | | |
313 | 310 | | |
314 | 311 | | |
| |||
338 | 335 | | |
339 | 336 | | |
340 | 337 | | |
341 | | - | |
| 338 | + | |
342 | 339 | | |
343 | 340 | | |
344 | 341 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | 54 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | 55 | | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
| 26 | + | |
30 | 27 | | |
31 | 28 | | |
32 | 29 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
109 | 108 | | |
110 | 109 | | |
111 | | - | |
| 110 | + | |
112 | 111 | | |
113 | 112 | | |
114 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
| 1 | + | |
7 | 2 | | |
8 | 3 | | |
9 | | - | |
10 | 4 | | |
11 | 5 | | |
12 | 6 | | |
| |||
22 | 16 | | |
23 | 17 | | |
24 | 18 | | |
25 | | - | |
26 | 19 | | |
27 | 20 | | |
28 | 21 | | |
| |||
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
| |||
229 | 232 | | |
230 | 233 | | |
231 | 234 | | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
232 | 238 | | |
233 | 239 | | |
234 | 240 | | |
| |||
262 | 268 | | |
263 | 269 | | |
264 | 270 | | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
265 | 274 | | |
266 | 275 | | |
267 | 276 | | |
| |||
1061 | 1070 | | |
1062 | 1071 | | |
1063 | 1072 | | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
1064 | 1076 | | |
1065 | 1077 | | |
1066 | 1078 | | |
| |||
1180 | 1192 | | |
1181 | 1193 | | |
1182 | 1194 | | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
1183 | 1198 | | |
1184 | 1199 | | |
1185 | 1200 | | |
| |||
1211 | 1226 | | |
1212 | 1227 | | |
1213 | 1228 | | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
1214 | 1232 | | |
1215 | 1233 | | |
1216 | 1234 | | |
| |||
0 commit comments