aboutsummaryrefslogtreecommitdiff
path: root/src/client/shell/endpoint_agents.rs
diff options
context:
space:
mode:
authorakbash <akbash@herdr.dev>2026-09-14 01:11:07 +0300
committerGitHub <noreply@github.com>2026-09-14 02:11:07 +0400
commit3b478e69dcbe8e416ddd46f0e24156392d4e71da (patch)
treee4ae8adfc09dce6eb09bd036fb727cc7f19edff7 /src/client/shell/endpoint_agents.rs
parent4e1096b1018496a23fb9de7f9ae737d3792bb38b (diff)
fix: scope agent views to the selected machine (#3784)
* fix: scope agent views to the selected machine refs #3732 * fix: preserve stable agent view ordering refs #3732 --------- Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com> Co-authored-by: JJ Liebig <jonathan.liebig@gmail.com>
Diffstat (limited to 'src/client/shell/endpoint_agents.rs')
-rw-r--r--src/client/shell/endpoint_agents.rs43
1 files changed, 28 insertions, 15 deletions
diff --git a/src/client/shell/endpoint_agents.rs b/src/client/shell/endpoint_agents.rs
index a49fccf9..3cc106b3 100644
--- a/src/client/shell/endpoint_agents.rs
+++ b/src/client/shell/endpoint_agents.rs
@@ -103,8 +103,17 @@ fn agent_rows(
.iter()
.filter_map(|endpoint| {
endpoint.snapshot.as_deref().map(|snapshot| {
- super::agent_sidebar::agent_rows(snapshot, config, Some(&endpoint.label))
- .into_iter()
+ snapshot
+ .agents
+ .iter()
+ .filter_map(|agent| {
+ super::agent_sidebar::agent_row(
+ snapshot,
+ &agent.pane_id,
+ config,
+ Some(&endpoint.label),
+ )
+ })
.map(|agent| ((endpoint.endpoint_id.clone(), agent.pane_id.clone()), agent))
.collect::<Vec<_>>()
})
@@ -112,18 +121,22 @@ fn agent_rows(
.flatten()
.collect::<HashMap<_, _>>();
- super::aggregate_navigation::aggregate_agent_rows(endpoints, config.agent_panel_sort)
- .into_iter()
- .filter_map(|row| {
- let key = (row.endpoint.endpoint_id.clone(), row.agent.pane_id.clone());
- let mut agent = rendered_rows.remove(&key)?;
- agent.focused &= row.endpoint.endpoint_id == active_endpoint_id;
- Some(EndpointAgentRow {
- endpoint_id: row.endpoint.endpoint_id.clone(),
- machine_label: row.endpoint.label.to_owned(),
- stale: row.endpoint.stale(),
- agent,
- })
+ super::aggregate_navigation::aggregate_agent_rows(
+ endpoints,
+ active_endpoint_id,
+ config.agent_panel_sort,
+ )
+ .into_iter()
+ .filter_map(|row| {
+ let key = (row.endpoint.endpoint_id.clone(), row.agent.pane_id.clone());
+ let mut agent = rendered_rows.remove(&key)?;
+ agent.focused &= row.endpoint.endpoint_id == active_endpoint_id;
+ Some(EndpointAgentRow {
+ endpoint_id: row.endpoint.endpoint_id.clone(),
+ machine_label: row.endpoint.label.to_owned(),
+ stale: row.endpoint.stale(),
+ agent,
})
- .collect()
+ })
+ .collect()
}