Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/src/cockpit/model_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -903,13 +903,19 @@ fn model_refresh_ticks_preserve_active_scan_and_disable_invalidates_it() {
let model = app.add_model(|ctx| {
CockpitModel::subscribe_to_settings(ctx);
CockpitModel {
raw_snapshot: initial_snapshot(),
snapshot: initial_snapshot(),
refresh_flight: RefreshSingleFlight {
generation: 7,
running: true,
rerun_requested: false,
},
raw_inventory: fold_inventory("laptop", Vec::new(), Vec::new()),
inventory: fold_inventory("laptop", Vec::new(), Vec::new()),
seen_turns: SeenTurns::new(Utc::now()),
local_terminal_links: HashMap::new(),
focused_terminals: HashMap::new(),
daemon_route_cache: HashMap::new(),
managed_fleet: ManagedFleetInventory::default(),
pricing: PricingTable::default(),
oauth_cache: OauthCache::default(),
Expand Down
15 changes: 8 additions & 7 deletions app/src/cockpit/panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ fn project_tree_rows<'a>(
if let [only] = sessions.as_slice() {
let label = merged_label(project_name, titles[0].as_deref());
if let [agent] = only.agents.as_slice() {
let agent: &'a SessionSnapshot = *agent;
let agent: &'a SessionSnapshot = agent;
rows.push(TreeRow {
depth: 1,
kind: TreeRowKind::SessionLeaf {
Expand All @@ -701,7 +701,7 @@ fn project_tree_rows<'a>(
expanded: project_expanded,
count: only.agents.len(),
has_waiting: only.needs_me > 0,
focused: !project_expanded && only.agents.iter().any(|agent| is_focused(*agent)),
focused: !project_expanded && only.agents.iter().any(|agent| is_focused(agent)),
},
});
if project_expanded {
Expand Down Expand Up @@ -731,7 +731,7 @@ fn project_tree_rows<'a>(
&& sessions
.iter()
.flat_map(|session| session.agents.iter())
.any(|agent| is_focused(*agent)),
.any(|agent| is_focused(agent)),
},
});
if !project_expanded {
Expand All @@ -744,7 +744,7 @@ fn project_tree_rows<'a>(
.as_deref()
.map(|title| split_title(title, cuts.next().flatten()));
if let [agent] = session.agents.as_slice() {
let agent: &'a SessionSnapshot = *agent;
let agent: &'a SessionSnapshot = agent;
rows.push(TreeRow {
depth: 2,
kind: TreeRowKind::SessionLeaf {
Expand All @@ -765,7 +765,7 @@ fn project_tree_rows<'a>(
expanded,
count: session.agents.len(),
needs_me: session.needs_me,
focused: !expanded && session.agents.iter().any(|agent| is_focused(*agent)),
focused: !expanded && session.agents.iter().any(|agent| is_focused(agent)),
},
});
if expanded {
Expand Down Expand Up @@ -1623,7 +1623,7 @@ impl CockpitPanel {
.projects
.iter()
.flat_map(|project| project.sessions.iter())
.any(|agent| is_focused(agent));
.any(&is_focused);
let mut host_row = Container::new(self.render_host_header(
host,
&ident,
Expand All @@ -1647,7 +1647,7 @@ impl CockpitPanel {
pkey,
project_expanded,
|key| self.expanded_sessions.get(key).copied().unwrap_or(true),
&is_focused,
is_focused,
);
for row in &rows {
col = col.with_child(self.render_tree_row(
Expand Down Expand Up @@ -1993,6 +1993,7 @@ impl Entity for CockpitPanel {

/// Sidebar actions (routed back into the view by the action system).
#[derive(Clone, Debug)]
#[allow(clippy::enum_variant_names)]
pub enum CockpitPanelAction {
/// Collapse/expand a connected host root. Absent means expanded.
ToggleHost(String),
Expand Down
5 changes: 2 additions & 3 deletions app/src/workspace/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,12 @@ use crate::menu::{
use crate::modal::{Modal, ModalEvent, ModalViewState};
use crate::network::{NetworkStatus, NetworkStatusEvent};
use crate::notebooks::manager::{NotebookManager, NotebookSource};
use crate::pane_group::pane::sftp_pane::SftpPane;
#[cfg(feature = "local_fs")]
use crate::pane_group::FilePane;
use crate::pane_group::ImagePane;
use crate::pane_group::{
self, AnyPaneContent, CodeDiffPane, CodePane, Direction, NewTerminalOptions, PaneContent,
PanesLayout, TabBarHoverIndex,
self, AnyPaneContent, CodeDiffPane, CodePane, Direction, NewTerminalOptions, PanesLayout,
TabBarHoverIndex,
};
use crate::remote_server::manager::RemoteServerManager;
#[cfg(feature = "local_fs")]
Expand Down
Loading