Skip to content

A modern terminal with a built-in multiplexer: close it and your sessions keep running. Run shells and tons of AI agents across your machines, then pick them up from desktop, browser, TUI and more. Written in Rust with no UI framework: interface drawn straight on the GPU. No Electron, GPUI or webview.

Let sidebar folders mix: drag ref groups anywhere among projects

RoversXff77e01c7d94
diff --git a/wezterm-gui/src/termwindow/mod.rs b/wezterm-gui/src/termwindow/mod.rs
index 5cd0cfde..0a959283 100644
--- a/wezterm-gui/src/termwindow/mod.rs
+++ b/wezterm-gui/src/termwindow/mod.rs
@@ -892,6 +892,9 @@ pub(crate) struct SidebarRowDragState {
#[derive(Clone, Debug, PartialEq, Eq)]
pub(crate) enum SidebarRowKind {
Project(String),
+ /// A thread-ref group header, by its RAW group key (no space prefix);
+ /// reorders in the Space's merged folder order alongside projects.
+ RefGroup(String),
Thread {
thread_id: String,
project_id: String,
diff --git a/wezterm-gui/src/termwindow/mouseevent.rs b/wezterm-gui/src/termwindow/mouseevent.rs
index 12489009..04a72a32 100644
--- a/wezterm-gui/src/termwindow/mouseevent.rs
+++ b/wezterm-gui/src/termwindow/mouseevent.rs
@@ -1937,7 +1937,9 @@ impl super::TermWindow {
if completed_drag.as_ref().is_some_and(|(item, _)| {
matches!(
item.item_type,
- UIItemType::Project(_) | UIItemType::WorkspaceThread(_)
+ UIItemType::Project(_)
+ | UIItemType::WorkspaceThread(_)
+ | UIItemType::ThreadRefGroupToggle { .. }
)
}) {
// Release coordinates can differ from the last move
@@ -1963,6 +1965,13 @@ impl super::TermWindow {
&project_id,
);
}
+ super::SidebarRowKind::RefGroup(raw_key) => {
+ let collapse_key =
+ format!("{}::{raw_key}", self.active_space_id);
+ if !self.thread_ref_groups_collapsed.remove(&collapse_key) {
+ self.thread_ref_groups_collapsed.insert(collapse_key);
+ }
+ }
super::SidebarRowKind::Thread { thread_id, .. } => {
if !self.open_remote_workspace_thread_without_connecting(
&thread_id, context,
@@ -2593,7 +2602,9 @@ impl super::TermWindow {
UIItemType::PaneNav { .. } => {
self.drag_pane_nav_tab(item, start_event, event, context);
}
- UIItemType::Project(_) | UIItemType::WorkspaceThread(_) => {
+ UIItemType::Project(_)
+ | UIItemType::WorkspaceThread(_)
+ | UIItemType::ThreadRefGroupToggle { .. } => {
self.drag_sidebar_row(item, start_event, event, context);
}
UIItemType::RightSidebarFileRow(ref path) => {
@@ -2859,7 +2870,9 @@ impl super::TermWindow {
.find(|candidate| candidate.item_type == UIItemType::WorkspaceSidebarBackground)
.is_some_and(|bg| coords.x >= bg.x as isize && coords.x < (bg.x + bg.width) as isize);
let rows: Vec<(String, isize, isize)> = match &kind {
- super::SidebarRowKind::Project(_) => project_block_extents(&self.ui_items),
+ super::SidebarRowKind::Project(_) | super::SidebarRowKind::RefGroup(_) => {
+ folder_block_extents(&self.ui_items, &self.active_space_id)
+ }
super::SidebarRowKind::Thread {
thread_id,
project_id,
@@ -2891,7 +2904,9 @@ impl super::TermWindow {
// has no foreign list to stray into — the whole sidebar is its drop
// zone, so anywhere below the last block simply means "the end".
let within_span = match &kind {
- super::SidebarRowKind::Project(_) => !rows.is_empty(),
+ super::SidebarRowKind::Project(_) | super::SidebarRowKind::RefGroup(_) => {
+ !rows.is_empty()
+ }
super::SidebarRowKind::Thread { .. } => {
rows.first().zip(rows.last()).is_some_and(|(first, last)| {
let slack = (first.2 - first.1).max(0);
@@ -2907,17 +2922,15 @@ impl super::TermWindow {
// scrolled-away tail keeps its place; None remains reserved
// for the true end.
let logical = match &kind {
- super::SidebarRowKind::Project(_) => {
- crate::workspace_threads::ordered_project_ids(&self.active_space_id)
+ super::SidebarRowKind::Project(_) | super::SidebarRowKind::RefGroup(_) => {
+ crate::workspace_threads::ordered_sidebar_folder_keys(&self.active_space_id)
}
super::SidebarRowKind::Thread {
thread_id,
project_id,
} => {
if self.sidebar_row_is_thread_ref(thread_id) {
- crate::workspace_threads::space_thread_refs(
- &self.active_space_id,
- )
+ crate::workspace_threads::space_thread_refs(&self.active_space_id)
} else {
crate::workspace_threads::unpinned_thread_ids(project_id)
}
@@ -2949,10 +2962,25 @@ impl super::TermWindow {
let changed = match &state.kind {
super::SidebarRowKind::Project(project_id) => {
let space_id = self.active_space_id.clone();
- crate::workspace_threads::move_project_before(
+ // Local Spaces order projects and ref groups in one merged
+ // list; move_sidebar_folder_before refuses domain-owned
+ // Spaces, which keep the server-synced project path.
+ crate::workspace_threads::move_sidebar_folder_before(
&space_id,
project_id,
target.before.as_deref(),
+ ) || crate::workspace_threads::move_project_before(
+ &space_id,
+ project_id,
+ target.before.as_deref(),
+ )
+ }
+ super::SidebarRowKind::RefGroup(raw_key) => {
+ let space_id = self.active_space_id.clone();
+ crate::workspace_threads::move_sidebar_folder_before(
+ &space_id,
+ raw_key,
+ target.before.as_deref(),
)
}
super::SidebarRowKind::Thread {
@@ -3414,12 +3442,28 @@ impl super::TermWindow {
UIItemType::ProjectToggleThreads(project_id) => {
self.mouse_event_project_toggle_threads(project_id, event, context);
}
- UIItemType::ThreadRefGroupToggle { key: group_key, .. } => {
+ UIItemType::ThreadRefGroupToggle {
+ key: ref group_key, ..
+ } => {
+ let group_key = group_key.clone();
if let WMEK::Press(MousePress::Left) = event.kind {
- if !self.thread_ref_groups_collapsed.remove(&group_key) {
- self.thread_ref_groups_collapsed.insert(group_key);
- }
- context.invalidate();
+ // Arm a potential folder-reorder drag; the collapse
+ // toggle fires on release when the pointer never crossed
+ // the drag threshold — same contract as project headers.
+ let raw_key = group_key
+ .strip_prefix(&format!("{}::", self.active_space_id))
+ .unwrap_or(&group_key)
+ .to_string();
+ let title =
+ crate::workspace_threads::ref_group_title(&self.active_space_id, &raw_key)
+ .unwrap_or_else(|| raw_key.clone());
+ self.arm_sidebar_row_drag(
+ item,
+ super::SidebarRowKind::RefGroup(raw_key),
+ title,
+ true,
+ event,
+ );
}
context.set_cursor(Some(MouseCursor::Arrow));
}
@@ -3918,12 +3962,28 @@ impl super::TermWindow {
UIItemType::ProjectToggleThreads(project_id) => {
self.mouse_event_project_toggle_threads(project_id, event, context);
}
- UIItemType::ThreadRefGroupToggle { key: group_key, .. } => {
+ UIItemType::ThreadRefGroupToggle {
+ key: ref group_key, ..
+ } => {
+ let group_key = group_key.clone();
if let WMEK::Press(MousePress::Left) = event.kind {
- if !self.thread_ref_groups_collapsed.remove(&group_key) {
- self.thread_ref_groups_collapsed.insert(group_key);
- }
- context.invalidate();
+ // Arm a potential folder-reorder drag; the collapse
+ // toggle fires on release when the pointer never crossed
+ // the drag threshold — same contract as project headers.
+ let raw_key = group_key
+ .strip_prefix(&format!("{}::", self.active_space_id))
+ .unwrap_or(&group_key)
+ .to_string();
+ let title =
+ crate::workspace_threads::ref_group_title(&self.active_space_id, &raw_key)
+ .unwrap_or_else(|| raw_key.clone());
+ self.arm_sidebar_row_drag(
+ item,
+ super::SidebarRowKind::RefGroup(raw_key),
+ title,
+ true,
+ event,
+ );
}
context.set_cursor(Some(MouseCursor::Arrow));
}
@@ -8044,14 +8104,28 @@ fn kill_workspace_windows(workspaces: &[String], skip_workspace: Option<&str>) {
/// instead of between X's header and its threads. Relies on the sidebar
/// pushing items in visual order: each Project row followed by its rows,
/// with the cross-project pinned section preceding the first Project.
-pub(crate) fn project_block_extents(items: &[UIItem]) -> Vec<(String, isize, isize)> {
+pub(crate) fn folder_block_extents(
+ items: &[UIItem],
+ space_id: &str,
+) -> Vec<(String, isize, isize)> {
+ let collapse_prefix = format!("{space_id}::");
let mut blocks: Vec<(String, isize, isize)> = vec![];
for item in items {
match &item.item_type {
UIItemType::Project(id) => {
blocks.push((id.clone(), item.y as isize, (item.y + item.height) as isize))
}
- UIItemType::WorkspaceThread(_) | UIItemType::WorkspaceThreadNew(_) => {
+ UIItemType::ThreadRefGroupToggle { key, .. } => {
+ let raw = key.strip_prefix(&collapse_prefix).unwrap_or(key.as_str());
+ blocks.push((
+ raw.to_string(),
+ item.y as isize,
+ (item.y + item.height) as isize,
+ ))
+ }
+ UIItemType::WorkspaceThread(_)
+ | UIItemType::WorkspaceThreadNew(_)
+ | UIItemType::ThreadRefGroupNewThread(_) => {
if let Some(block) = blocks.last_mut() {
block.2 = block.2.max((item.y + item.height) as isize);
}
@@ -8102,7 +8176,7 @@ pub(crate) fn sidebar_insert_position(
#[cfg(test)]
mod sidebar_drag_tests {
use super::{
- clamp_end_anchor_to_next_logical_sibling, project_block_extents, sidebar_insert_position,
+ clamp_end_anchor_to_next_logical_sibling, folder_block_extents, sidebar_insert_position,
};
use crate::termwindow::{UIItem, UIItemType};
@@ -8162,7 +8236,7 @@ mod sidebar_drag_tests {
item(UIItemType::WorkspaceSidebarBackground, 0, 600),
];
assert_eq!(
- project_block_extents(&items),
+ folder_block_extents(&items, "space-x"),
vec![
("alpha".to_string(), 100, 168),
("beta".to_string(), 176, 196),
@@ -8170,11 +8244,40 @@ mod sidebar_drag_tests {
);
// Below beta: the end, with the line under the last block.
assert_eq!(
- sidebar_insert_position(&project_block_extents(&items), 500),
+ sidebar_insert_position(&folder_block_extents(&items, "space-x"), 500),
Some((None, 196))
);
}
+ /// A ref-group header opens a block exactly like a project header, its
+ /// key stripped of the collapse-state space prefix; the group's thread
+ /// rows and "+" extend the block just like a project's do.
+ #[test]
+ fn a_ref_group_block_interleaves_with_project_blocks() {
+ let items = vec![
+ item(UIItemType::Project("alpha".into()), 100, 20),
+ item(UIItemType::WorkspaceThread("a1".into()), 124, 20),
+ item(
+ UIItemType::ThreadRefGroupToggle {
+ key: "space-x::origin-project".into(),
+ origin: String::new(),
+ },
+ 176,
+ 20,
+ ),
+ item(UIItemType::WorkspaceThread("r1".into()), 200, 20),
+ item(UIItemType::Project("beta".into()), 252, 20),
+ ];
+ assert_eq!(
+ folder_block_extents(&items, "space-x"),
+ vec![
+ ("alpha".to_string(), 100, 144),
+ ("origin-project".to_string(), 176, 220),
+ ("beta".to_string(), 252, 272),
+ ]
+ );
+ }
+
#[test]
fn a_pointer_picks_the_gap_nearest_to_it() {
// Above everything and in the first row's upper half: before "a".
diff --git a/wezterm-gui/src/termwindow/ui/sidebar.rs b/wezterm-gui/src/termwindow/ui/sidebar.rs
index e74c9b6e..d9d95f6a 100644
--- a/wezterm-gui/src/termwindow/ui/sidebar.rs
+++ b/wezterm-gui/src/termwindow/ui/sidebar.rs
@@ -352,37 +352,41 @@ impl crate::TermWindow {
.saturating_mul(row_height + row_gap),
);
}
+ // The "Workspaces" section label row precedes the folder list only
+ // when the Space has projects of its own (a refs-only Space renders
+ // just its ref folders).
if !view.projects.is_empty() {
if !view.pinned_threads.is_empty() {
height = height.saturating_add(section_gap);
}
height = height.saturating_add(row_height + row_gap);
}
- for project in &view.projects {
- height = height.saturating_add(row_height + row_gap);
- if !project.threads_collapsed {
- height = height
- .saturating_add(project.threads.len().saturating_mul(row_height + row_gap));
- }
- }
- height = height.saturating_add(
- view.projects
- .len()
- .saturating_sub(1)
- .saturating_mul(group_gap),
- );
- if !view.ref_groups.is_empty() {
- if !view.pinned_threads.is_empty() || !view.projects.is_empty() {
+ // Folders — projects and ref groups interleaved — walk the SAME
+ // display order the paint loop walks, or scroll math diverges from
+ // the painted rows.
+ for (folder_idx, folder) in view.display_order.iter().enumerate() {
+ if folder_idx > 0 {
height = height.saturating_add(group_gap);
}
- for (group_idx, group) in view.ref_groups.iter().enumerate() {
- if group_idx > 0 {
- height = height.saturating_add(group_gap);
+ height = height.saturating_add(row_height + row_gap);
+ match folder {
+ workspace_threads::SidebarFolder::Project(index) => {
+ if let Some(project) = view.projects.get(*index) {
+ if !project.threads_collapsed {
+ height = height.saturating_add(
+ project.threads.len().saturating_mul(row_height + row_gap),
+ );
+ }
+ }
}
- height = height.saturating_add(row_height + row_gap);
- if !group.collapsed {
- height = height
- .saturating_add(group.threads.len().saturating_mul(row_height + row_gap));
+ workspace_threads::SidebarFolder::RefGroup(index) => {
+ if let Some(group) = view.ref_groups.get(*index) {
+ if !group.collapsed {
+ height = height.saturating_add(
+ group.threads.len().saturating_mul(row_height + row_gap),
+ );
+ }
+ }
}
}
}
@@ -1892,237 +1896,200 @@ impl crate::TermWindow {
virtual_y += session_row_height + row_gap;
}
- for (project_idx, project) in view.projects.iter().enumerate() {
- let row_top = list_top_f + virtual_y as f32 - scroll_offset;
- let row_bottom = row_top + session_row_height as f32;
- let row_is_visible = row_bottom > list_top_f && row_top < content_bottom_f;
- let y = row_top.floor().max(0.0) as usize;
- let hit_y = row_top.max(list_top_f).floor().max(0.0) as usize;
- let hit_bottom = row_bottom.min(content_bottom_f).ceil().max(hit_y as f32) as usize;
- let hit_height = hit_bottom.saturating_sub(hit_y).max(1);
-
- let disclosure_size = icon_size.min(22);
- let disclosure_x = item_x + self.ui_px(SIDEBAR_INSET);
- let project_icon_x = disclosure_x + disclosure_size + 4;
- let project_text_x = project_icon_x + icon_size + self.ui_px(SIDEBAR_ICON_GAP);
- let project_action_size = section_button_size.min(session_row_height.saturating_sub(8));
- let project_action_x = item_x
- .saturating_add(item_width)
- .saturating_sub(project_action_size + self.ui_px(SIDEBAR_INSET));
- let project_text_right = project_action_x;
-
- if row_is_visible {
- self.ui_items.push(UIItem {
- x: item_x,
- y: hit_y,
- width: item_width,
- height: hit_height,
- item_type: UIItemType::Project(project.id.clone()),
- });
+ // Folders — projects and thread-ref groups — render interleaved in
+ // the Space's display order, so a ref folder can sit anywhere among
+ // the local ones. The height calc walks the same order.
+ let group_space_id = self.workspace_sidebar_space_id().to_string();
+ for (folder_idx, folder) in view.display_order.iter().enumerate() {
+ if folder_idx > 0 {
+ virtual_y += self.ui_px(WORKSPACE_GROUP_EXTRA_GAP);
}
-
- let icon_y = y + ((session_row_height.saturating_sub(icon_size)) / 2);
- let disclosure_y = y + ((session_row_height.saturating_sub(disclosure_size)) / 2);
- let text_y = y + ((session_row_height.saturating_sub(ui_cell_height)) / 2);
- if row_is_visible {
- self.ui_items.push(UIItem {
- x: disclosure_x,
- y: disclosure_y,
- width: disclosure_size,
- height: disclosure_size,
- item_type: UIItemType::ProjectToggleThreads(project.id.clone()),
- });
- self.paint_sidebar_icon(
- layers,
- if project.threads_collapsed {
- SvgIcon::ChevronRight
- } else {
- SvgIcon::ChevronDown
- },
- disclosure_x,
- disclosure_y,
- disclosure_size,
- muted_fg,
- )?;
- let remote_brand = if project.is_remote {
- project.distro.as_deref().and_then(distro_to_icon)
- } else {
- None
+ if let workspace_threads::SidebarFolder::Project(folder_project_index) = folder {
+ let Some(project) = view.projects.get(*folder_project_index) else {
+ continue;
};
- if let Some(brand) = remote_brand {
- // Detected remote OS: show its brand logo in full color.
- self.paint_sidebar_brand_icon(
+ let row_top = list_top_f + virtual_y as f32 - scroll_offset;
+ let row_bottom = row_top + session_row_height as f32;
+ let row_is_visible = row_bottom > list_top_f && row_top < content_bottom_f;
+ let y = row_top.floor().max(0.0) as usize;
+ let hit_y = row_top.max(list_top_f).floor().max(0.0) as usize;
+ let hit_bottom = row_bottom.min(content_bottom_f).ceil().max(hit_y as f32) as usize;
+ let hit_height = hit_bottom.saturating_sub(hit_y).max(1);
+
+ let disclosure_size = icon_size.min(22);
+ let disclosure_x = item_x + self.ui_px(SIDEBAR_INSET);
+ let project_icon_x = disclosure_x + disclosure_size + 4;
+ let project_text_x = project_icon_x + icon_size + self.ui_px(SIDEBAR_ICON_GAP);
+ let project_action_size =
+ section_button_size.min(session_row_height.saturating_sub(8));
+ let project_action_x = item_x
+ .saturating_add(item_width)
+ .saturating_sub(project_action_size + self.ui_px(SIDEBAR_INSET));
+ let project_text_right = project_action_x;
+
+ if row_is_visible {
+ self.ui_items.push(UIItem {
+ x: item_x,
+ y: hit_y,
+ width: item_width,
+ height: hit_height,
+ item_type: UIItemType::Project(project.id.clone()),
+ });
+ }
+
+ let icon_y = y + ((session_row_height.saturating_sub(icon_size)) / 2);
+ let disclosure_y = y + ((session_row_height.saturating_sub(disclosure_size)) / 2);
+ let text_y = y + ((session_row_height.saturating_sub(ui_cell_height)) / 2);
+ if row_is_visible {
+ self.ui_items.push(UIItem {
+ x: disclosure_x,
+ y: disclosure_y,
+ width: disclosure_size,
+ height: disclosure_size,
+ item_type: UIItemType::ProjectToggleThreads(project.id.clone()),
+ });
+ self.paint_sidebar_icon(
layers,
- brand,
- project_icon_x,
- icon_y,
- icon_size,
+ if project.threads_collapsed {
+ SvgIcon::ChevronRight
+ } else {
+ SvgIcon::ChevronDown
+ },
+ disclosure_x,
+ disclosure_y,
+ disclosure_size,
+ muted_fg,
)?;
- } else {
- let project_icon = if project.is_remote {
- // Remote host without a detected OS: a globe marks it as
- // distinct from local folder projects in the mixed list.
- SvgIcon::Globe
- } else if project.threads_collapsed {
- SvgIcon::Folder
+ let remote_brand = if project.is_remote {
+ project.distro.as_deref().and_then(distro_to_icon)
} else {
- SvgIcon::FolderOpen
+ None
};
- self.paint_sidebar_icon(
+ if let Some(brand) = remote_brand {
+ // Detected remote OS: show its brand logo in full color.
+ self.paint_sidebar_brand_icon(
+ layers,
+ brand,
+ project_icon_x,
+ icon_y,
+ icon_size,
+ )?;
+ } else {
+ let project_icon = if project.is_remote {
+ // Remote host without a detected OS: a globe marks it as
+ // distinct from local folder projects in the mixed list.
+ SvgIcon::Globe
+ } else if project.threads_collapsed {
+ SvgIcon::Folder
+ } else {
+ SvgIcon::FolderOpen
+ };
+ self.paint_sidebar_icon(
+ layers,
+ project_icon,
+ project_icon_x,
+ icon_y,
+ icon_size,
+ muted_fg,
+ )?;
+ }
+ let project_title = self.sidebar_project_title(&project.id, &project.name);
+ self.paint_sidebar_text(
layers,
- project_icon,
- project_icon_x,
- icon_y,
- icon_size,
+ &ui_font,
+ ui_metrics,
+ &project_title,
+ project_text_x,
+ text_y,
+ project_text_right
+ .saturating_sub(project_text_x + self.ui_px(SIDEBAR_INSET)),
muted_fg,
)?;
}
- let project_title = self.sidebar_project_title(&project.id, &project.name);
- self.paint_sidebar_text(
- layers,
- &ui_font,
- ui_metrics,
- &project_title,
- project_text_x,
- text_y,
- project_text_right.saturating_sub(project_text_x + self.ui_px(SIDEBAR_INSET)),
- muted_fg,
- )?;
- }
- if row_is_visible {
- let project_action_y =
- y + ((session_row_height.saturating_sub(project_action_size)) / 2);
- let project_action_hovered = !suppress_hover
- && self.is_pointer_over_ui_rect(
- project_action_x,
- project_action_y,
- project_action_size,
- project_action_size,
+ if row_is_visible {
+ let project_action_y =
+ y + ((session_row_height.saturating_sub(project_action_size)) / 2);
+ let project_action_hovered = !suppress_hover
+ && self.is_pointer_over_ui_rect(
+ project_action_x,
+ project_action_y,
+ project_action_size,
+ project_action_size,
+ );
+ self.fill_rounded_rectangle(
+ layers,
+ 1,
+ euclid::rect(
+ project_action_x as f32,
+ project_action_y as f32,
+ project_action_size as f32,
+ project_action_size as f32,
+ ),
+ if project_action_hovered {
+ chrome.sidebar_button_hover_bg
+ } else {
+ chrome.sidebar_button_bg
+ },
+ self.ui_f32(SIDEBAR_ROW_RADIUS),
+ )
+ .context("sidebar new thread button")?;
+ self.ui_items.push(UIItem {
+ x: project_action_x,
+ y: project_action_y,
+ width: project_action_size,
+ height: project_action_size,
+ item_type: UIItemType::WorkspaceThreadNew(project.id.clone()),
+ });
+ let action_icon_size = (header_icon_size + 4).min(
+ project_action_size
+ .saturating_sub(self.ui_px(SIDEBAR_SECTION_ACTION_ICON_INSET)),
);
- self.fill_rounded_rectangle(
- layers,
- 1,
- euclid::rect(
- project_action_x as f32,
- project_action_y as f32,
- project_action_size as f32,
- project_action_size as f32,
- ),
- if project_action_hovered {
- chrome.sidebar_button_hover_bg
- } else {
- chrome.sidebar_button_bg
- },
- self.ui_f32(SIDEBAR_ROW_RADIUS),
- )
- .context("sidebar new thread button")?;
- self.ui_items.push(UIItem {
- x: project_action_x,
- y: project_action_y,
- width: project_action_size,
- height: project_action_size,
- item_type: UIItemType::WorkspaceThreadNew(project.id.clone()),
- });
- let action_icon_size = (header_icon_size + 4).min(
- project_action_size
- .saturating_sub(self.ui_px(SIDEBAR_SECTION_ACTION_ICON_INSET)),
- );
- self.paint_sidebar_icon(
- layers,
- SvgIcon::Plus,
- project_action_x + ((project_action_size.saturating_sub(action_icon_size)) / 2),
- project_action_y + ((project_action_size.saturating_sub(action_icon_size)) / 2),
- action_icon_size,
- if project.is_active || project_action_hovered {
- foreground
- } else {
- muted_fg
- },
- )?;
- }
-
- virtual_y += session_row_height + row_gap;
-
- if !project.threads_collapsed {
- let session_x =
- item_x + self.ui_px(SIDEBAR_INSET) * 3 + self.ui_px(SESSION_ROW_SIDE_PADDING);
- let session_width = item_width.saturating_sub(
- self.ui_px(SIDEBAR_INSET) * 3 + self.ui_px(SESSION_ROW_SIDE_PADDING) * 2,
- );
- let session_status_x = session_x + self.ui_px(SIDEBAR_INSET) + 2;
- let session_text_x = session_status_x
- + self.ui_px(SESSION_STATUS_ICON_SIZE)
- + self.ui_px(SIDEBAR_ICON_GAP)
- + 6;
-
- for session in &project.threads {
- let row_top = list_top_f + virtual_y as f32 - scroll_offset;
- let row_bottom = row_top + session_row_height as f32;
- let row_is_visible = row_bottom > list_top_f && row_top < content_bottom_f;
- let y = row_top.floor().max(0.0) as usize;
- let hit_y = row_top.max(list_top_f).floor().max(0.0) as usize;
- let hit_bottom =
- row_bottom.min(content_bottom_f).ceil().max(hit_y as f32) as usize;
- let hit_height = hit_bottom.saturating_sub(hit_y).max(1);
+ self.paint_sidebar_icon(
+ layers,
+ SvgIcon::Plus,
+ project_action_x
+ + ((project_action_size.saturating_sub(action_icon_size)) / 2),
+ project_action_y
+ + ((project_action_size.saturating_sub(action_icon_size)) / 2),
+ action_icon_size,
+ if project.is_active || project_action_hovered {
+ foreground
+ } else {
+ muted_fg
+ },
+ )?;
+ }
- let is_selected =
- self.is_workspace_sidebar_thread_selected(session, suppress_own_active);
- if row_is_visible && is_selected {
- self.fill_rounded_rectangle_with_border(
- layers,
- 0,
- euclid::rect(
- session_x as f32,
- y as f32,
- session_width as f32,
- session_row_height as f32,
- ),
- selected_bg,
- selected_border,
- self.ui_f32(SIDEBAR_ROW_RADIUS) + 2.0,
- CAPSULE_BORDER_WIDTH,
- )
- .context("sidebar selected thread")?;
- }
+ virtual_y += session_row_height + row_gap;
- let text_y = y + ((session_row_height.saturating_sub(ui_cell_height)) / 2);
- if row_is_visible {
- self.ui_items.push(UIItem {
- x: session_x,
- y: hit_y,
- width: session_width,
- height: hit_height,
- item_type: UIItemType::WorkspaceThread(session.id.clone()),
- });
- let is_hovered = !suppress_hover
- && self.is_pointer_over_ui_rect(
- session_x,
- y,
- session_width,
- session_row_height,
- );
- let is_renaming_session = self.is_renaming_sidebar_thread(&session.id);
- let action_size = session_row_height.saturating_sub(8).clamp(
- self.ui_px(SESSION_ACTION_MIN_SIZE),
- self.ui_px(SESSION_ACTION_MAX_SIZE),
- );
- let delete_x = session_x
- .saturating_add(session_width)
- .saturating_sub(self.ui_px(SIDEBAR_INSET) + action_size);
- let pin_x = delete_x.saturating_sub(action_size + 4);
- let action_y = y + ((session_row_height.saturating_sub(action_size)) / 2);
- let text_right = if is_hovered && !is_renaming_session {
- pin_x
- } else {
- session_x
- .saturating_add(session_width)
- .saturating_sub(self.ui_px(SIDEBAR_INSET))
- };
- let text_width =
- text_right.saturating_sub(session_text_x + self.ui_px(SIDEBAR_INSET));
- if is_hovered && !is_selected && !is_renaming_session {
- self.fill_rounded_rectangle(
+ if !project.threads_collapsed {
+ let session_x = item_x
+ + self.ui_px(SIDEBAR_INSET) * 3
+ + self.ui_px(SESSION_ROW_SIDE_PADDING);
+ let session_width = item_width.saturating_sub(
+ self.ui_px(SIDEBAR_INSET) * 3 + self.ui_px(SESSION_ROW_SIDE_PADDING) * 2,
+ );
+ let session_status_x = session_x + self.ui_px(SIDEBAR_INSET) + 2;
+ let session_text_x = session_status_x
+ + self.ui_px(SESSION_STATUS_ICON_SIZE)
+ + self.ui_px(SIDEBAR_ICON_GAP)
+ + 6;
+
+ for session in &project.threads {
+ let row_top = list_top_f + virtual_y as f32 - scroll_offset;
+ let row_bottom = row_top + session_row_height as f32;
+ let row_is_visible = row_bottom > list_top_f && row_top < content_bottom_f;
+ let y = row_top.floor().max(0.0) as usize;
+ let hit_y = row_top.max(list_top_f).floor().max(0.0) as usize;
+ let hit_bottom =
+ row_bottom.min(content_bottom_f).ceil().max(hit_y as f32) as usize;
+ let hit_height = hit_bottom.saturating_sub(hit_y).max(1);
+
+ let is_selected =
+ self.is_workspace_sidebar_thread_selected(session, suppress_own_active);
+ if row_is_visible && is_selected {
+ self.fill_rounded_rectangle_with_border(
layers,
0,
euclid::rect(
@@ -2131,106 +2098,153 @@ impl crate::TermWindow {
session_width as f32,
session_row_height as f32,
),
- chrome.sidebar_row_hover_bg,
+ selected_bg,
+ selected_border,
self.ui_f32(SIDEBAR_ROW_RADIUS) + 2.0,
+ CAPSULE_BORDER_WIDTH,
)
- .context("sidebar hovered thread")?;
+ .context("sidebar selected thread")?;
}
- self.paint_sidebar_thread_status(
- layers,
- session,
- session_status_x,
- y,
- session_row_height,
- &chrome,
- foreground,
- suppress_own_active,
- )?;
- let session_title = self.sidebar_thread_title(&session.id, &session.name);
- self.paint_sidebar_text(
- layers,
- &ui_font,
- ui_metrics,
- &session_title,
- session_text_x,
- text_y,
- text_width,
- if is_selected { active_fg } else { foreground },
- )?;
- if is_hovered && !is_renaming_session {
- let pin_icon = if session.is_pinned {
- SvgIcon::PinOff
+
+ let text_y = y + ((session_row_height.saturating_sub(ui_cell_height)) / 2);
+ if row_is_visible {
+ self.ui_items.push(UIItem {
+ x: session_x,
+ y: hit_y,
+ width: session_width,
+ height: hit_height,
+ item_type: UIItemType::WorkspaceThread(session.id.clone()),
+ });
+ let is_hovered = !suppress_hover
+ && self.is_pointer_over_ui_rect(
+ session_x,
+ y,
+ session_width,
+ session_row_height,
+ );
+ let is_renaming_session = self.is_renaming_sidebar_thread(&session.id);
+ let action_size = session_row_height.saturating_sub(8).clamp(
+ self.ui_px(SESSION_ACTION_MIN_SIZE),
+ self.ui_px(SESSION_ACTION_MAX_SIZE),
+ );
+ let delete_x = session_x
+ .saturating_add(session_width)
+ .saturating_sub(self.ui_px(SIDEBAR_INSET) + action_size);
+ let pin_x = delete_x.saturating_sub(action_size + 4);
+ let action_y =
+ y + ((session_row_height.saturating_sub(action_size)) / 2);
+ let text_right = if is_hovered && !is_renaming_session {
+ pin_x
} else {
- SvgIcon::Pin
+ session_x
+ .saturating_add(session_width)
+ .saturating_sub(self.ui_px(SIDEBAR_INSET))
};
- for (x, item_type, icon, _context_name) in [
- (
- pin_x,
- UIItemType::WorkspaceThreadPin(session.id.clone()),
- pin_icon,
- "sidebar pin thread button",
- ),
- (
- delete_x,
- UIItemType::WorkspaceThreadDelete(session.id.clone()),
- SvgIcon::Trash2,
- "sidebar delete thread button",
- ),
- ] {
- let hovered = self.is_pointer_over_ui_rect(
- x,
- action_y,
- action_size,
- action_size,
- );
- self.ui_items.push(UIItem {
- x,
- y: action_y,
- width: action_size,
- height: action_size,
- item_type,
- });
- let action_icon_size = action_size
- .saturating_sub(self.ui_px(SESSION_ACTION_ICON_INSET))
- .max(header_icon_size);
- self.paint_sidebar_icon(
+ let text_width = text_right
+ .saturating_sub(session_text_x + self.ui_px(SIDEBAR_INSET));
+ if is_hovered && !is_selected && !is_renaming_session {
+ self.fill_rounded_rectangle(
layers,
- icon,
- x + ((action_size.saturating_sub(action_icon_size)) / 2),
- action_y + ((action_size.saturating_sub(action_icon_size)) / 2),
- action_icon_size,
- if hovered {
- foreground
- } else {
- muted_fg.mul_alpha(0.88)
- },
- )?;
+ 0,
+ euclid::rect(
+ session_x as f32,
+ y as f32,
+ session_width as f32,
+ session_row_height as f32,
+ ),
+ chrome.sidebar_row_hover_bg,
+ self.ui_f32(SIDEBAR_ROW_RADIUS) + 2.0,
+ )
+ .context("sidebar hovered thread")?;
+ }
+ self.paint_sidebar_thread_status(
+ layers,
+ session,
+ session_status_x,
+ y,
+ session_row_height,
+ &chrome,
+ foreground,
+ suppress_own_active,
+ )?;
+ let session_title =
+ self.sidebar_thread_title(&session.id, &session.name);
+ self.paint_sidebar_text(
+ layers,
+ &ui_font,
+ ui_metrics,
+ &session_title,
+ session_text_x,
+ text_y,
+ text_width,
+ if is_selected { active_fg } else { foreground },
+ )?;
+ if is_hovered && !is_renaming_session {
+ let pin_icon = if session.is_pinned {
+ SvgIcon::PinOff
+ } else {
+ SvgIcon::Pin
+ };
+ for (x, item_type, icon, _context_name) in [
+ (
+ pin_x,
+ UIItemType::WorkspaceThreadPin(session.id.clone()),
+ pin_icon,
+ "sidebar pin thread button",
+ ),
+ (
+ delete_x,
+ UIItemType::WorkspaceThreadDelete(session.id.clone()),
+ SvgIcon::Trash2,
+ "sidebar delete thread button",
+ ),
+ ] {
+ let hovered = self.is_pointer_over_ui_rect(
+ x,
+ action_y,
+ action_size,
+ action_size,
+ );
+ self.ui_items.push(UIItem {
+ x,
+ y: action_y,
+ width: action_size,
+ height: action_size,
+ item_type,
+ });
+ let action_icon_size = action_size
+ .saturating_sub(self.ui_px(SESSION_ACTION_ICON_INSET))
+ .max(header_icon_size);
+ self.paint_sidebar_icon(
+ layers,
+ icon,
+ x + ((action_size.saturating_sub(action_icon_size)) / 2),
+ action_y
+ + ((action_size.saturating_sub(action_icon_size)) / 2),
+ action_icon_size,
+ if hovered {
+ foreground
+ } else {
+ muted_fg.mul_alpha(0.88)
+ },
+ )?;
+ }
}
}
- }
- virtual_y += session_row_height + row_gap;
+ virtual_y += session_row_height + row_gap;
+ }
}
}
- if project_idx + 1 < view.projects.len() {
- virtual_y += self.ui_px(WORKSPACE_GROUP_EXTRA_GAP);
- }
- }
-
- if !view.ref_groups.is_empty() {
- if !view.pinned_threads.is_empty() || !view.projects.is_empty() {
- virtual_y += self.ui_px(WORKSPACE_GROUP_EXTRA_GAP);
- }
// Reference groups render exactly like project folders: chevron,
- // machine icon, machine name, then indented thread rows. The
+ // link icon, origin-project name, then indented thread rows. The
// link icon in the header is what tells a reference group apart
- // from a real project group with the same machine name.
- let group_space_id = self.workspace_sidebar_space_id().to_string();
- for (group_idx, group) in view.ref_groups.iter().enumerate() {
- if group_idx > 0 {
- virtual_y += self.ui_px(WORKSPACE_GROUP_EXTRA_GAP);
- }
+ // from a local project folder with the same name.
+ if let workspace_threads::SidebarFolder::RefGroup(folder_group_index) = folder {
+ let Some(group) = view.ref_groups.get(*folder_group_index) else {
+ continue;
+ };
let row_top = list_top_f + virtual_y as f32 - scroll_offset;
let row_bottom = row_top + session_row_height as f32;
let row_is_visible = row_bottom > list_top_f && row_top < content_bottom_f;
@@ -2269,7 +2283,12 @@ impl crate::TermWindow {
String::new()
} else if group.machine_is_local {
group.origin_space_name.clone()
- } else if group.origin_space_name.is_empty() {
+ } else if group.origin_space_name.is_empty()
+ // A remote Space often carries its host's name (the
+ // default for single-Space servers); "X · X" says
+ // nothing twice.
+ || group.origin_space_name == group.machine_label
+ {
group.machine_label.clone()
} else {
format!("{} · {}", group.machine_label, group.origin_space_name)
diff --git a/wezterm-gui/src/workspace_threads.rs b/wezterm-gui/src/workspace_threads.rs
index 51867633..79f733db 100644
--- a/wezterm-gui/src/workspace_threads.rs
+++ b/wezterm-gui/src/workspace_threads.rs
@@ -94,6 +94,14 @@ pub struct Space {
/// threads, so the restore follows whatever was used last.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub active_thread_ref: Option<String>,
+ /// Sidebar display order of this Space's folders — local project ids and
+ /// thread-ref group keys, interleaved freely. Empty (the migration
+ /// default) means the classic order: projects first, then ref groups.
+ /// Folders not listed here append after the listed ones in classic
+ /// order; keys of folders that no longer exist are ignored, so the list
+ /// needs no grooming. Local-only, like the refs themselves.
+ #[serde(default, skip_serializing_if = "Vec::is_empty")]
+ pub folder_order: Vec<String>,
}
/// Cached display data for one thread ref, refreshed on every successful
@@ -204,9 +212,68 @@ pub struct WorkspaceThreadsView {
/// Thread references this Space holds, grouped by origin project so the
/// sidebar can render them as folder-style groups just like projects.
pub ref_groups: Vec<ThreadRefGroupView>,
+ /// The order the sidebar renders the folders above in — indices into
+ /// `projects` and `ref_groups`, interleaved per the Space's
+ /// `folder_order`. Paint, list-height, and hit-test row math must all
+ /// walk THIS, never the two Vecs directly, or their rows diverge.
+ pub display_order: Vec<SidebarFolder>,
+}
+
+/// One sidebar folder in display order: a local project or a thread-ref
+/// group, by index into the view's respective Vec.
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub enum SidebarFolder {
+ Project(usize),
+ RefGroup(usize),
+}
+
+/// Interleave projects and ref groups per `folder_order`: listed keys first,
+/// in list order; everything unlisted appends after in classic order
+/// (projects, then groups — which is exactly the whole result when the list
+/// is empty, i.e. the migration default). Unknown keys are skipped.
+fn merged_display_order(
+ folder_order: &[String],
+ project_keys: &[&str],
+ group_keys: &[&str],
+) -> Vec<SidebarFolder> {
+ let mut entries: Vec<(&str, SidebarFolder)> = project_keys
+ .iter()
+ .enumerate()
+ .map(|(index, key)| (*key, SidebarFolder::Project(index)))
+ .chain(
+ group_keys
+ .iter()
+ .enumerate()
+ .map(|(index, key)| (*key, SidebarFolder::RefGroup(index))),
+ )
+ .collect();
+ entries.sort_by_key(|(key, _)| {
+ folder_order
+ .iter()
+ .position(|ordered| ordered == key)
+ .map_or((1, 0), |position| (0, position))
+ });
+ entries.into_iter().map(|(_, folder)| folder).collect()
}
impl WorkspaceThreadsView {
+ /// Recompute `display_order` from the current `projects`/`ref_groups`
+ /// against the Space's persisted folder order. Must run after either
+ /// Vec changes.
+ pub fn rebuild_display_order(&mut self, folder_order: &[String]) {
+ let project_keys: Vec<&str> = self
+ .projects
+ .iter()
+ .map(|project| project.id.as_str())
+ .collect();
+ let group_keys: Vec<&str> = self
+ .ref_groups
+ .iter()
+ .map(|group| group.key.as_str())
+ .collect();
+ self.display_order = merged_display_order(folder_order, &project_keys, &group_keys);
+ }
+
/// True when the workspace on screen is one of this Space's thread
/// references. Activating a ref never repoints the Space's own
/// active-thread pointer, so while this holds, the own rows' `is_active`
@@ -1702,6 +1769,12 @@ pub fn view_for_current_project(
live_workspaces,
Some(active_workspace),
));
+ let folder_order = store
+ .spaces
+ .iter()
+ .find(|space| space.id == space_id)
+ .map(|space| space.folder_order.clone())
+ .unwrap_or_default();
// A Space with refs but no projects of its own (a migrated collection)
// must not be seeded with a synthetic current project just to have
// something to show — its ref rows are the content.
@@ -1710,11 +1783,14 @@ pub fn view_for_current_project(
.iter()
.any(|project| project.space_id == space_id);
if !has_own_projects && !ref_groups.is_empty() {
- return WorkspaceThreadsView {
+ let mut view = WorkspaceThreadsView {
pinned_threads: Vec::new(),
projects: Vec::new(),
ref_groups,
+ display_order: Vec::new(),
};
+ view.rebuild_display_order(&folder_order);
+ return view;
}
if let Some(project_id) = store
.project_id_for_workspace(space_id, active_workspace)
@@ -1728,6 +1804,7 @@ pub fn view_for_current_project(
{
let mut view = store.view_for_project(space_id, &project_id, live_workspaces);
view.ref_groups = ref_groups;
+ view.rebuild_display_order(&folder_order);
return view;
}
@@ -1735,6 +1812,7 @@ pub fn view_for_current_project(
let mut view =
current_project_for_workspace(space_id, active_workspace).view(live_workspaces, is_remote);
view.ref_groups = ref_groups;
+ view.rebuild_display_order(&folder_order);
view
}
@@ -3572,6 +3650,140 @@ fn submit_thread_state(store: &WorkspaceThreadStore, thread_id: &str) {
);
}
+/// A ref group's display label (its origin project's name, or the machine
+/// for a dangling group) — the drag ghost shows it while the group header
+/// is being reordered.
+pub fn ref_group_title(host_space_id: &str, group_key: &str) -> Option<String> {
+ let store = THREAD_STORE.lock();
+ group_thread_refs_by_origin(store.view_for_thread_refs(host_space_id, &[], None))
+ .into_iter()
+ .find(|group| group.key == group_key)
+ .map(|group| group.label)
+}
+
+/// The sidebar's merged folder-key order for a Space — local project ids
+/// and ref-group keys, exactly as displayed. Feeds drag targeting (the
+/// logical-order end anchor) and reordering.
+pub fn ordered_sidebar_folder_keys(space_id: &str) -> Vec<String> {
+ let store = THREAD_STORE.lock();
+ ordered_folder_keys_locked(&store, space_id)
+}
+
+fn ordered_folder_keys_locked(store: &WorkspaceThreadStore, space_id: &str) -> Vec<String> {
+ let project_keys: Vec<String> = store
+ .projects
+ .iter()
+ .filter(|project| project.space_id == space_id)
+ .map(|project| project.id.clone())
+ .collect();
+ let group_keys: Vec<String> =
+ group_thread_refs_by_origin(store.view_for_thread_refs(space_id, &[], None))
+ .into_iter()
+ .map(|group| group.key)
+ .collect();
+ let folder_order = store
+ .spaces
+ .iter()
+ .find(|space| space.id == space_id)
+ .map(|space| space.folder_order.as_slice())
+ .unwrap_or(&[]);
+ let project_refs: Vec<&str> = project_keys.iter().map(String::as_str).collect();
+ let group_refs: Vec<&str> = group_keys.iter().map(String::as_str).collect();
+ merged_display_order(folder_order, &project_refs, &group_refs)
+ .into_iter()
+ .map(|folder| match folder {
+ SidebarFolder::Project(index) => project_keys[index].clone(),
+ SidebarFolder::RefGroup(index) => group_keys[index].clone(),
+ })
+ .collect()
+}
+
+/// Move a sidebar folder — a local project or a thread-ref group — before
+/// `before` (to the end when None) in the Space's merged display order.
+/// Local Spaces only: ref groups exist only there, and the mixed order is a
+/// purely local display concern (domain-owned Spaces keep syncing project
+/// order to their server through `move_project_before`). The relative order
+/// of the projects among themselves is mirrored back into the store's
+/// project list so every other project-order consumer stays consistent
+/// with what the sidebar shows.
+pub fn move_sidebar_folder_before(space_id: &str, key: &str, before: Option<&str>) -> bool {
+ let mut store = THREAD_STORE.lock();
+ let changed = store.move_sidebar_folder_before(space_id, key, before);
+ if changed {
+ persist_locked(&store);
+ }
+ changed
+}
+
+impl WorkspaceThreadStore {
+ fn move_sidebar_folder_before(
+ &mut self,
+ space_id: &str,
+ key: &str,
+ before: Option<&str>,
+ ) -> bool {
+ let store = self;
+ let is_local_space = store
+ .spaces
+ .iter()
+ .any(|space| space.id == space_id && space.client_domain.is_none());
+ if !is_local_space {
+ return false;
+ }
+ let previous = ordered_folder_keys_locked(&store, space_id);
+ let Some(from) = previous.iter().position(|entry| entry == key) else {
+ return false;
+ };
+ let mut order = previous.clone();
+ let moved = order.remove(from);
+ let to = match before {
+ Some(before) => match order.iter().position(|entry| entry == before) {
+ Some(index) => index,
+ // Unknown (or self) anchor: nothing sensible to do.
+ None => return false,
+ },
+ None => order.len(),
+ };
+ order.insert(to, moved);
+ if order == previous {
+ return false;
+ }
+
+ // Mirror the projects' relative order back into the store's Vec.
+ let project_positions: Vec<usize> = store
+ .projects
+ .iter()
+ .enumerate()
+ .filter(|(_, project)| project.space_id == space_id)
+ .map(|(index, _)| index)
+ .collect();
+ let mut wanted_project_order: Vec<usize> = Vec::new();
+ for entry in &order {
+ if let Some(position) = project_positions
+ .iter()
+ .find(|&&index| &store.projects[index].id == entry)
+ {
+ wanted_project_order.push(*position);
+ }
+ }
+ if wanted_project_order.len() == project_positions.len() {
+ let reordered: Vec<Project> = wanted_project_order
+ .iter()
+ .map(|&index| store.projects[index].clone())
+ .collect();
+ for (slot, project) in project_positions.iter().zip(reordered) {
+ store.projects[*slot] = project;
+ }
+ }
+
+ let Some(space) = store.spaces.iter_mut().find(|space| space.id == space_id) else {
+ return false;
+ };
+ space.folder_order = order;
+ true
+ }
+}
+
pub fn move_project_before(space_id: &str, project_id: &str, before: Option<&str>) -> bool {
let mut store = THREAD_STORE.lock();
let domain = tree_domain_for_space(&store, space_id);
@@ -3670,6 +3882,7 @@ impl Project {
distro: None,
}],
ref_groups: Vec::new(),
+ display_order: vec![SidebarFolder::Project(0)],
}
}
}
@@ -3689,6 +3902,7 @@ impl WorkspaceThreadStore {
thread_refs: Vec::new(),
thread_ref_meta: HashMap::new(),
active_thread_ref: None,
+ folder_order: Vec::new(),
});
changed = true;
}
@@ -3928,6 +4142,7 @@ impl WorkspaceThreadStore {
thread_refs: Vec::new(),
thread_ref_meta: HashMap::new(),
active_thread_ref: None,
+ folder_order: Vec::new(),
});
id
}
@@ -4420,7 +4635,7 @@ impl WorkspaceThreadStore {
.filter(|session| session.is_pinned)
})
.collect();
- let projects = self
+ let projects: Vec<ProjectView> = self
.projects
.iter()
.filter(|project| project.space_id == space_id)
@@ -4449,10 +4664,12 @@ impl WorkspaceThreadStore {
}
})
.collect();
+ let display_order = (0..projects.len()).map(SidebarFolder::Project).collect();
WorkspaceThreadsView {
pinned_threads,
projects,
ref_groups: Vec::new(),
+ display_order,
}
}
@@ -5380,6 +5597,7 @@ impl WorkspaceThreadStore {
thread_refs: Vec::new(),
thread_ref_meta: HashMap::new(),
active_thread_ref: None,
+ folder_order: Vec::new(),
}
})
.collect();
@@ -8901,6 +9119,7 @@ mod tests {
distro: None,
}],
ref_groups: Vec::new(),
+ display_order: Vec::new(),
};
filter_threads_view_by_status(&mut view, &hidden);
assert!(view.pinned_threads.is_empty());
@@ -9431,6 +9650,7 @@ mod tests {
&[],
Some(&ref_workspace),
)),
+ display_order: Vec::new(),
};
assert!(view.ref_workspace_on_screen());
@@ -9472,6 +9692,7 @@ mod tests {
distro: None,
}],
ref_groups: Vec::new(),
+ display_order: Vec::new(),
};
filter_threads_view_by_status(&mut view, &[WorkspaceThreadWorkStatus::Idle]);
let names: Vec<&str> = view.projects[0]
@@ -10039,6 +10260,7 @@ mod tests {
thread_refs: Vec::new(),
thread_ref_meta: HashMap::new(),
active_thread_ref: None,
+ folder_order: Vec::new(),
});
store
}
@@ -10497,6 +10719,7 @@ mod tests {
thread_refs: Vec::new(),
thread_ref_meta: HashMap::new(),
active_thread_ref: None,
+ folder_order: Vec::new(),
});
let owned_by_syd = store.space_ids_for_domain("syd");
@@ -10550,6 +10773,7 @@ mod tests {
thread_refs: Vec::new(),
thread_ref_meta: HashMap::new(),
active_thread_ref: None,
+ folder_order: Vec::new(),
});
store.spaces.push(Space {
id: "space-elsewhere".to_string(),
@@ -10562,6 +10786,7 @@ mod tests {
thread_refs: Vec::new(),
thread_ref_meta: HashMap::new(),
active_thread_ref: None,
+ folder_order: Vec::new(),
});
let names = vec!["ssh:[email protected]".to_string(), "DO SYD".to_string()];
@@ -10597,6 +10822,7 @@ mod tests {
thread_refs: Vec::new(),
thread_ref_meta: HashMap::new(),
active_thread_ref: None,
+ folder_order: Vec::new(),
});
store.projects.push(Project {
id: "rp2".to_string(),
@@ -10635,6 +10861,7 @@ mod tests {
thread_refs: Vec::new(),
thread_ref_meta: HashMap::new(),
active_thread_ref: None,
+ folder_order: Vec::new(),
});
// With nothing remembered, connecting lands on the server's first.
@@ -10703,6 +10930,7 @@ mod tests {
thread_refs: Vec::new(),
thread_ref_meta: HashMap::new(),
active_thread_ref: None,
+ folder_order: Vec::new(),
});
// Once it is known, they are hands off.
assert!(space_id_from_remote_project_id(&sibling)