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.

feat(onboarding): group what was found into sessions, WezTerm and projects

RoversXf78dfb865d69
diff --git a/thinkterm-i18n/i18n/de-DE.ftl b/thinkterm-i18n/i18n/de-DE.ftl
index e4894cee..862a0623 100644
--- a/thinkterm-i18n/i18n/de-DE.ftl
+++ b/thinkterm-i18n/i18n/de-DE.ftl
@@ -839,6 +839,7 @@ onboarding-found-sessions = { $count ->
[one] 1 Sitzung
*[other] { $count } Sitzungen
}
+onboarding-found-sessions-live = { $running } von { $count } aktiv; sie laufen nach der Übernahme weiter
onboarding-found-sessions-running = { $count ->
[one] 1 Sitzung
*[other] { $count } Sitzungen
@@ -846,7 +847,13 @@ onboarding-found-sessions-running = { $count ->
onboarding-found-wezterm = Eine Konfigurationsdatei
onboarding-found-import = Importieren
onboarding-found-import-settings = Einstellungen importieren
-onboarding-found-editors = Geöffnete Ordner
+onboarding-found-sessions-title = Terminal-Sitzungen
+onboarding-found-bring-over = Übernehmen
+onboarding-found-projects = Projektordner
+onboarding-found-projects-detail = Aus { $apps }
+onboarding-found-projects-more = Aus { $apps } und mehr
+onboarding-found-projects-any = Aus deinen Editoren und Coding-Agents
+onboarding-found-projects-separator = { ", " }
onboarding-found-choose-projects = Projekte auswählen
# Agent-Statuserkennung + Agents-Panel
diff --git a/thinkterm-i18n/i18n/en-US.ftl b/thinkterm-i18n/i18n/en-US.ftl
index 10bec1bc..7279bc0d 100644
--- a/thinkterm-i18n/i18n/en-US.ftl
+++ b/thinkterm-i18n/i18n/en-US.ftl
@@ -839,6 +839,7 @@ onboarding-found-sessions = { $count ->
[one] 1 session
*[other] { $count } sessions
}
+onboarding-found-sessions-live = { $running } of { $count } running; they keep running once brought over
onboarding-found-sessions-running = { $count ->
[one] 1 session
*[other] { $count } sessions
@@ -846,7 +847,13 @@ onboarding-found-sessions-running = { $count ->
onboarding-found-wezterm = A configuration file
onboarding-found-import = Import
onboarding-found-import-settings = Import settings
-onboarding-found-editors = Folders you opened
+onboarding-found-sessions-title = Terminal sessions
+onboarding-found-bring-over = Bring over
+onboarding-found-projects = Project folders
+onboarding-found-projects-detail = From { $apps }
+onboarding-found-projects-more = From { $apps } and more
+onboarding-found-projects-any = From your editors and coding agents
+onboarding-found-projects-separator = { ", " }
onboarding-found-choose-projects = Choose projects
# Agent status detection + Agents panel
diff --git a/thinkterm-i18n/i18n/fr-FR.ftl b/thinkterm-i18n/i18n/fr-FR.ftl
index 283e28c4..b46183b4 100644
--- a/thinkterm-i18n/i18n/fr-FR.ftl
+++ b/thinkterm-i18n/i18n/fr-FR.ftl
@@ -839,6 +839,7 @@ onboarding-found-sessions = { $count ->
[one] 1 session
*[other] { $count } sessions
}
+onboarding-found-sessions-live = { $running } sur { $count } en cours ; elles continuent une fois récupérées
onboarding-found-sessions-running = { $count ->
[one] 1 session
*[other] { $count } sessions
@@ -846,7 +847,13 @@ onboarding-found-sessions-running = { $count ->
onboarding-found-wezterm = Un fichier de configuration
onboarding-found-import = Importer
onboarding-found-import-settings = Importer les réglages
-onboarding-found-editors = Dossiers ouverts
+onboarding-found-sessions-title = Sessions de terminal
+onboarding-found-bring-over = Récupérer
+onboarding-found-projects = Dossiers de projet
+onboarding-found-projects-detail = Depuis { $apps }
+onboarding-found-projects-more = Depuis { $apps } et d'autres
+onboarding-found-projects-any = Depuis vos éditeurs et agents de code
+onboarding-found-projects-separator = { ", " }
onboarding-found-choose-projects = Choisir les projets
# Détection d'état des agents + panneau Agents
diff --git a/thinkterm-i18n/i18n/ja-JP.ftl b/thinkterm-i18n/i18n/ja-JP.ftl
index 727fbd08..02cd4e03 100644
--- a/thinkterm-i18n/i18n/ja-JP.ftl
+++ b/thinkterm-i18n/i18n/ja-JP.ftl
@@ -827,11 +827,18 @@ onboarding-skip = スキップ
onboarding-start = 使ってみる
onboarding-found-title = このコンピュータで見つかったもの
onboarding-found-sessions = { $count } 個のセッション
+onboarding-found-sessions-live = { $count } 個のセッション({ $running } 個が実行中、引き継いだ後も動き続けます)
onboarding-found-sessions-running = { $count } 個のセッション({ $running } 個が実行中)
onboarding-found-wezterm = 設定ファイルがあります
onboarding-found-import = インポート
onboarding-found-import-settings = 設定をインポート
-onboarding-found-editors = 開いたフォルダ
+onboarding-found-sessions-title = ターミナルセッション
+onboarding-found-bring-over = 引き継ぐ
+onboarding-found-projects = プロジェクトフォルダ
+onboarding-found-projects-detail = { $apps } から
+onboarding-found-projects-more = { $apps } などから
+onboarding-found-projects-any = エディタとコーディングエージェントから
+onboarding-found-projects-separator = 、
onboarding-found-choose-projects = プロジェクトを選択
# エージェント状態検出 + Agents パネル
diff --git a/thinkterm-i18n/i18n/zh-CN.ftl b/thinkterm-i18n/i18n/zh-CN.ftl
index 937bf67f..75d43d00 100644
--- a/thinkterm-i18n/i18n/zh-CN.ftl
+++ b/thinkterm-i18n/i18n/zh-CN.ftl
@@ -827,11 +827,18 @@ onboarding-skip = 跳过
onboarding-start = 开始使用
onboarding-found-title = 在这台电脑上找到
onboarding-found-sessions = { $count } 个会话
+onboarding-found-sessions-live = { $count } 个会话,{ $running } 个正在运行,接过来后继续跑
onboarding-found-sessions-running = { $count } 个会话,{ $running } 个在运行
onboarding-found-wezterm = 找到配置文件
onboarding-found-import = 导入
onboarding-found-import-settings = 导入设置
-onboarding-found-editors = 打开过的文件夹
+onboarding-found-sessions-title = 终端会话
+onboarding-found-bring-over = 接过来
+onboarding-found-projects = 项目文件夹
+onboarding-found-projects-detail = 来自 { $apps }
+onboarding-found-projects-more = 来自 { $apps } 等
+onboarding-found-projects-any = 来自你的编辑器和编程 agent
+onboarding-found-projects-separator = 、
onboarding-found-choose-projects = 选择项目
# Agent 状态检测 + Agents 面板
diff --git a/wezterm-gui/src/termwindow/onboarding.rs b/wezterm-gui/src/termwindow/onboarding.rs
index 72ab9dea..e5ce6764 100644
--- a/wezterm-gui/src/termwindow/onboarding.rs
+++ b/wezterm-gui/src/termwindow/onboarding.rs
@@ -74,6 +74,8 @@ const MENU_RADIUS: f32 = 20.0;
const FOUND_PAD_X: f32 = 28.0;
const FOUND_PAD_Y: f32 = 22.0;
const FOUND_ICON: f32 = 48.0;
+/// How much larger than one mark the ring of project apps' marks is.
+const FOUND_RING: f32 = 1.35;
const FOUND_ICON_GAP: f32 = 24.0;
const FOUND_LINE_GAP: f32 = 4.0;
const FOUND_RADIUS: f32 = 24.0;
@@ -212,12 +214,9 @@ fn focus_order(found: &found::Found) -> Vec<OnboardingAction> {
]
.map(OnboardingAction::Appearance),
);
- order.extend(
- found
- .sessions
- .iter()
- .map(|sessions| OnboardingAction::Import(Some(sessions.id))),
- );
+ if let Some(target) = found.sessions_target() {
+ order.push(OnboardingAction::Import(Some(target)));
+ }
if found.wezterm_config {
order.push(OnboardingAction::Import(None));
}
@@ -231,10 +230,89 @@ fn focus_order(found: &found::Found) -> Vec<OnboardingAction> {
order
}
+/// Programs' marks on overlapping tiles, laid out as
+/// [`crate::editor_projects::draw_stack`] lays out editors': the first in
+/// front, each ringed with the card so the ones behind show where they are
+/// cut. A mark with a square of its own is drawn on it; the rest sit on a
+/// plain grey tile.
+#[allow(clippy::too_many_arguments)]
+fn paint_program_stack(
+ ctx: &DrawContext,
+ layers: &mut TripleLayerQuadAllocator<'_>,
+ icons: &[Option<BrandIcon>],
+ x: f32,
+ y: f32,
+ tile: f32,
+ skin: Skin,
+) -> anyhow::Result<()> {
+ let (x, y, tile) = (x.round(), y.round(), tile.round());
+ let step = crate::editor_projects::stack_width(2, tile) - tile;
+ let ring = (tile * 0.05).round().max(1.0);
+ let radius = tile * 0.27;
+ let mark = (tile * 0.56).round();
+ for (index, icon) in icons.iter().enumerate().rev() {
+ let tile_x = x + step * index as f32;
+ ctx.draw_rounded_rect(
+ layers,
+ 2,
+ tile_x - ring,
+ y - ring,
+ tile + ring * 2.0,
+ tile + ring * 2.0,
+ skin.chip_bg,
+ radius + ring,
+ )?;
+ match icon {
+ Some(brand) if brand.app_icon_ground().is_some() => {
+ crate::ui::tile::draw_brand_tile(
+ ctx,
+ layers,
+ *brand,
+ tile_x,
+ y,
+ tile,
+ skin.dark,
+ &crate::settings_window::ROW_TILE,
+ )?
+ }
+ _ => {
+ crate::ui::tile::draw_tile(
+ ctx,
+ layers,
+ 2,
+ tile_x,
+ y,
+ tile,
+ radius,
+ LinearRgba::with_srgba(0x48, 0x48, 0x4A, 0xFF),
+ skin.dark,
+ &crate::settings_window::ROW_TILE,
+ )?;
+ let mark_x = tile_x + (tile - mark) / 2.0;
+ let mark_y = y + (tile - mark) / 2.0;
+ match icon {
+ Some(brand) => ctx.draw_brand_icon(layers, *brand, mark_x, mark_y, mark)?,
+ None => ctx.draw_svg_icon(
+ layers,
+ SvgIcon::Terminal,
+ mark_x,
+ mark_y,
+ mark,
+ LinearRgba::with_srgba(0xFF, 0xFF, 0xFF, 0xFF),
+ )?,
+ }
+ }
+ }
+ }
+ Ok(())
+}
+
/// What heads a row of the found card.
enum FoundMark {
/// A program's own mark, or a terminal where it has none.
Program(Option<BrandIcon>),
+ /// Several programs' marks on overlapping tiles.
+ Programs(Vec<Option<BrandIcon>>),
/// Editors' marks on overlapping tiles.
Editors(Vec<crate::editor_projects::EditorKind>),
}
@@ -1400,61 +1478,105 @@ impl OnboardingView {
fx(FOUND_RADIUS),
)?;
- let mut rows: Vec<(FoundMark, String, String, String, OnboardingAction)> = self
- .found
- .sessions
- .iter()
- .map(|sessions| {
- let mut args = FluentArgs::new();
- args.set("count", sessions.count as i64);
- let detail = match sessions.running() {
- Some(running) if running > 0 => {
- args.set("running", running as i64);
- crate::i18n::tr_args("onboarding-found-sessions-running", &args)
- }
- _ => crate::i18n::tr_args("onboarding-found-sessions", &args),
- };
+ // Each row's detail comes as choices, the fullest first; the row
+ // shows the first that fits beside its button.
+ let mut rows: Vec<(FoundMark, String, Vec<String>, String, OnboardingAction)> =
+ Vec::new();
+ // Every program's sessions in one row. Running ones come over still
+ // running, which is the thing to say about them.
+ if let Some(target) = self.found.sessions_target() {
+ let sessions = &self.found.sessions;
+ let (count, running) = self.found.sessions_total();
+ let mut args = FluentArgs::new();
+ args.set("count", count as i64);
+ let running = running.unwrap_or(0);
+ let (details, button) = if running > 0 {
+ args.set("running", running as i64);
+ (
+ vec![
+ crate::i18n::tr_args("onboarding-found-sessions-live", &args),
+ crate::i18n::tr_args("onboarding-found-sessions-running", &args),
+ ],
+ crate::i18n::tr("onboarding-found-bring-over"),
+ )
+ } else {
(
- FoundMark::Program(sessions.icon),
- sessions.name.to_string(),
- detail,
+ vec![crate::i18n::tr_args("onboarding-found-sessions", &args)],
crate::i18n::tr("onboarding-found-import"),
- OnboardingAction::Import(Some(sessions.id)),
)
- })
- .collect();
+ };
+ let (mark, name) = match sessions.as_slice() {
+ [only] => (FoundMark::Program(only.icon), only.name.to_string()),
+ many => (
+ FoundMark::Programs(many.iter().take(3).map(|found| found.icon).collect()),
+ crate::i18n::tr("onboarding-found-sessions-title"),
+ ),
+ };
+ rows.push((
+ mark,
+ name,
+ details,
+ button,
+ OnboardingAction::Import(Some(target)),
+ ));
+ }
if self.found.wezterm_config {
rows.push((
FoundMark::Program(Some(BrandIcon::WezTerm)),
"WezTerm".to_string(),
- crate::i18n::tr("onboarding-found-wezterm"),
+ vec![crate::i18n::tr("onboarding-found-wezterm")],
crate::i18n::tr("onboarding-found-import-settings"),
OnboardingAction::Import(None),
));
}
if let Some(editors) = &self.found.editors {
+ // As many apps named as fit; the marks say which when none does.
+ // No count: the folders are not looked at before the user asks,
+ // so ones deleted since would be counted.
+ let mut details: Vec<String> = (1..=editors.apps.len().min(3))
+ .rev()
+ .map(|named| {
+ let (apps, more) = editors.apps_line(named);
+ let mut args = FluentArgs::new();
+ args.set("apps", apps);
+ let key = if more {
+ "onboarding-found-projects-more"
+ } else {
+ "onboarding-found-projects-detail"
+ };
+ crate::i18n::tr_args(key, &args)
+ })
+ .collect();
+ details.push(crate::i18n::tr("onboarding-found-projects-any"));
rows.push((
FoundMark::Editors(editors.kinds.clone()),
- editors.names.clone(),
- crate::i18n::tr("onboarding-found-editors"),
+ crate::i18n::tr("onboarding-found-projects"),
+ details,
crate::i18n::tr("onboarding-found-choose-projects"),
OnboardingAction::Import(Some(crate::settings_window::EDITORS_SOURCE)),
));
}
let pad_x = fx(FOUND_PAD_X);
- let icon = fx(FOUND_ICON);
+ // The marks take no height of their own, so squeezing them gains the
+ // page nothing: full size, unless the row is too short to hold it.
+ let room = body_h * 2.0 + fx(FOUND_LINE_GAP) + fx(FOUND_PAD_Y);
+ let icon = ctx.px(FOUND_ICON).min(room);
+ // A ring of marks needs a larger square to keep each one legible.
+ let ring = (ctx.px(FOUND_ICON) * FOUND_RING).min(row_h - fx(FOUND_LINE_GAP) * 2.0);
// A row of editors is wider than one mark; every mark is centred
// in the widest, so the names still line up.
let mark_width = |mark: &FoundMark| match mark {
FoundMark::Program(_) => icon,
- FoundMark::Editors(kinds) => crate::editor_projects::stack_width(kinds.len(), icon),
+ FoundMark::Programs(icons) => crate::editor_projects::stack_width(icons.len(), icon),
+ FoundMark::Editors(kinds) if kinds.len() > 1 => ring,
+ FoundMark::Editors(_) => icon,
};
let column = rows
.iter()
.map(|(mark, ..)| mark_width(mark))
.fold(icon, f32::max);
- for (index, (mark, name, detail, button, action)) in rows.iter().enumerate() {
+ for (index, (mark, name, details, button, action)) in rows.iter().enumerate() {
let top = card.origin.y + index as f32 * row_h;
if index > 0 {
ctx.draw_rect(
@@ -1468,7 +1590,8 @@ impl OnboardingView {
)?;
}
let column_x = card.origin.x + pad_x;
- let icon_x = column_x + (column - mark_width(mark)) / 2.0;
+ let mark_w = mark_width(mark);
+ let icon_x = column_x + (column - mark_w) / 2.0;
let icon_y = top + (row_h - icon) / 2.0;
match mark {
FoundMark::Program(Some(brand)) => crate::ui::tile::draw_brand_tile(
@@ -1489,13 +1612,16 @@ impl OnboardingView {
icon,
skin.secondary_text,
)?,
- FoundMark::Editors(kinds) => crate::editor_projects::draw_stack(
+ FoundMark::Programs(icons) => {
+ paint_program_stack(ctx, layers, icons, icon_x, icon_y, icon, skin)?
+ }
+ FoundMark::Editors(kinds) => crate::editor_projects::draw_ring(
ctx,
layers,
kinds,
icon_x,
- icon_y,
- icon,
+ top + (row_h - mark_w) / 2.0,
+ mark_w,
skin.chip_bg,
skin.dark,
)?,
@@ -1519,6 +1645,16 @@ impl OnboardingView {
let text_w = (button_x - fx(FOUND_ICON_GAP) - text_x).max(1.0);
let text_y = top + (row_h - body_h * 2.0 - fx(FOUND_LINE_GAP)) / 2.0;
self.text(ctx, layers, font, text_x, text_y, name, skin.text, text_w)?;
+ let detail = details
+ .iter()
+ .find(|detail| self.width(ctx, font, detail) <= text_w)
+ // None fits: the shortest loses the least to the ellipsis.
+ .or_else(|| {
+ details.iter().min_by(|a, b| {
+ self.width(ctx, font, a).total_cmp(&self.width(ctx, font, b))
+ })
+ })
+ .map_or("", String::as_str);
self.text(
ctx,
layers,
diff --git a/wezterm-gui/src/termwindow/onboarding/found.rs b/wezterm-gui/src/termwindow/onboarding/found.rs
index f3e7bc28..625d5a04 100644
--- a/wezterm-gui/src/termwindow/onboarding/found.rs
+++ b/wezterm-gui/src/termwindow/onboarding/found.rs
@@ -1,6 +1,7 @@
-//! What first-run setup offers to bring in from this computer: another
-//! program's terminal sessions, a WezTerm configuration, and the folders
-//! code editors have opened.
+//! What first-run setup offers to bring in from this computer: other
+//! programs' terminal sessions, a WezTerm configuration, and the folders
+//! code editors and coding agents were used in -- a row for each kind,
+//! however many programs it is found in.
//!
//! What is on disk is read when the page opens, so the page has its final
//! height from the first frame. Whether a session is running means asking
@@ -29,14 +30,24 @@ impl FoundSessions {
}
}
-/// Code editors that opened folders no local Space has yet.
+/// Editors and agents that were used in folders no local Space has yet.
pub(super) struct FoundEditors {
- /// The editors, by name, as one line: "VS Code, Cursor".
- pub names: String,
- /// The editors whose marks the row shows.
+ /// The apps, by name, the most used first.
+ pub apps: Vec<String>,
+ /// The apps whose marks the row shows.
pub kinds: Vec<crate::editor_projects::EditorKind>,
}
+impl FoundEditors {
+ /// The first `named` apps as one line, "Claude Code, Codex", and
+ /// whether more were left out.
+ pub fn apps_line(&self, named: usize) -> (String, bool) {
+ let named = named.min(self.apps.len());
+ let separator = crate::i18n::tr("onboarding-found-projects-separator");
+ (self.apps[..named].join(&separator), self.apps.len() > named)
+ }
+}
+
#[derive(Default)]
pub(super) struct Found {
pub sessions: Vec<FoundSessions>,
@@ -57,9 +68,32 @@ impl Found {
self.sessions.is_empty() && !self.wezterm_config && self.editors.is_none()
}
- /// One per program the page offers to import from.
+ /// One per kind of thing the page offers to import: sessions, however
+ /// many programs they are in; a configuration; folders.
pub fn rows(&self) -> usize {
- self.sessions.len() + usize::from(self.wezterm_config) + usize::from(self.editors.is_some())
+ usize::from(!self.sessions.is_empty())
+ + usize::from(self.wezterm_config)
+ + usize::from(self.editors.is_some())
+ }
+
+ /// The sessions' row opens the Import page on this program: the one
+ /// with the most sessions. Not the most running: the checks answer
+ /// late, and the row would change what it opens under the user.
+ pub fn sessions_target(&self) -> Option<&'static str> {
+ self.sessions
+ .iter()
+ .max_by_key(|found| found.count)
+ .map(|found| found.id)
+ }
+
+ /// Every program's sessions together, and how many of them the checks
+ /// that have answered found running; `None` until one has, so one slow
+ /// check does not hide what the others found.
+ pub fn sessions_total(&self) -> (usize, Option<usize>) {
+ let count = self.sessions.iter().map(|found| found.count).sum();
+ let answers: Vec<usize> = self.sessions.iter().filter_map(FoundSessions::running).collect();
+ let running = (!answers.is_empty()).then(|| answers.iter().sum());
+ (count, running)
}
/// Whether a running check is still out.
@@ -87,13 +121,14 @@ fn editors() -> Option<FoundEditors> {
.map(std::path::PathBuf::from),
);
}
+ // Whether any is left to offer. How many is for the Import page to say:
+ // it drops the folders gone since, which here are still counted.
if scan.folders.iter().all(|folder| known.contains(&folder.path)) {
return None;
}
- let names: Vec<&str> = scan.editors.iter().map(|editor| editor.name.as_str()).collect();
Some(FoundEditors {
- names: names.join(", "),
- kinds: crate::editor_projects::stack_kinds(scan.editors.iter().map(|editor| editor.kind)),
+ apps: scan.editors.iter().map(|editor| editor.name.clone()).collect(),
+ kinds: crate::editor_projects::ring_kinds(scan.editors.iter().map(|editor| editor.kind)),
})
}