| @@ -1,8 +1,8 @@ |
| 1 | 1 | //! The subagents panel: every subagent the open thread's agent started, the |
| 2 | 2 | //! working ones first with what each is doing right now (its latest tool |
| 3 | 3 | //! call, its progress summary, how long it's run, its tool uses and |
| 4 | | - //! tokens), then the finished ones. Subagents working in other threads |
| 5 | | - //! list under them. A click shows the subagent's call in its conversation. |
| 4 | + //! tokens), then the finished ones. A click shows the subagent's call in |
| 5 | + //! its conversation. |
| 6 | 6 | //! |
| 7 | 7 | //! Claude's Task and Agent calls are one subagent each. Pi's `subagent` |
| 8 | 8 | //! extension and jcode's swarm spawns can start several, each its own row. |
| @@ -129,15 +129,6 @@ impl Workspace { |
| 129 | 129 | let (working, mut finished): (Vec<Subagent>, Vec<Subagent>) = |
| 130 | 130 | mine.into_iter().partition(|subagent| subagent.status == TaskStatus::Running); |
| 131 | 131 | finished.reverse(); |
| 132 | | - // Subagents working in the other threads. |
| 133 | | - let elsewhere: Vec<Subagent> = self |
| 134 | | - .projects |
| 135 | | - .iter() |
| 136 | | - .flat_map(|project| &project.sessions) |
| 137 | | - .filter(|session| Some(*session) != self.active.as_ref()) |
| 138 | | - .flat_map(|session| subagents_of(session, cx)) |
| 139 | | - .filter(|subagent| subagent.status == TaskStatus::Running) |
| 140 | | - .collect(); |
| 141 | 132 | let empty = working.is_empty() && finished.is_empty(); |
| 142 | 133 | |
| 143 | 134 | let header = h_flex() |
| @@ -165,15 +156,13 @@ impl Workspace { |
| 165 | 156 | .child(div().px(px(10.)).pt(px(8.)).pb(px(4.)).child(metal::engraved(title, p))) |
| 166 | 157 | .children(rows) |
| 167 | 158 | }; |
| 168 | | - let rows = |subagents: Vec<Subagent>, other: bool, cx: &mut Context<Self>| -> Vec<AnyElement> { |
| 169 | | - subagents.into_iter().map(|subagent| self.render_subagent(subagent, other, p, cx)).collect() |
| 159 | + let rows = |subagents: Vec<Subagent>, cx: &mut Context<Self>| -> Vec<AnyElement> { |
| 160 | + subagents.into_iter().map(|subagent| self.render_subagent(subagent, p, cx)).collect() |
| 170 | 161 | }; |
| 171 | 162 | let working_count = working.len(); |
| 172 | 163 | let finished_count = finished.len(); |
| 173 | | - let elsewhere_count = elsewhere.len(); |
| 174 | | - let working_rows = rows(working, false, cx); |
| 175 | | - let finished_rows = rows(finished, false, cx); |
| 176 | | - let elsewhere_rows = rows(elsewhere, true, cx); |
| 164 | + let working_rows = rows(working, cx); |
| 165 | + let finished_rows = rows(finished, cx); |
| 177 | 166 | |
| 178 | 167 | v_flex() |
| 179 | 168 | .w(px(PANEL_WIDTH)) |
| @@ -208,15 +197,14 @@ impl Workspace { |
| 208 | 197 | ) |
| 209 | 198 | }) |
| 210 | 199 | .when(working_count > 0, |this| this.child(section("Working".into(), working_rows))) |
| 211 | | - .when(finished_count > 0, |this| this.child(section(format!("Finished · {finished_count}"), finished_rows))) |
| 212 | | - .when(elsewhere_count > 0, |this| this.child(section("In other threads".into(), elsewhere_rows))), |
| 200 | + .when(finished_count > 0, |this| this.child(section(format!("Finished · {finished_count}"), finished_rows))), |
| 213 | 201 | ), |
| 214 | 202 | ) |
| 215 | 203 | } |
| 216 | 204 | |
| 217 | 205 | /// One subagent: its light, what it was asked to do and for how long, |
| 218 | 206 | /// its kind and totals, and while it works, what it's doing now. |
| 219 | | - fn render_subagent(&self, subagent: Subagent, other: bool, p: &Palette, cx: &mut Context<Self>) -> AnyElement { |
| 207 | + fn render_subagent(&self, subagent: Subagent, p: &Palette, cx: &mut Context<Self>) -> AnyElement { |
| 220 | 208 | let running = subagent.status == TaskStatus::Running; |
| 221 | 209 | let (led, status) = match subagent.status { |
| 222 | 210 | TaskStatus::Running => (Led::Live, None), |
| @@ -225,7 +213,6 @@ impl Workspace { |
| 225 | 213 | TaskStatus::Stopped => (Led::Off, Some("Stopped")), |
| 226 | 214 | }; |
| 227 | 215 | let id = subagent.id; |
| 228 | | - let thread = other.then(|| subagent.session.read(cx).title.clone()); |
| 229 | 216 | // A delegated task's agent can stop to ask the user something. |
| 230 | 217 | let waiting = running |
| 231 | 218 | && subagent |
| @@ -293,9 +280,6 @@ impl Workspace { |
| 293 | 280 | ) |
| 294 | 281 | }), |
| 295 | 282 | ) |
| 296 | | - .when_some(thread, |this, thread| { |
| 297 | | - this.child(div().truncate().text_size(px(11.5)).text_color(p.ink3).child(thread)) |
| 298 | | - }) |
| 299 | 283 | .when_some(subagent.activity, |this, (icon, label)| { |
| 300 | 284 | this.child( |
| 301 | 285 | h_flex() |