BlueGit

ict rusty-teams

refactor(app): extract app-base crate

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

metis Daniel Däschle · pushed by metis

Authored 2026-10-15 · 6 weeks ago

Hash
16e522c2f19707d408686b31e9b0770e0b26ce43
Parent
4e5e15e2
61 files changed +231 −145
Cargo.lock +26 −3
@@ -276,6 +276,7 @@ name = "app"
276 276 version = "0.1.0"
277 277 dependencies = [
278 278 "agents",
279 "app-base",
279 280 "calling",
280 281 "chatsvc",
281 282 "chrono",
@@ -287,9 +288,7 @@ dependencies = [
287 288 "image",
288 289 "log",
289 290 "mcp",
290 "raw-window-handle",
291 291 "regex",
292 "rodio",
293 292 "serde",
294 293 "serde_json",
295 294 "session",
@@ -297,9 +296,33 @@ dependencies = [
297 296 "teams-core",
298 297 "tempfile",
299 298 "tokio",
300 "tray-icon",
301 299 "uuid",
302 300 "webview",
301 ]
302
303 [[package]]
304 name = "app-base"
305 version = "0.1.0"
306 dependencies = [
307 "agents",
308 "calling",
309 "chatsvc",
310 "chrono",
311 "directories",
312 "gpui-kit",
313 "image",
314 "log",
315 "mcp",
316 "raw-window-handle",
317 "rodio",
318 "serde",
319 "serde_json",
320 "session",
321 "store",
322 "teams-core",
323 "tempfile",
324 "tokio",
325 "tray-icon",
303 326 "windows 0.62.2",
304 327 "x11rb",
305 328 ]
@@ -276,6 +276,7 @@ name = "app"
276version = "0.1.0"
276version = "0.1.0"
277dependencies = [
277dependencies = [
278 "agents",
278 "agents",
279 "app-base",
279 "calling",
280 "calling",
280 "chatsvc",
281 "chatsvc",
281 "chrono",
282 "chrono",
@@ -287,9 +288,7 @@ dependencies = [
287 "image",
288 "image",
288 "log",
289 "log",
289 "mcp",
290 "mcp",
290 "raw-window-handle",
291 "regex",
291 "regex",
292 "rodio",
293 "serde",
292 "serde",
294 "serde_json",
293 "serde_json",
295 "session",
294 "session",
@@ -297,9 +296,33 @@ dependencies = [
297 "teams-core",
296 "teams-core",
298 "tempfile",
297 "tempfile",
299 "tokio",
298 "tokio",
300 "tray-icon",
301 "uuid",
299 "uuid",
302 "webview",
300 "webview",
301]
302
303[[package]]
304name = "app-base"
305version = "0.1.0"
306dependencies = [
307 "agents",
308 "calling",
309 "chatsvc",
310 "chrono",
311 "directories",
312 "gpui-kit",
313 "image",
314 "log",
315 "mcp",
316 "raw-window-handle",
317 "rodio",
318 "serde",
319 "serde_json",
320 "session",
321 "store",
322 "teams-core",
323 "tempfile",
324 "tokio",
325 "tray-icon",
303 "windows 0.62.2",
326 "windows 0.62.2",
304 "x11rb",
327 "x11rb",
305]
328]
Cargo.toml +4 −0
@@ -28,6 +28,7 @@ tokio-tungstenite = { version = "0.28", default-features = false, features = ["c
28 28 url = "2"
29 29 uuid = { version = "1", default-features = false, features = ["v4"] }
30 30
31 app-base = { path = "crates/app-base" }
31 32 agents = { path = "crates/agents" }
32 33 session = { path = "crates/session" }
33 34 graph = { path = "crates/graph" }
@@ -54,3 +55,6 @@ codegen-units = 16
54 55
55 56 [profile.release.package.app]
56 57 opt-level = 1
58
59 [profile.release.package.app-base]
60 opt-level = 1
@@ -28,6 +28,7 @@ tokio-tungstenite = { version = "0.28", default-features = false, features = ["c
28url = "2"
28url = "2"
29uuid = { version = "1", default-features = false, features = ["v4"] }
29uuid = { version = "1", default-features = false, features = ["v4"] }
30
30
31app-base = { path = "crates/app-base" }
31agents = { path = "crates/agents" }
32agents = { path = "crates/agents" }
32session = { path = "crates/session" }
33session = { path = "crates/session" }
33graph = { path = "crates/graph" }
34graph = { path = "crates/graph" }
@@ -54,3 +55,6 @@ codegen-units = 16
54
55
55[profile.release.package.app]
56[profile.release.package.app]
56opt-level = 1
57opt-level = 1
58
59[profile.release.package.app-base]
60opt-level = 1
crates/app-base/Cargo.toml added +51 −0
@@ -0,0 +1,51 @@
1 [package]
2 name = "app-base"
3 edition.workspace = true
4 version.workspace = true
5 license.workspace = true
6 publish.workspace = true
7
8 [dev-dependencies]
9 gpui-kit = { workspace = true, features = ["test-support"] }
10 tempfile.workspace = true
11
12 [dependencies]
13 agents.workspace = true
14 calling.workspace = true
15 chatsvc.workspace = true
16 chrono.workspace = true
17 directories.workspace = true
18 gpui-kit.workspace = true
19 log = "0.4"
20 mcp.workspace = true
21 serde.workspace = true
22 serde_json.workspace = true
23 session.workspace = true
24 store.workspace = true
25 teams-core.workspace = true
26 tokio.workspace = true
27 image = { version = "0.25", default-features = false, features = ["bmp", "gif", "jpeg", "png", "webp"] }
28
29 [target.'cfg(target_os = "linux")'.dependencies]
30 raw-window-handle = "0.6"
31 x11rb = { version = "0.13", features = ["shape"] }
32
33 [target.'cfg(windows)'.dependencies]
34 raw-window-handle = "0.6"
35 rodio = { version = "0.22", default-features = false, features = ["playback", "mp3"] }
36 tray-icon = { version = "0.21", default-features = false }
37 windows = { version = "0.62", features = [
38 "Win32_Foundation",
39 "Win32_Graphics_Dwm",
40 "Win32_Graphics_Gdi",
41 "Win32_Security",
42 "Win32_Storage_FileSystem",
43 "Win32_System_Com",
44 "Win32_System_Pipes",
45 "Win32_System_SystemInformation",
46 "Win32_System_Threading",
47 "Win32_UI_HiDpi",
48 "Win32_UI_Input_KeyboardAndMouse",
49 "Win32_UI_Shell",
50 "Win32_UI_WindowsAndMessaging",
51 ] }
@@ -0,0 +1,51 @@
1[package]
2name = "app-base"
3edition.workspace = true
4version.workspace = true
5license.workspace = true
6publish.workspace = true
7
8[dev-dependencies]
9gpui-kit = { workspace = true, features = ["test-support"] }
10tempfile.workspace = true
11
12[dependencies]
13agents.workspace = true
14calling.workspace = true
15chatsvc.workspace = true
16chrono.workspace = true
17directories.workspace = true
18gpui-kit.workspace = true
19log = "0.4"
20mcp.workspace = true
21serde.workspace = true
22serde_json.workspace = true
23session.workspace = true
24store.workspace = true
25teams-core.workspace = true
26tokio.workspace = true
27image = { version = "0.25", default-features = false, features = ["bmp", "gif", "jpeg", "png", "webp"] }
28
29[target.'cfg(target_os = "linux")'.dependencies]
30raw-window-handle = "0.6"
31x11rb = { version = "0.13", features = ["shape"] }
32
33[target.'cfg(windows)'.dependencies]
34raw-window-handle = "0.6"
35rodio = { version = "0.22", default-features = false, features = ["playback", "mp3"] }
36tray-icon = { version = "0.21", default-features = false }
37windows = { version = "0.62", features = [
38 "Win32_Foundation",
39 "Win32_Graphics_Dwm",
40 "Win32_Graphics_Gdi",
41 "Win32_Security",
42 "Win32_Storage_FileSystem",
43 "Win32_System_Com",
44 "Win32_System_Pipes",
45 "Win32_System_SystemInformation",
46 "Win32_System_Threading",
47 "Win32_UI_HiDpi",
48 "Win32_UI_Input_KeyboardAndMouse",
49 "Win32_UI_Shell",
50 "Win32_UI_WindowsAndMessaging",
51] }
crates/app/src/agent_api/extras.rs crates/app-base/src/agent_api/extras.rs renamed +0 −0
crates/app/src/agent_api/image_scale.rs crates/app-base/src/agent_api/image_scale.rs renamed +0 −0
crates/app-base/src/agent_api/mod.rs added +2 −0
@@ -0,0 +1,2 @@
1 pub mod extras;
2 pub mod image_scale;
@@ -0,0 +1,2 @@
1pub mod extras;
2pub mod image_scale;
crates/app/src/agents/lanes.rs crates/app-base/src/agents/lanes.rs renamed +0 −0
crates/app-base/src/agents/mod.rs added +2 −0
@@ -0,0 +1,2 @@
1 pub mod lanes;
2 pub mod settings_problems;
@@ -0,0 +1,2 @@
1pub mod lanes;
2pub mod settings_problems;
crates/app/src/agents/settings_problems.rs crates/app-base/src/agents/settings_problems.rs renamed +0 −0
crates/app/src/assets.rs crates/app-base/src/assets.rs renamed +1 −1
@@ -4,7 +4,7 @@ use gpui_kit::{AssetSource, Result, SharedString};
4 4
5 5 macro_rules! symbols {
6 6 ($($name:literal),* $(,)?) => {
7 [$((concat!("symbols/", $name, ".svg"), include_bytes!(concat!("../assets/symbols/", $name, ".svg")) as &[u8])),*]
7 [$((concat!("symbols/", $name, ".svg"), include_bytes!(concat!("../../app/assets/symbols/", $name, ".svg")) as &[u8])),*]
8 8 };
9 9 }
10 10
@@ -4,7 +4,7 @@ use gpui_kit::{AssetSource, Result, SharedString};
4
4
5macro_rules! symbols {
5macro_rules! symbols {
6 ($($name:literal),* $(,)?) => {
6 ($($name:literal),* $(,)?) => {
7 [$((concat!("symbols/", $name, ".svg"), include_bytes!(concat!("../assets/symbols/", $name, ".svg")) as &[u8])),*]
7 [$((concat!("symbols/", $name, ".svg"), include_bytes!(concat!("../../app/assets/symbols/", $name, ".svg")) as &[u8])),*]
8 };
8 };
9}
9}
10
10
crates/app/src/avatar_image.rs crates/app-base/src/avatar_image.rs renamed +0 −0
crates/app/src/channel_files.rs crates/app-base/src/channel_files.rs renamed +0 −0
crates/app/src/crash_log.rs crates/app-base/src/crash_log.rs renamed +1 −1
@@ -32,7 +32,7 @@ fn entry(info: &PanicHookInfo<'_>, backtrace: &str) -> String {
32 32 format!(
33 33 "=== {} build {} thread {}\npanic at {location}: {}\n{backtrace}\n",
34 34 chrono::Utc::now().to_rfc3339(),
35 env!("TEAMS_BUILD_VERSION"),
35 crate::version::build_version(),
36 36 thread.name().unwrap_or("unnamed"),
37 37 message(info),
38 38 )
@@ -32,7 +32,7 @@ fn entry(info: &PanicHookInfo<'_>, backtrace: &str) -> String {
32 format!(
32 format!(
33 "=== {} build {} thread {}\npanic at {location}: {}\n{backtrace}\n",
33 "=== {} build {} thread {}\npanic at {location}: {}\n{backtrace}\n",
34 chrono::Utc::now().to_rfc3339(),
34 chrono::Utc::now().to_rfc3339(),
35 env!("TEAMS_BUILD_VERSION"),
35 crate::version::build_version(),
36 thread.name().unwrap_or("unnamed"),
36 thread.name().unwrap_or("unnamed"),
37 message(info),
37 message(info),
38 )
38 )
crates/app/src/demo_cards.rs crates/app-base/src/demo_cards.rs renamed +0 −0
crates/app/src/demo_chart_cards.rs crates/app-base/src/demo_chart_cards.rs renamed +0 −0
crates/app/src/demo_gifs.rs crates/app-base/src/demo_gifs.rs renamed +0 −0
crates/app/src/demo_input_cards.rs crates/app-base/src/demo_input_cards.rs renamed +0 −0
crates/app/src/demo_library.rs crates/app-base/src/demo_library.rs renamed +0 −0
crates/app/src/demo_recap.rs crates/app-base/src/demo_recap.rs renamed +0 −0
crates/app/src/diagnostics.rs crates/app-base/src/diagnostics.rs renamed +1 −1
@@ -86,7 +86,7 @@ fn line_prefix() -> String {
86 86 format!(
87 87 "{} {}",
88 88 chrono::Utc::now().format("%Y-%m-%dT%H:%M:%SZ"),
89 env!("TEAMS_BUILD_VERSION")
89 crate::version::build_version()
90 90 )
91 91 }
92 92
@@ -86,7 +86,7 @@ fn line_prefix() -> String {
86 format!(
86 format!(
87 "{} {}",
87 "{} {}",
88 chrono::Utc::now().format("%Y-%m-%dT%H:%M:%SZ"),
88 chrono::Utc::now().format("%Y-%m-%dT%H:%M:%SZ"),
89 env!("TEAMS_BUILD_VERSION")
89 crate::version::build_version()
90 )
90 )
91}
91}
92
92
crates/app/src/downloads.rs crates/app-base/src/downloads.rs renamed +0 −0
crates/app-base/src/emoji/mod.rs added +1 −0
@@ -0,0 +1 @@
1 pub mod typing;
@@ -0,0 +1 @@
1pub mod typing;
crates/app/src/emoji/typing.rs crates/app-base/src/emoji/typing.rs renamed +0 −0
crates/app/src/format.rs crates/app-base/src/format.rs renamed +0 −0
crates/app/src/frame_log.rs crates/app-base/src/frame_log.rs renamed +0 −0
crates/app/src/fuzzy.rs crates/app-base/src/fuzzy.rs renamed +0 −0
crates/app/src/image_view_math.rs crates/app-base/src/image_view_math.rs renamed +0 −0
crates/app-base/src/lib.rs added +36 −0
@@ -0,0 +1,36 @@
1 pub mod agent_api;
2 pub mod agents;
3 pub mod assets;
4 pub mod avatar_image;
5 pub mod channel_files;
6 pub mod crash_log;
7 pub mod demo_cards;
8 pub mod demo_chart_cards;
9 pub mod demo_gifs;
10 pub mod demo_input_cards;
11 pub mod demo_library;
12 pub mod demo_recap;
13 pub mod diagnostics;
14 pub mod downloads;
15 pub mod emoji;
16 pub mod format;
17 pub mod frame_log;
18 pub mod fuzzy;
19 pub mod image_view_math;
20 pub mod notify;
21 pub mod presence_link;
22 pub mod read_state;
23 pub mod recap;
24 pub mod remote_image;
25 pub mod runtime;
26 pub mod schedule_time;
27 pub mod single_instance;
28 pub mod stickers;
29 pub mod task_dialog;
30 pub mod theme;
31 pub mod translation;
32 pub mod updater;
33 pub mod user_activity;
34 pub mod version;
35
36 pub const APP_NAME: &str = "Rusty Teams";
@@ -0,0 +1,36 @@
1pub mod agent_api;
2pub mod agents;
3pub mod assets;
4pub mod avatar_image;
5pub mod channel_files;
6pub mod crash_log;
7pub mod demo_cards;
8pub mod demo_chart_cards;
9pub mod demo_gifs;
10pub mod demo_input_cards;
11pub mod demo_library;
12pub mod demo_recap;
13pub mod diagnostics;
14pub mod downloads;
15pub mod emoji;
16pub mod format;
17pub mod frame_log;
18pub mod fuzzy;
19pub mod image_view_math;
20pub mod notify;
21pub mod presence_link;
22pub mod read_state;
23pub mod recap;
24pub mod remote_image;
25pub mod runtime;
26pub mod schedule_time;
27pub mod single_instance;
28pub mod stickers;
29pub mod task_dialog;
30pub mod theme;
31pub mod translation;
32pub mod updater;
33pub mod user_activity;
34pub mod version;
35
36pub const APP_NAME: &str = "Rusty Teams";
crates/app/src/notify/badge.rs crates/app-base/src/notify/badge.rs renamed +0 −0
crates/app-base/src/notify/mod.rs added +6 −0
@@ -0,0 +1,6 @@
1 #[cfg_attr(not(windows), allow(dead_code))]
2 pub mod badge;
3 #[cfg_attr(not(windows), allow(dead_code))]
4 pub mod platform;
5 #[cfg_attr(not(windows), allow(dead_code))]
6 pub mod ring_tone;
@@ -0,0 +1,6 @@
1#[cfg_attr(not(windows), allow(dead_code))]
2pub mod badge;
3#[cfg_attr(not(windows), allow(dead_code))]
4pub mod platform;
5#[cfg_attr(not(windows), allow(dead_code))]
6pub mod ring_tone;
crates/app/src/notify/platform/mod.rs crates/app-base/src/notify/platform/mod.rs renamed +0 −0
crates/app/src/notify/platform/stack_plan.rs crates/app-base/src/notify/platform/stack_plan.rs renamed +0 −0
crates/app/src/notify/platform/stub.rs crates/app-base/src/notify/platform/stub.rs renamed +0 −0
crates/app/src/notify/platform/windows_impl.rs crates/app-base/src/notify/platform/windows_impl.rs renamed +2 −2
@@ -45,8 +45,8 @@ use super::{NativeHandle, ScreenRect, ShareGeometry, TrayCommand, WorkArea};
45 45 use crate::notify::badge::{BADGE_SIZE, Badge, render_badge};
46 46 use crate::notify::ring_tone::{Ringtone, SAMPLE_RATE, ringback_cycle};
47 47
48 const SOUND_BYTES: &[u8] = include_bytes!("../../../assets/sounds/notification.mp3");
49 const TRAY_ICON_PNG: &[u8] = include_bytes!("../../../assets/icon/teams-fast-256.png");
48 const SOUND_BYTES: &[u8] = include_bytes!("../../../../app/assets/sounds/notification.mp3");
49 const TRAY_ICON_PNG: &[u8] = include_bytes!("../../../../app/assets/icon/teams-fast-256.png");
50 50 const TRAY_ICON_SIZE: u32 = 32;
51 51 const TRAY_DOT_RADIUS: f32 = 6.;
52 52 const BASE_DPI: f32 = 96.;
@@ -45,8 +45,8 @@ use super::{NativeHandle, ScreenRect, ShareGeometry, TrayCommand, WorkArea};
45use crate::notify::badge::{BADGE_SIZE, Badge, render_badge};
45use crate::notify::badge::{BADGE_SIZE, Badge, render_badge};
46use crate::notify::ring_tone::{Ringtone, SAMPLE_RATE, ringback_cycle};
46use crate::notify::ring_tone::{Ringtone, SAMPLE_RATE, ringback_cycle};
47
47
48const SOUND_BYTES: &[u8] = include_bytes!("../../../assets/sounds/notification.mp3");
48const SOUND_BYTES: &[u8] = include_bytes!("../../../../app/assets/sounds/notification.mp3");
49const TRAY_ICON_PNG: &[u8] = include_bytes!("../../../assets/icon/teams-fast-256.png");
49const TRAY_ICON_PNG: &[u8] = include_bytes!("../../../../app/assets/icon/teams-fast-256.png");
50const TRAY_ICON_SIZE: u32 = 32;
50const TRAY_ICON_SIZE: u32 = 32;
51const TRAY_DOT_RADIUS: f32 = 6.;
51const TRAY_DOT_RADIUS: f32 = 6.;
52const BASE_DPI: f32 = 96.;
52const BASE_DPI: f32 = 96.;
crates/app/src/notify/platform/x11_input.rs crates/app-base/src/notify/platform/x11_input.rs renamed +0 −0
crates/app/src/notify/ring_tone.rs crates/app-base/src/notify/ring_tone.rs renamed +0 −0
crates/app/src/read_state.rs crates/app-base/src/read_state.rs renamed +0 −0
crates/app/src/recap.rs crates/app-base/src/recap.rs renamed +0 −0
crates/app/src/remote_image.rs crates/app-base/src/remote_image.rs renamed +0 −0
crates/app/src/runtime.rs crates/app-base/src/runtime.rs renamed +0 −0
crates/app/src/schedule_time.rs crates/app-base/src/schedule_time.rs renamed +0 −0
crates/app/src/single_instance.rs crates/app-base/src/single_instance.rs renamed +0 −0
crates/app/src/stickers.rs crates/app-base/src/stickers.rs renamed +1 −1
@@ -1,6 +1,6 @@
1 1 use std::sync::OnceLock;
2 2
3 const CATALOG: &str = include_str!("../assets/stickers.tsv");
3 const CATALOG: &str = include_str!("../../app/assets/stickers.tsv");
4 4 const IMAGE_BASE: &str = "https://statics.teams.cdn.office.net/evergreen-assets/stickerassets";
5 5 const IMAGE_VERSION: u32 = 5;
6 6 const POPULAR_IDS: [&str; 6] = [
@@ -1,6 +1,6 @@
1use std::sync::OnceLock;
1use std::sync::OnceLock;
2
2
3const CATALOG: &str = include_str!("../assets/stickers.tsv");
3const CATALOG: &str = include_str!("../../app/assets/stickers.tsv");
4const IMAGE_BASE: &str = "https://statics.teams.cdn.office.net/evergreen-assets/stickerassets";
4const IMAGE_BASE: &str = "https://statics.teams.cdn.office.net/evergreen-assets/stickerassets";
5const IMAGE_VERSION: u32 = 5;
5const IMAGE_VERSION: u32 = 5;
6const POPULAR_IDS: [&str; 6] = [
6const POPULAR_IDS: [&str; 6] = [
crates/app/src/task_dialog/host_page.html crates/app-base/src/task_dialog/host_page.html renamed +0 −0
crates/app-base/src/task_dialog/mod.rs added +1 −0
@@ -0,0 +1 @@
1 pub mod sdk;
@@ -0,0 +1 @@
1pub mod sdk;
crates/app/src/task_dialog/sdk.rs crates/app-base/src/task_dialog/sdk.rs renamed +0 −0
crates/app/src/theme.rs crates/app-base/src/theme.rs renamed +4 −4
@@ -7,10 +7,10 @@ const FONT_FAMILY: &str = "Google Sans Flex";
7 7 const MONO_FAMILIES: [&str; 2] = ["Cascadia Code", "Consolas"];
8 8 const BASE_FONT_SIZE: f32 = 14.;
9 9 const FONT_FILES: [&[u8]; 4] = [
10 include_bytes!("../assets/fonts/GoogleSansFlex-Regular.ttf"),
11 include_bytes!("../assets/fonts/GoogleSansFlex-SemiBold.ttf"),
12 include_bytes!("../assets/fonts/GoogleSansFlex-Bold.ttf"),
13 include_bytes!("../assets/fonts/GoogleSansFlex-Italic.ttf"),
10 include_bytes!("../../app/assets/fonts/GoogleSansFlex-Regular.ttf"),
11 include_bytes!("../../app/assets/fonts/GoogleSansFlex-SemiBold.ttf"),
12 include_bytes!("../../app/assets/fonts/GoogleSansFlex-Bold.ttf"),
13 include_bytes!("../../app/assets/fonts/GoogleSansFlex-Italic.ttf"),
14 14 ];
15 15
16 16 pub const BACKGROUND: u32 = 0x0f0f10;
@@ -7,10 +7,10 @@ const FONT_FAMILY: &str = "Google Sans Flex";
7const MONO_FAMILIES: [&str; 2] = ["Cascadia Code", "Consolas"];
7const MONO_FAMILIES: [&str; 2] = ["Cascadia Code", "Consolas"];
8const BASE_FONT_SIZE: f32 = 14.;
8const BASE_FONT_SIZE: f32 = 14.;
9const FONT_FILES: [&[u8]; 4] = [
9const FONT_FILES: [&[u8]; 4] = [
10 include_bytes!("../assets/fonts/GoogleSansFlex-Regular.ttf"),
10 include_bytes!("../../app/assets/fonts/GoogleSansFlex-Regular.ttf"),
11 include_bytes!("../assets/fonts/GoogleSansFlex-SemiBold.ttf"),
11 include_bytes!("../../app/assets/fonts/GoogleSansFlex-SemiBold.ttf"),
12 include_bytes!("../assets/fonts/GoogleSansFlex-Bold.ttf"),
12 include_bytes!("../../app/assets/fonts/GoogleSansFlex-Bold.ttf"),
13 include_bytes!("../assets/fonts/GoogleSansFlex-Italic.ttf"),
13 include_bytes!("../../app/assets/fonts/GoogleSansFlex-Italic.ttf"),
14];
14];
15
15
16pub const BACKGROUND: u32 = 0x0f0f10;
16pub const BACKGROUND: u32 = 0x0f0f10;
crates/app/src/translation.rs crates/app-base/src/translation.rs renamed +0 −0
crates/app/src/updater.rs crates/app-base/src/updater.rs renamed +2 −4
@@ -7,7 +7,6 @@ use std::time::Duration;
7 7
8 8 pub const POLL_INTERVAL: Duration = Duration::from_secs(15);
9 9
10 const VERSION_MARKER: &str = concat!("teams-build:", env!("TEAMS_BUILD_VERSION"));
11 10 const UPDATE_DIRECTORY: &str = "update";
12 11 const EXE_NAME: &str = "teams.exe";
13 12 const OLD_EXE_NAME: &str = "teams.old.exe";
@@ -20,7 +19,7 @@ const QUIT_GRACE: Duration = Duration::from_secs(3);
20 19 const PREVIOUS_EXIT_TIMEOUT: Duration = Duration::from_secs(30);
21 20
22 21 pub fn running_version() -> &'static str {
23 VERSION_MARKER.trim_start_matches("teams-build:")
22 crate::version::build_version()
24 23 }
25 24
26 25 #[derive(Debug, Clone, PartialEq, Eq)]
@@ -426,8 +425,7 @@ mod tests {
426 425 }
427 426
428 427 #[test]
429 fn running_version_has_no_marker_prefix() {
430 assert!(!running_version().starts_with("teams-build:"));
428 fn running_version_is_set() {
431 429 assert!(!running_version().is_empty());
432 430 }
433 431 }
@@ -7,7 +7,6 @@ use std::time::Duration;
7
7
8pub const POLL_INTERVAL: Duration = Duration::from_secs(15);
8pub const POLL_INTERVAL: Duration = Duration::from_secs(15);
9
9
10const VERSION_MARKER: &str = concat!("teams-build:", env!("TEAMS_BUILD_VERSION"));
11const UPDATE_DIRECTORY: &str = "update";
10const UPDATE_DIRECTORY: &str = "update";
12const EXE_NAME: &str = "teams.exe";
11const EXE_NAME: &str = "teams.exe";
13const OLD_EXE_NAME: &str = "teams.old.exe";
12const OLD_EXE_NAME: &str = "teams.old.exe";
@@ -20,7 +19,7 @@ const QUIT_GRACE: Duration = Duration::from_secs(3);
20const PREVIOUS_EXIT_TIMEOUT: Duration = Duration::from_secs(30);
19const PREVIOUS_EXIT_TIMEOUT: Duration = Duration::from_secs(30);
21
20
22pub fn running_version() -> &'static str {
21pub fn running_version() -> &'static str {
23 VERSION_MARKER.trim_start_matches("teams-build:")
22 crate::version::build_version()
24}
23}
25
24
26#[derive(Debug, Clone, PartialEq, Eq)]
25#[derive(Debug, Clone, PartialEq, Eq)]
@@ -426,8 +425,7 @@ mod tests {
426 }
425 }
427
426
428 #[test]
427 #[test]
429 fn running_version_has_no_marker_prefix() {
428 fn running_version_is_set() {
430 assert!(!running_version().starts_with("teams-build:"));
431 assert!(!running_version().is_empty());
429 assert!(!running_version().is_empty());
432 }
430 }
433}
431}
crates/app/src/user_activity.rs crates/app-base/src/user_activity.rs renamed +0 −0
crates/app-base/src/version.rs added +11 −0
@@ -0,0 +1,11 @@
1 use std::sync::OnceLock;
2
3 static BUILD_VERSION: OnceLock<&'static str> = OnceLock::new();
4
5 pub fn set_build_version(version: &'static str) {
6 let _ = BUILD_VERSION.set(version);
7 }
8
9 pub fn build_version() -> &'static str {
10 BUILD_VERSION.get().copied().unwrap_or("unknown")
11 }
@@ -0,0 +1,11 @@
1use std::sync::OnceLock;
2
3static BUILD_VERSION: OnceLock<&'static str> = OnceLock::new();
4
5pub fn set_build_version(version: &'static str) {
6 let _ = BUILD_VERSION.set(version);
7}
8
9pub fn build_version() -> &'static str {
10 BUILD_VERSION.get().copied().unwrap_or("unknown")
11}
crates/app/Cargo.toml +1 −22
@@ -18,6 +18,7 @@ gpui-kit = { workspace = true, features = ["test-support"] }
18 18 tempfile.workspace = true
19 19
20 20 [dependencies]
21 app-base.workspace = true
21 22 agents.workspace = true
22 23 calling.workspace = true
23 24 chatsvc.workspace = true
@@ -38,27 +39,5 @@ tokio.workspace = true
38 39 uuid.workspace = true
39 40 image = { version = "0.25", default-features = false, features = ["bmp", "gif", "jpeg", "png", "webp"] }
40 41
41 [target.'cfg(target_os = "linux")'.dependencies]
42 raw-window-handle = "0.6"
43 x11rb = { version = "0.13", features = ["shape"] }
44
45 42 [target.'cfg(windows)'.dependencies]
46 43 webview.workspace = true
47 raw-window-handle = "0.6"
48 rodio = { version = "0.22", default-features = false, features = ["playback", "mp3"] }
49 tray-icon = { version = "0.21", default-features = false }
50 windows = { version = "0.62", features = [
51 "Win32_Foundation",
52 "Win32_Graphics_Dwm",
53 "Win32_Graphics_Gdi",
54 "Win32_Security",
55 "Win32_Storage_FileSystem",
56 "Win32_System_Com",
57 "Win32_System_Pipes",
58 "Win32_System_SystemInformation",
59 "Win32_System_Threading",
60 "Win32_UI_HiDpi",
61 "Win32_UI_Input_KeyboardAndMouse",
62 "Win32_UI_Shell",
63 "Win32_UI_WindowsAndMessaging",
64 ] }
@@ -18,6 +18,7 @@ gpui-kit = { workspace = true, features = ["test-support"] }
18tempfile.workspace = true
18tempfile.workspace = true
19
19
20[dependencies]
20[dependencies]
21app-base.workspace = true
21agents.workspace = true
22agents.workspace = true
22calling.workspace = true
23calling.workspace = true
23chatsvc.workspace = true
24chatsvc.workspace = true
@@ -38,27 +39,5 @@ tokio.workspace = true
38uuid.workspace = true
39uuid.workspace = true
39image = { version = "0.25", default-features = false, features = ["bmp", "gif", "jpeg", "png", "webp"] }
40image = { version = "0.25", default-features = false, features = ["bmp", "gif", "jpeg", "png", "webp"] }
40
41
41[target.'cfg(target_os = "linux")'.dependencies]
42raw-window-handle = "0.6"
43x11rb = { version = "0.13", features = ["shape"] }
44
45[target.'cfg(windows)'.dependencies]
42[target.'cfg(windows)'.dependencies]
46webview.workspace = true
43webview.workspace = true
47raw-window-handle = "0.6"
48rodio = { version = "0.22", default-features = false, features = ["playback", "mp3"] }
49tray-icon = { version = "0.21", default-features = false }
50windows = { version = "0.62", features = [
51 "Win32_Foundation",
52 "Win32_Graphics_Dwm",
53 "Win32_Graphics_Gdi",
54 "Win32_Security",
55 "Win32_Storage_FileSystem",
56 "Win32_System_Com",
57 "Win32_System_Pipes",
58 "Win32_System_SystemInformation",
59 "Win32_System_Threading",
60 "Win32_UI_HiDpi",
61 "Win32_UI_Input_KeyboardAndMouse",
62 "Win32_UI_Shell",
63 "Win32_UI_WindowsAndMessaging",
64] }
crates/app/src/agent_api/mod.rs +1 −2
@@ -1,6 +1,4 @@
1 1 mod bridge;
2 mod extras;
3 mod image_scale;
4 2 mod source;
5 3
6 4 use std::collections::{BTreeSet, HashMap};
@@ -14,6 +12,7 @@ use mcp::{
14 12 ReactionProposal, ServerHandle,
15 13 };
16 14 use store::Store;
15 use app_base::agent_api::{extras, image_scale};
17 16
18 17 use crate::backend::Engine;
19 18 use crate::runtime;
@@ -1,6 +1,4 @@
1mod bridge;
1mod bridge;
2mod extras;
3mod image_scale;
4mod source;
2mod source;
5
3
6use std::collections::{BTreeSet, HashMap};
4use std::collections::{BTreeSet, HashMap};
@@ -14,6 +12,7 @@ use mcp::{
14 ReactionProposal, ServerHandle,
12 ReactionProposal, ServerHandle,
15};
13};
16use store::Store;
14use store::Store;
15use app_base::agent_api::{extras, image_scale};
17
16
18use crate::backend::Engine;
17use crate::backend::Engine;
19use crate::runtime;
18use crate::runtime;
crates/app/src/agents/mod.rs +1 −2
@@ -1,6 +1,5 @@
1 1 mod demo;
2 2 mod kills;
3 mod lanes;
4 3 mod mcp_bridge;
5 4 mod message_context;
6 5 mod run_chip;
@@ -9,7 +8,6 @@ mod runs_popover;
9 8 mod session_options;
10 9 mod settings_controls;
11 10 mod settings_forms;
12 mod settings_problems;
13 11 mod settings_section;
14 12 mod spinner;
15 13 mod start_dialog;
@@ -19,6 +17,7 @@ mod store;
19 17 use std::path::PathBuf;
20 18 use std::time::Duration;
21 19
20 use app_base::agents::{lanes, settings_problems};
22 21 use agents::{AgentAction, Environment};
23 22 use directories::ProjectDirs;
24 23 use gpui_kit::*;
@@ -1,6 +1,5 @@
1mod demo;
1mod demo;
2mod kills;
2mod kills;
3mod lanes;
4mod mcp_bridge;
3mod mcp_bridge;
5mod message_context;
4mod message_context;
6mod run_chip;
5mod run_chip;
@@ -9,7 +8,6 @@ mod runs_popover;
9mod session_options;
8mod session_options;
10mod settings_controls;
9mod settings_controls;
11mod settings_forms;
10mod settings_forms;
12mod settings_problems;
13mod settings_section;
11mod settings_section;
14mod spinner;
12mod spinner;
15mod start_dialog;
13mod start_dialog;
@@ -19,6 +17,7 @@ mod store;
19use std::path::PathBuf;
17use std::path::PathBuf;
20use std::time::Duration;
18use std::time::Duration;
21
19
20use app_base::agents::{lanes, settings_problems};
22use agents::{AgentAction, Environment};
21use agents::{AgentAction, Environment};
23use directories::ProjectDirs;
22use directories::ProjectDirs;
24use gpui_kit::*;
23use gpui_kit::*;
crates/app/src/emoji/mod.rs +1 −1
@@ -1,6 +1,6 @@
1 1 mod recent;
2 mod typing;
3 2
3 use app_base::emoji::typing;
4 4 use std::ops::Range;
5 5 use std::sync::OnceLock;
6 6
@@ -1,6 +1,6 @@
1mod recent;
1mod recent;
2mod typing;
3
2
3use app_base::emoji::typing;
4use std::ops::Range;
4use std::ops::Range;
5use std::sync::OnceLock;
5use std::sync::OnceLock;
6
6
crates/app/src/layout_guard.rs +63 −20
@@ -10,6 +10,22 @@ const SCAN_ALLOWLIST: &[(&str, &str)] = &[
10 10 ("views/conversation.rs", ".bottom(px(-1.))"),
11 11 ];
12 12
13 fn source_roots() -> Vec<PathBuf> {
14 let crates_directory = Path::new(env!("CARGO_MANIFEST_DIR")).join("..");
15 let mut roots: Vec<PathBuf> = fs::read_dir(&crates_directory)
16 .expect("read crates directory")
17 .map(|entry| entry.expect("directory entry").path())
18 .filter(|path| {
19 path.file_name()
20 .is_some_and(|name| name.to_string_lossy().starts_with("app"))
21 })
22 .map(|path| path.join("src"))
23 .filter(|path| path.is_dir())
24 .collect();
25 roots.sort();
26 roots
27 }
28
13 29 fn source_files(directory: &Path, files: &mut Vec<PathBuf>) {
14 30 for entry in fs::read_dir(directory).expect("read source directory") {
15 31 let path = entry.expect("directory entry").path();
@@ -64,30 +80,31 @@ fn matcher_matches_allowlist_from_match_start() {
64 80
65 81 #[test]
66 82 fn negative_offsets_go_through_corner_badge() {
67 let root = Path::new(env!("CARGO_MANIFEST_DIR")).join("src");
68 83 let pattern = offset_pattern();
69 let mut files = Vec::new();
70 source_files(&root, &mut files);
71 84 let mut matched_allowlist = HashSet::new();
72 85 let mut violations = Vec::new();
73 for file in files {
74 let relative = file
75 .strip_prefix(&root)
76 .expect("inside src")
77 .to_string_lossy()
78 .replace('\\', "/");
79 if relative == WIDGETS_FILE || relative == "layout_guard.rs" {
80 continue;
81 }
82 let source = fs::read_to_string(&file).expect("read source file");
83 for (line_number, position, text) in negative_offsets(&pattern, &source, &relative) {
84 match position {
85 Some(position) => {
86 matched_allowlist.insert(position);
86 for root in source_roots() {
87 let mut files = Vec::new();
88 source_files(&root, &mut files);
89 for file in files {
90 let relative = file
91 .strip_prefix(&root)
92 .expect("inside src")
93 .to_string_lossy()
94 .replace('\\', "/");
95 if relative == WIDGETS_FILE || relative == "layout_guard.rs" {
96 continue;
97 }
98 let source = fs::read_to_string(&file).expect("read source file");
99 for (line_number, position, text) in negative_offsets(&pattern, &source, &relative) {
100 match position {
101 Some(position) => {
102 matched_allowlist.insert(position);
103 }
104 None => violations.push(format!(
105 "{relative}:{line_number}: negative absolute offset, use widgets::corner_badge: {text}"
106 )),
87 107 }
88 None => violations.push(format!(
89 "{relative}:{line_number}: negative absolute offset, use widgets::corner_badge: {text}"
90 )),
91 108 }
92 109 }
93 110 }
@@ -108,6 +125,32 @@ fn negative_offsets_go_through_corner_badge() {
108 125 );
109 126 }
110 127
128 #[test]
129 fn hover_styles_never_toggle_display() {
130 let toggle =
131 Regex::new(r"hover\([^|]*\|\w+\|\s*\w+\s*\.\s*(hidden|flex|block|grid)\(\)").unwrap();
132 let mut files = Vec::new();
133 for root in source_roots() {
134 source_files(&root, &mut files);
135 }
136 let offenders: Vec<String> = files
137 .iter()
138 .flat_map(|path| {
139 let source = fs::read_to_string(path).unwrap();
140 source
141 .lines()
142 .enumerate()
143 .filter(|(_, line)| toggle.is_match(line))
144 .map(|(index, _)| format!("{}:{}", path.display(), index + 1))
145 .collect::<Vec<_>>()
146 })
147 .collect();
148 assert!(
149 offenders.is_empty(),
150 "hover styles must toggle visible()/invisible(), not display (gpui panics \"must call prepaint before paint\"): {offenders:?}"
151 );
152 }
153
111 154 mod frames {
112 155 use std::collections::HashSet;
113 156 use std::sync::Arc;
@@ -10,6 +10,22 @@ const SCAN_ALLOWLIST: &[(&str, &str)] = &[
10 ("views/conversation.rs", ".bottom(px(-1.))"),
10 ("views/conversation.rs", ".bottom(px(-1.))"),
11];
11];
12
12
13fn source_roots() -> Vec<PathBuf> {
14 let crates_directory = Path::new(env!("CARGO_MANIFEST_DIR")).join("..");
15 let mut roots: Vec<PathBuf> = fs::read_dir(&crates_directory)
16 .expect("read crates directory")
17 .map(|entry| entry.expect("directory entry").path())
18 .filter(|path| {
19 path.file_name()
20 .is_some_and(|name| name.to_string_lossy().starts_with("app"))
21 })
22 .map(|path| path.join("src"))
23 .filter(|path| path.is_dir())
24 .collect();
25 roots.sort();
26 roots
27}
28
13fn source_files(directory: &Path, files: &mut Vec<PathBuf>) {
29fn source_files(directory: &Path, files: &mut Vec<PathBuf>) {
14 for entry in fs::read_dir(directory).expect("read source directory") {
30 for entry in fs::read_dir(directory).expect("read source directory") {
15 let path = entry.expect("directory entry").path();
31 let path = entry.expect("directory entry").path();
@@ -64,30 +80,31 @@ fn matcher_matches_allowlist_from_match_start() {
64
80
65#[test]
81#[test]
66fn negative_offsets_go_through_corner_badge() {
82fn negative_offsets_go_through_corner_badge() {
67 let root = Path::new(env!("CARGO_MANIFEST_DIR")).join("src");
68 let pattern = offset_pattern();
83 let pattern = offset_pattern();
69 let mut files = Vec::new();
70 source_files(&root, &mut files);
71 let mut matched_allowlist = HashSet::new();
84 let mut matched_allowlist = HashSet::new();
72 let mut violations = Vec::new();
85 let mut violations = Vec::new();
73 for file in files {
86 for root in source_roots() {
74 let relative = file
87 let mut files = Vec::new();
75 .strip_prefix(&root)
88 source_files(&root, &mut files);
76 .expect("inside src")
89 for file in files {
77 .to_string_lossy()
90 let relative = file
78 .replace('\\', "/");
91 .strip_prefix(&root)
79 if relative == WIDGETS_FILE || relative == "layout_guard.rs" {
92 .expect("inside src")
80 continue;
93 .to_string_lossy()
81 }
94 .replace('\\', "/");
82 let source = fs::read_to_string(&file).expect("read source file");
95 if relative == WIDGETS_FILE || relative == "layout_guard.rs" {
83 for (line_number, position, text) in negative_offsets(&pattern, &source, &relative) {
96 continue;
84 match position {
97 }
85 Some(position) => {
98 let source = fs::read_to_string(&file).expect("read source file");
86 matched_allowlist.insert(position);
99 for (line_number, position, text) in negative_offsets(&pattern, &source, &relative) {
100 match position {
101 Some(position) => {
102 matched_allowlist.insert(position);
103 }
104 None => violations.push(format!(
105 "{relative}:{line_number}: negative absolute offset, use widgets::corner_badge: {text}"
106 )),
87 }
107 }
88 None => violations.push(format!(
89 "{relative}:{line_number}: negative absolute offset, use widgets::corner_badge: {text}"
90 )),
91 }
108 }
92 }
109 }
93 }
110 }
@@ -108,6 +125,32 @@ fn negative_offsets_go_through_corner_badge() {
108 );
125 );
109}
126}
110
127
128#[test]
129fn hover_styles_never_toggle_display() {
130 let toggle =
131 Regex::new(r"hover\([^|]*\|\w+\|\s*\w+\s*\.\s*(hidden|flex|block|grid)\(\)").unwrap();
132 let mut files = Vec::new();
133 for root in source_roots() {
134 source_files(&root, &mut files);
135 }
136 let offenders: Vec<String> = files
137 .iter()
138 .flat_map(|path| {
139 let source = fs::read_to_string(path).unwrap();
140 source
141 .lines()
142 .enumerate()
143 .filter(|(_, line)| toggle.is_match(line))
144 .map(|(index, _)| format!("{}:{}", path.display(), index + 1))
145 .collect::<Vec<_>>()
146 })
147 .collect();
148 assert!(
149 offenders.is_empty(),
150 "hover styles must toggle visible()/invisible(), not display (gpui panics \"must call prepaint before paint\"): {offenders:?}"
151 );
152}
153
111mod frames {
154mod frames {
112 use std::collections::HashSet;
155 use std::collections::HashSet;
113 use std::sync::Arc;
156 use std::sync::Arc;
crates/app/src/main.rs +9 −29
@@ -7,35 +7,19 @@ mod activity;
7 7 mod agent_api;
8 8 mod agents;
9 9 mod app_state;
10 mod assets;
11 mod avatar_image;
12 10 mod backend;
13 11 mod call;
14 12 mod card_actions;
15 13 mod card_inputs;
16 14 mod card_refresh;
17 15 mod card_state;
18 mod channel_files;
19 16 mod chat_actions;
20 mod crash_log;
21 17 mod data;
22 18 mod demo;
23 mod demo_cards;
24 mod demo_chart_cards;
25 mod demo_gifs;
26 mod demo_input_cards;
27 mod demo_library;
28 19 mod demo_profiles;
29 mod demo_recap;
30 mod diagnostics;
31 mod downloads;
32 20 mod emoji;
33 mod format;
34 mod frame_log;
35 mod fuzzy;
36 21 mod gifs;
37 22 mod image_view_gallery;
38 mod image_view_math;
39 23 #[cfg(test)]
40 24 mod layout_guard;
41 25 mod local_previews;
@@ -46,33 +30,28 @@ mod outbox;
46 30 mod own_status;
47 31 mod pending_rows;
48 32 mod people;
49 mod presence_link;
50 33 mod profile_model;
51 34 mod profile_state;
52 35 mod reaction_model;
53 mod read_state;
54 mod recap;
55 mod remote_image;
56 36 mod render;
57 37 mod rows;
58 mod runtime;
59 mod schedule_time;
60 38 mod scheduled;
61 39 mod scheduled_rows;
62 40 mod section_actions;
63 41 mod sidebar_model;
64 mod single_instance;
65 mod stickers;
66 42 mod stored_outgoing;
67 43 mod task_dialog;
68 mod theme;
69 mod translation;
70 44 mod translation_actions;
71 45 mod typing;
72 mod updater;
73 mod user_activity;
74 46 mod views;
75 47
48 pub use app_base::{
49 APP_NAME, assets, avatar_image, channel_files, crash_log, demo_cards, demo_chart_cards, demo_gifs,
50 demo_input_cards, demo_library, demo_recap, diagnostics, downloads, format, frame_log, fuzzy,
51 image_view_math, presence_link, read_state, recap, remote_image, runtime, schedule_time,
52 single_instance, stickers, theme, translation, updater, user_activity,
53 };
54
76 55 use std::path::PathBuf;
77 56 use std::sync::Arc;
78 57 use std::time::Duration;
@@ -85,7 +64,7 @@ use store::Store;
85 64 use app_state::{AppState, Mode};
86 65 use views::shell::{AppShell, OpenTarget, Startup, bind_keys};
87 66
88 pub const APP_NAME: &str = "Rusty Teams";
67 const VERSION_MARKER: &str = concat!("teams-build:", env!("TEAMS_BUILD_VERSION"));
89 68 const HTTP_USER_AGENT: &str = "teams-linux";
90 69 const WINDOW_WIDTH: f32 = 1240.;
91 70 const WINDOW_HEIGHT: f32 = 820.;
@@ -195,6 +174,7 @@ fn open_store(path: &std::path::Path) -> Store {
195 174 }
196 175
197 176 fn main() {
177 app_base::version::set_build_version(VERSION_MARKER.trim_start_matches("teams-build:"));
198 178 crash_log::install(data_path(crash_log::CRASH_LOG_FILE));
199 179 diagnostics::install(data_path(diagnostics::DIAGNOSTICS_FILE));
200 180 let arguments = parse_arguments();
@@ -7,35 +7,19 @@ mod activity;
7mod agent_api;
7mod agent_api;
8mod agents;
8mod agents;
9mod app_state;
9mod app_state;
10mod assets;
11mod avatar_image;
12mod backend;
10mod backend;
13mod call;
11mod call;
14mod card_actions;
12mod card_actions;
15mod card_inputs;
13mod card_inputs;
16mod card_refresh;
14mod card_refresh;
17mod card_state;
15mod card_state;
18mod channel_files;
19mod chat_actions;
16mod chat_actions;
20mod crash_log;
21mod data;
17mod data;
22mod demo;
18mod demo;
23mod demo_cards;
24mod demo_chart_cards;
25mod demo_gifs;
26mod demo_input_cards;
27mod demo_library;
28mod demo_profiles;
19mod demo_profiles;
29mod demo_recap;
30mod diagnostics;
31mod downloads;
32mod emoji;
20mod emoji;
33mod format;
34mod frame_log;
35mod fuzzy;
36mod gifs;
21mod gifs;
37mod image_view_gallery;
22mod image_view_gallery;
38mod image_view_math;
39#[cfg(test)]
23#[cfg(test)]
40mod layout_guard;
24mod layout_guard;
41mod local_previews;
25mod local_previews;
@@ -46,33 +30,28 @@ mod outbox;
46mod own_status;
30mod own_status;
47mod pending_rows;
31mod pending_rows;
48mod people;
32mod people;
49mod presence_link;
50mod profile_model;
33mod profile_model;
51mod profile_state;
34mod profile_state;
52mod reaction_model;
35mod reaction_model;
53mod read_state;
54mod recap;
55mod remote_image;
56mod render;
36mod render;
57mod rows;
37mod rows;
58mod runtime;
59mod schedule_time;
60mod scheduled;
38mod scheduled;
61mod scheduled_rows;
39mod scheduled_rows;
62mod section_actions;
40mod section_actions;
63mod sidebar_model;
41mod sidebar_model;
64mod single_instance;
65mod stickers;
66mod stored_outgoing;
42mod stored_outgoing;
67mod task_dialog;
43mod task_dialog;
68mod theme;
69mod translation;
70mod translation_actions;
44mod translation_actions;
71mod typing;
45mod typing;
72mod updater;
73mod user_activity;
74mod views;
46mod views;
75
47
48pub use app_base::{
49 APP_NAME, assets, avatar_image, channel_files, crash_log, demo_cards, demo_chart_cards, demo_gifs,
50 demo_input_cards, demo_library, demo_recap, diagnostics, downloads, format, frame_log, fuzzy,
51 image_view_math, presence_link, read_state, recap, remote_image, runtime, schedule_time,
52 single_instance, stickers, theme, translation, updater, user_activity,
53};
54
76use std::path::PathBuf;
55use std::path::PathBuf;
77use std::sync::Arc;
56use std::sync::Arc;
78use std::time::Duration;
57use std::time::Duration;
@@ -85,7 +64,7 @@ use store::Store;
85use app_state::{AppState, Mode};
64use app_state::{AppState, Mode};
86use views::shell::{AppShell, OpenTarget, Startup, bind_keys};
65use views::shell::{AppShell, OpenTarget, Startup, bind_keys};
87
66
88pub const APP_NAME: &str = "Rusty Teams";
67const VERSION_MARKER: &str = concat!("teams-build:", env!("TEAMS_BUILD_VERSION"));
89const HTTP_USER_AGENT: &str = "teams-linux";
68const HTTP_USER_AGENT: &str = "teams-linux";
90const WINDOW_WIDTH: f32 = 1240.;
69const WINDOW_WIDTH: f32 = 1240.;
91const WINDOW_HEIGHT: f32 = 820.;
70const WINDOW_HEIGHT: f32 = 820.;
@@ -195,6 +174,7 @@ fn open_store(path: &std::path::Path) -> Store {
195}
174}
196
175
197fn main() {
176fn main() {
177 app_base::version::set_build_version(VERSION_MARKER.trim_start_matches("teams-build:"));
198 crash_log::install(data_path(crash_log::CRASH_LOG_FILE));
178 crash_log::install(data_path(crash_log::CRASH_LOG_FILE));
199 diagnostics::install(data_path(diagnostics::DIAGNOSTICS_FILE));
179 diagnostics::install(data_path(diagnostics::DIAGNOSTICS_FILE));
200 let arguments = parse_arguments();
180 let arguments = parse_arguments();
crates/app/src/notify/mod.rs +1 −6
@@ -1,14 +1,8 @@
1 1 mod agent_toast;
2 #[cfg_attr(not(windows), allow(dead_code))]
3 mod badge;
4 2 mod center;
5 3 mod incoming;
6 4 mod layout;
7 5 mod meeting_view;
8 #[cfg_attr(not(windows), allow(dead_code))]
9 pub(crate) mod platform;
10 #[cfg_attr(not(windows), allow(dead_code))]
11 mod ring_tone;
12 6 mod ring_view;
13 7 mod rules;
14 8 mod settings;
@@ -18,6 +12,7 @@ mod stack;
18 12 mod text;
19 13 mod toast;
20 14
15 pub use app_base::notify::{badge, platform, ring_tone};
21 16 pub use center::{NotificationCenter, selection_for};
22 17 pub use incoming::{IncomingTracker, preview_of};
23 18 #[cfg(windows)]
@@ -1,14 +1,8 @@
1mod agent_toast;
1mod agent_toast;
2#[cfg_attr(not(windows), allow(dead_code))]
3mod badge;
4mod center;
2mod center;
5mod incoming;
3mod incoming;
6mod layout;
4mod layout;
7mod meeting_view;
5mod meeting_view;
8#[cfg_attr(not(windows), allow(dead_code))]
9pub(crate) mod platform;
10#[cfg_attr(not(windows), allow(dead_code))]
11mod ring_tone;
12mod ring_view;
6mod ring_view;
13mod rules;
7mod rules;
14mod settings;
8mod settings;
@@ -18,6 +12,7 @@ mod stack;
18mod text;
12mod text;
19mod toast;
13mod toast;
20
14
15pub use app_base::notify::{badge, platform, ring_tone};
21pub use center::{NotificationCenter, selection_for};
16pub use center::{NotificationCenter, selection_for};
22pub use incoming::{IncomingTracker, preview_of};
17pub use incoming::{IncomingTracker, preview_of};
23#[cfg(windows)]
18#[cfg(windows)]
crates/app/src/task_dialog.rs +2 −2
@@ -7,8 +7,8 @@ use crate::card_state::CardScope;
7 7
8 8 #[cfg(windows)]
9 9 mod hosted;
10 #[cfg_attr(not(windows), allow(dead_code))]
11 mod sdk;
10 #[cfg(windows)]
11 use app_base::task_dialog::sdk;
12 12
13 13 #[cfg(windows)]
14 14 pub use hosted::install_host;
@@ -7,8 +7,8 @@ use crate::card_state::CardScope;
7
7
8#[cfg(windows)]
8#[cfg(windows)]
9mod hosted;
9mod hosted;
10#[cfg_attr(not(windows), allow(dead_code))]
10#[cfg(windows)]
11mod sdk;
11use app_base::task_dialog::sdk;
12
12
13#[cfg(windows)]
13#[cfg(windows)]
14pub use hosted::install_host;
14pub use hosted::install_host;
crates/app/src/views/mod.rs +0 −44
@@ -72,47 +72,3 @@ pub mod toolbar_placement;
72 72 pub mod transfer_picker;
73 73 pub mod translation_line;
74 74 pub mod widgets;
75
76 #[cfg(test)]
77 mod tests {
78 use std::path::Path;
79
80 fn rust_files(directory: &Path, files: &mut Vec<std::path::PathBuf>) {
81 for entry in std::fs::read_dir(directory).unwrap() {
82 let path = entry.unwrap().path();
83 if path.is_dir() {
84 rust_files(&path, files);
85 } else if path.extension().is_some_and(|extension| extension == "rs") {
86 files.push(path);
87 }
88 }
89 }
90
91 #[test]
92 fn hover_styles_never_toggle_display() {
93 let toggle =
94 regex::Regex::new(r"hover\([^|]*\|\w+\|\s*\w+\s*\.\s*(hidden|flex|block|grid)\(\)")
95 .unwrap();
96 let mut files = Vec::new();
97 rust_files(
98 &Path::new(env!("CARGO_MANIFEST_DIR")).join("src"),
99 &mut files,
100 );
101 let offenders: Vec<String> = files
102 .iter()
103 .flat_map(|path| {
104 let source = std::fs::read_to_string(path).unwrap();
105 source
106 .lines()
107 .enumerate()
108 .filter(|(_, line)| toggle.is_match(line))
109 .map(|(index, _)| format!("{}:{}", path.display(), index + 1))
110 .collect::<Vec<_>>()
111 })
112 .collect();
113 assert!(
114 offenders.is_empty(),
115 "hover styles must toggle visible()/invisible(), not display (gpui panics \"must call prepaint before paint\"): {offenders:?}"
116 );
117 }
118 }
@@ -72,47 +72,3 @@ pub mod toolbar_placement;
72pub mod transfer_picker;
72pub mod transfer_picker;
73pub mod translation_line;
73pub mod translation_line;
74pub mod widgets;
74pub mod widgets;
75
76#[cfg(test)]
77mod tests {
78 use std::path::Path;
79
80 fn rust_files(directory: &Path, files: &mut Vec<std::path::PathBuf>) {
81 for entry in std::fs::read_dir(directory).unwrap() {
82 let path = entry.unwrap().path();
83 if path.is_dir() {
84 rust_files(&path, files);
85 } else if path.extension().is_some_and(|extension| extension == "rs") {
86 files.push(path);
87 }
88 }
89 }
90
91 #[test]
92 fn hover_styles_never_toggle_display() {
93 let toggle =
94 regex::Regex::new(r"hover\([^|]*\|\w+\|\s*\w+\s*\.\s*(hidden|flex|block|grid)\(\)")
95 .unwrap();
96 let mut files = Vec::new();
97 rust_files(
98 &Path::new(env!("CARGO_MANIFEST_DIR")).join("src"),
99 &mut files,
100 );
101 let offenders: Vec<String> = files
102 .iter()
103 .flat_map(|path| {
104 let source = std::fs::read_to_string(path).unwrap();
105 source
106 .lines()
107 .enumerate()
108 .filter(|(_, line)| toggle.is_match(line))
109 .map(|(index, _)| format!("{}:{}", path.display(), index + 1))
110 .collect::<Vec<_>>()
111 })
112 .collect();
113 assert!(
114 offenders.is_empty(),
115 "hover styles must toggle visible()/invisible(), not display (gpui panics \"must call prepaint before paint\"): {offenders:?}"
116 );
117 }
118}