BlueGit

ict rusty-teams

refactor(app): extract app-ui-kit 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
3e25d31a181acb50c7328f1a4bf9f59898b465b3
Parent
8629da58
30 files changed +126 −64
Cargo.lock +11 −2
@@ -278,6 +278,7 @@ dependencies = [
278 278 "agents",
279 279 "app-base",
280 280 "app-call-model",
281 "app-ui-kit",
281 282 "calling",
282 283 "chatsvc",
283 284 "chrono",
@@ -354,6 +355,16 @@ dependencies = [
354 355 "uuid",
355 356 ]
356 357
358 [[package]]
359 name = "app-ui-kit"
360 version = "0.1.0"
361 dependencies = [
362 "app-base",
363 "gpui-kit",
364 "store",
365 "teams-core",
366 ]
367
357 368 [[package]]
358 369 name = "arbitrary"
359 370 version = "1.5.0"
@@ -4029,8 +4040,6 @@ dependencies = [
4029 4040 [[package]]
4030 4041 name = "gpui-pre-windows"
4031 4042 version = "0.3.8"
4032 source = "registry+https://github.com/rust-lang/crates.io-index"
4033 checksum = "371f9bb13f97e3bea2f8b8e5e81232bb74d735153c244ae67f7400e743925b1c"
4034 4043 dependencies = [
4035 4044 "accesskit",
4036 4045 "accesskit_windows",
@@ -278,6 +278,7 @@ dependencies = [
278 "agents",
278 "agents",
279 "app-base",
279 "app-base",
280 "app-call-model",
280 "app-call-model",
281 "app-ui-kit",
281 "calling",
282 "calling",
282 "chatsvc",
283 "chatsvc",
283 "chrono",
284 "chrono",
@@ -354,6 +355,16 @@ dependencies = [
354 "uuid",
355 "uuid",
355]
356]
356
357
358[[package]]
359name = "app-ui-kit"
360version = "0.1.0"
361dependencies = [
362 "app-base",
363 "gpui-kit",
364 "store",
365 "teams-core",
366]
367
357[[package]]
368[[package]]
358name = "arbitrary"
369name = "arbitrary"
359version = "1.5.0"
370version = "1.5.0"
@@ -4029,8 +4040,6 @@ dependencies = [
4029[[package]]
4040[[package]]
4030name = "gpui-pre-windows"
4041name = "gpui-pre-windows"
4031version = "0.3.8"
4042version = "0.3.8"
4032source = "registry+https://github.com/rust-lang/crates.io-index"
4033checksum = "371f9bb13f97e3bea2f8b8e5e81232bb74d735153c244ae67f7400e743925b1c"
4034dependencies = [
4043dependencies = [
4035 "accesskit",
4044 "accesskit",
4036 "accesskit_windows",
4045 "accesskit_windows",
Cargo.toml +4 −0
@@ -30,6 +30,7 @@ uuid = { version = "1", default-features = false, features = ["v4"] }
30 30
31 31 app-base = { path = "crates/app-base" }
32 32 app-call-model = { path = "crates/app-call-model" }
33 app-ui-kit = { path = "crates/app-ui-kit" }
33 34 agents = { path = "crates/agents" }
34 35 session = { path = "crates/session" }
35 36 graph = { path = "crates/graph" }
@@ -62,3 +63,6 @@ opt-level = 1
62 63
63 64 [profile.release.package.app-call-model]
64 65 opt-level = 1
66
67 [profile.release.package.app-ui-kit]
68 opt-level = 1
@@ -30,6 +30,7 @@ uuid = { version = "1", default-features = false, features = ["v4"] }
30
30
31app-base = { path = "crates/app-base" }
31app-base = { path = "crates/app-base" }
32app-call-model = { path = "crates/app-call-model" }
32app-call-model = { path = "crates/app-call-model" }
33app-ui-kit = { path = "crates/app-ui-kit" }
33agents = { path = "crates/agents" }
34agents = { path = "crates/agents" }
34session = { path = "crates/session" }
35session = { path = "crates/session" }
35graph = { path = "crates/graph" }
36graph = { path = "crates/graph" }
@@ -62,3 +63,6 @@ opt-level = 1
62
63
63[profile.release.package.app-call-model]
64[profile.release.package.app-call-model]
64opt-level = 1
65opt-level = 1
66
67[profile.release.package.app-ui-kit]
68opt-level = 1
crates/app-ui-kit/Cargo.toml added +15 −0
@@ -0,0 +1,15 @@
1 [package]
2 name = "app-ui-kit"
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
11 [dependencies]
12 app-base.workspace = true
13 gpui-kit.workspace = true
14 store.workspace = true
15 teams-core.workspace = true
@@ -0,0 +1,15 @@
1[package]
2name = "app-ui-kit"
3edition.workspace = true
4version.workspace = true
5license.workspace = true
6publish.workspace = true
7
8[dev-dependencies]
9gpui-kit = { workspace = true, features = ["test-support"] }
10
11[dependencies]
12app-base.workspace = true
13gpui-kit.workspace = true
14store.workspace = true
15teams-core.workspace = true
crates/app/src/views/card_chart.rs crates/app-ui-kit/src/card_chart.rs renamed +1 −1
@@ -10,7 +10,7 @@ use teams_core::{
10 10 series_maximum, series_value, slice_angles, unit_fraction,
11 11 };
12 12
13 use crate::theme;
13 use app_base::theme;
14 14
15 15 const CHART_HEIGHT: f32 = 200.;
16 16 const GAUGE_HEIGHT: f32 = 136.;
@@ -10,7 +10,7 @@ use teams_core::{
10 series_maximum, series_value, slice_angles, unit_fraction,
10 series_maximum, series_value, slice_angles, unit_fraction,
11};
11};
12
12
13use crate::theme;
13use app_base::theme;
14
14
15const CHART_HEIGHT: f32 = 200.;
15const CHART_HEIGHT: f32 = 200.;
16const GAUGE_HEIGHT: f32 = 136.;
16const GAUGE_HEIGHT: f32 = 136.;
crates/app/src/views/channel_tabs.rs crates/app-ui-kit/src/channel_tabs.rs renamed +1 −1
@@ -10,7 +10,7 @@ use gpui_kit::*;
10 10 use store::ChannelTabRecord;
11 11 use teams_core::channel_tab_link;
12 12
13 use crate::theme;
13 use app_base::theme;
14 14
15 15 const BAR_HEIGHT: f32 = 36.;
16 16 const TAB_HEIGHT: f32 = 28.;
@@ -10,7 +10,7 @@ use gpui_kit::*;
10use store::ChannelTabRecord;
10use store::ChannelTabRecord;
11use teams_core::channel_tab_link;
11use teams_core::channel_tab_link;
12
12
13use crate::theme;
13use app_base::theme;
14
14
15const BAR_HEIGHT: f32 = 36.;
15const BAR_HEIGHT: f32 = 36.;
16const TAB_HEIGHT: f32 = 28.;
16const TAB_HEIGHT: f32 = 28.;
crates/app/src/views/draft_style.rs crates/app-ui-kit/src/draft_style.rs renamed +1 −1
@@ -5,7 +5,7 @@ use gpui_kit::*;
5 5 use teams_core::{Draft, FontSize, LineKind, MarkKind, SizeStep};
6 6
7 7 use crate::render::blocks::{Script, StyleFlags};
8 use crate::theme;
8 use app_base::theme;
9 9
10 10 const CODE_PILL_RADIUS: f32 = 4.;
11 11 const CODE_BLOCK_RADIUS: f32 = 6.;
@@ -5,7 +5,7 @@ use gpui_kit::*;
5use teams_core::{Draft, FontSize, LineKind, MarkKind, SizeStep};
5use teams_core::{Draft, FontSize, LineKind, MarkKind, SizeStep};
6
6
7use crate::render::blocks::{Script, StyleFlags};
7use crate::render::blocks::{Script, StyleFlags};
8use crate::theme;
8use app_base::theme;
9
9
10const CODE_PILL_RADIUS: f32 = 4.;
10const CODE_PILL_RADIUS: f32 = 4.;
11const CODE_BLOCK_RADIUS: f32 = 6.;
11const CODE_BLOCK_RADIUS: f32 = 6.;
crates/app-ui-kit/src/layout.rs added +4 −0
@@ -0,0 +1,4 @@
1 pub const ISLAND_GAP: f32 = 6.;
2 pub const RAIL_ITEM_WIDTH: f32 = 48.;
3 pub const RAIL_WIDTH: f32 = RAIL_ITEM_WIDTH + 2. * ISLAND_GAP;
4 pub const SIDEBAR_WIDTH: f32 = 300.;
@@ -0,0 +1,4 @@
1pub const ISLAND_GAP: f32 = 6.;
2pub const RAIL_ITEM_WIDTH: f32 = 48.;
3pub const RAIL_WIDTH: f32 = RAIL_ITEM_WIDTH + 2. * ISLAND_GAP;
4pub const SIDEBAR_WIDTH: f32 = 300.;
crates/app-ui-kit/src/lib.rs added +9 −0
@@ -0,0 +1,9 @@
1 pub mod card_chart;
2 pub mod channel_tabs;
3 pub mod draft_style;
4 pub mod layout;
5 pub mod reaction_proposal_pill;
6 pub mod render;
7 pub mod settings_controls;
8 pub mod spinner;
9 pub mod widgets;
@@ -0,0 +1,9 @@
1pub mod card_chart;
2pub mod channel_tabs;
3pub mod draft_style;
4pub mod layout;
5pub mod reaction_proposal_pill;
6pub mod render;
7pub mod settings_controls;
8pub mod spinner;
9pub mod widgets;
crates/app/src/views/reaction_proposal_pill.rs crates/app-ui-kit/src/reaction_proposal_pill.rs renamed +1 −1
@@ -3,7 +3,7 @@ use std::rc::Rc;
3 3 use gpui_kit::component::h_flex;
4 4 use gpui_kit::*;
5 5
6 use crate::theme;
6 use app_base::theme;
7 7
8 8 const PILL_HEIGHT: f32 = 26.;
9 9 const PILL_PADDING: f32 = 10.;
@@ -3,7 +3,7 @@ use std::rc::Rc;
3use gpui_kit::component::h_flex;
3use gpui_kit::component::h_flex;
4use gpui_kit::*;
4use gpui_kit::*;
5
5
6use crate::theme;
6use app_base::theme;
7
7
8const PILL_HEIGHT: f32 = 26.;
8const PILL_HEIGHT: f32 = 26.;
9const PILL_PADDING: f32 = 10.;
9const PILL_PADDING: f32 = 10.;
crates/app/src/render/blocks.rs crates/app-ui-kit/src/render/blocks.rs renamed +0 −0
crates/app/src/render/elements.rs crates/app-ui-kit/src/render/elements.rs renamed +4 −15
@@ -4,11 +4,11 @@ use gpui_kit::*;
4 4
5 5 use super::blocks::{Block, Inline, StyleFlags};
6 6 use super::flow_text::{FlowSegment, FlowText};
7 use super::hooks::jump_to_quoted;
7 8 use super::selectable::{Pill, SelectableRichText};
8 9 use super::syntax::{self, Token};
9 use crate::app_state::AppHandle;
10 use crate::theme;
11 use crate::views::widgets::symbol;
10 use app_base::theme;
11 use crate::widgets::symbol;
12 12
13 13 const LIST_GAP: f32 = 2.;
14 14 const MARKER_WIDTH: f32 = 18.;
@@ -487,7 +487,7 @@ mod tests {
487 487 use gpui_kit::{Rgba, rgb};
488 488
489 489 use super::{MIN_CONTRAST, contrast, readable};
490 use crate::theme;
490 use app_base::theme;
491 491
492 492 #[test]
493 493 fn dark_text_color_is_lifted_to_readable_contrast() {
@@ -500,14 +500,3 @@ mod tests {
500 500 assert_eq!(Rgba::from(readable(0xffd700, false)), rgb(0xffd700));
501 501 }
502 502 }
503
504 fn jump_to_quoted(message_id: String, cx: &mut App) {
505 let Some(handle) = cx.try_global::<AppHandle>() else {
506 return;
507 };
508 handle.0.clone().update(cx, |state, cx| {
509 if let Some(selection) = state.selection.clone() {
510 state.jump_to_message(selection, message_id, cx);
511 }
512 });
513 }
@@ -4,11 +4,11 @@ use gpui_kit::*;
4
4
5use super::blocks::{Block, Inline, StyleFlags};
5use super::blocks::{Block, Inline, StyleFlags};
6use super::flow_text::{FlowSegment, FlowText};
6use super::flow_text::{FlowSegment, FlowText};
7use super::hooks::jump_to_quoted;
7use super::selectable::{Pill, SelectableRichText};
8use super::selectable::{Pill, SelectableRichText};
8use super::syntax::{self, Token};
9use super::syntax::{self, Token};
9use crate::app_state::AppHandle;
10use app_base::theme;
10use crate::theme;
11use crate::widgets::symbol;
11use crate::views::widgets::symbol;
12
12
13const LIST_GAP: f32 = 2.;
13const LIST_GAP: f32 = 2.;
14const MARKER_WIDTH: f32 = 18.;
14const MARKER_WIDTH: f32 = 18.;
@@ -487,7 +487,7 @@ mod tests {
487 use gpui_kit::{Rgba, rgb};
487 use gpui_kit::{Rgba, rgb};
488
488
489 use super::{MIN_CONTRAST, contrast, readable};
489 use super::{MIN_CONTRAST, contrast, readable};
490 use crate::theme;
490 use app_base::theme;
491
491
492 #[test]
492 #[test]
493 fn dark_text_color_is_lifted_to_readable_contrast() {
493 fn dark_text_color_is_lifted_to_readable_contrast() {
@@ -500,14 +500,3 @@ mod tests {
500 assert_eq!(Rgba::from(readable(0xffd700, false)), rgb(0xffd700));
500 assert_eq!(Rgba::from(readable(0xffd700, false)), rgb(0xffd700));
501 }
501 }
502}
502}
503
504fn jump_to_quoted(message_id: String, cx: &mut App) {
505 let Some(handle) = cx.try_global::<AppHandle>() else {
506 return;
507 };
508 handle.0.clone().update(cx, |state, cx| {
509 if let Some(selection) = state.selection.clone() {
510 state.jump_to_message(selection, message_id, cx);
511 }
512 });
513}
crates/app/src/render/flow_text.rs crates/app-ui-kit/src/render/flow_text.rs renamed +1 −1
@@ -7,7 +7,7 @@ use gpui_kit::*;
7 7
8 8 use super::blocks::CODE_PADDING;
9 9 use super::selectable::{HIT_SLOP, PILL_INSET_Y, PILL_OUTSET, Participant, Pill, TIME_ROOM};
10 use crate::views::profile_card::open_profile_link;
10 use super::hooks::open_profile_link;
11 11
12 12 const WRAP_TOLERANCE: f32 = 0.5;
13 13
@@ -7,7 +7,7 @@ use gpui_kit::*;
7
7
8use super::blocks::CODE_PADDING;
8use super::blocks::CODE_PADDING;
9use super::selectable::{HIT_SLOP, PILL_INSET_Y, PILL_OUTSET, Participant, Pill, TIME_ROOM};
9use super::selectable::{HIT_SLOP, PILL_INSET_Y, PILL_OUTSET, Participant, Pill, TIME_ROOM};
10use crate::views::profile_card::open_profile_link;
10use super::hooks::open_profile_link;
11
11
12const WRAP_TOLERANCE: f32 = 0.5;
12const WRAP_TOLERANCE: f32 = 0.5;
13
13
crates/app-ui-kit/src/render/hooks.rs added +22 −0
@@ -0,0 +1,22 @@
1 use gpui_kit::*;
2
3 #[derive(Clone, Copy)]
4 pub struct RenderHooks {
5 pub open_profile_link: fn(&str, Point<Pixels>, &mut App) -> bool,
6 pub jump_to_quoted: fn(String, &mut App),
7 }
8
9 impl Global for RenderHooks {}
10
11 pub fn open_profile_link(url: &str, position: Point<Pixels>, cx: &mut App) -> bool {
12 match cx.try_global::<RenderHooks>().copied() {
13 Some(hooks) => (hooks.open_profile_link)(url, position, cx),
14 None => false,
15 }
16 }
17
18 pub fn jump_to_quoted(message_id: String, cx: &mut App) {
19 if let Some(hooks) = cx.try_global::<RenderHooks>().copied() {
20 (hooks.jump_to_quoted)(message_id, cx);
21 }
22 }
@@ -0,0 +1,22 @@
1use gpui_kit::*;
2
3#[derive(Clone, Copy)]
4pub struct RenderHooks {
5 pub open_profile_link: fn(&str, Point<Pixels>, &mut App) -> bool,
6 pub jump_to_quoted: fn(String, &mut App),
7}
8
9impl Global for RenderHooks {}
10
11pub fn open_profile_link(url: &str, position: Point<Pixels>, cx: &mut App) -> bool {
12 match cx.try_global::<RenderHooks>().copied() {
13 Some(hooks) => (hooks.open_profile_link)(url, position, cx),
14 None => false,
15 }
16}
17
18pub fn jump_to_quoted(message_id: String, cx: &mut App) {
19 if let Some(hooks) = cx.try_global::<RenderHooks>().copied() {
20 (hooks.jump_to_quoted)(message_id, cx);
21 }
22}
crates/app/src/render/mod.rs crates/app-ui-kit/src/render/mod.rs renamed +1 −0
@@ -1,6 +1,7 @@
1 1 pub mod blocks;
2 2 pub mod elements;
3 3 mod flow_text;
4 pub mod hooks;
4 5 mod selectable;
5 6 mod syntax;
6 7
@@ -1,6 +1,7 @@
1pub mod blocks;
1pub mod blocks;
2pub mod elements;
2pub mod elements;
3mod flow_text;
3mod flow_text;
4pub mod hooks;
4mod selectable;
5mod selectable;
5mod syntax;
6mod syntax;
6
7
crates/app/src/render/selectable.rs crates/app-ui-kit/src/render/selectable.rs renamed +1 −1
@@ -8,7 +8,7 @@ use gpui_kit::base::{
8 8 use gpui_kit::*;
9 9
10 10 use super::blocks::CODE_PADDING;
11 use crate::views::profile_card::open_profile_link;
11 use super::hooks::open_profile_link;
12 12
13 13 pub(super) const TIME_ROOM: char = '\u{2007}';
14 14 pub(super) const HIT_SLOP: f32 = 12.;
@@ -8,7 +8,7 @@ use gpui_kit::base::{
8use gpui_kit::*;
8use gpui_kit::*;
9
9
10use super::blocks::CODE_PADDING;
10use super::blocks::CODE_PADDING;
11use crate::views::profile_card::open_profile_link;
11use super::hooks::open_profile_link;
12
12
13pub(super) const TIME_ROOM: char = '\u{2007}';
13pub(super) const TIME_ROOM: char = '\u{2007}';
14pub(super) const HIT_SLOP: f32 = 12.;
14pub(super) const HIT_SLOP: f32 = 12.;
crates/app/src/render/syntax.rs crates/app-ui-kit/src/render/syntax.rs renamed +0 −0
crates/app/src/agents/settings_controls.rs crates/app-ui-kit/src/settings_controls.rs renamed +1 −1
@@ -12,7 +12,7 @@ use gpui_kit::component::{
12 12 use gpui_kit::prelude::FluentBuilder as _;
13 13 use gpui_kit::*;
14 14
15 use crate::theme;
15 use app_base::theme;
16 16
17 17 pub const PAGE_PADDING: f32 = 20.;
18 18 const FIELD_HEIGHT: f32 = 32.;
@@ -12,7 +12,7 @@ use gpui_kit::component::{
12use gpui_kit::prelude::FluentBuilder as _;
12use gpui_kit::prelude::FluentBuilder as _;
13use gpui_kit::*;
13use gpui_kit::*;
14
14
15use crate::theme;
15use app_base::theme;
16
16
17pub const PAGE_PADDING: f32 = 20.;
17pub const PAGE_PADDING: f32 = 20.;
18const FIELD_HEIGHT: f32 = 32.;
18const FIELD_HEIGHT: f32 = 32.;
crates/app/src/agents/spinner.rs crates/app-ui-kit/src/spinner.rs renamed +1 −1
@@ -3,7 +3,7 @@ use std::time::Duration;
3 3 use gpui_kit::component::Icon;
4 4 use gpui_kit::*;
5 5
6 use crate::theme;
6 use app_base::theme;
7 7
8 8 const SPIN_PERIOD: Duration = Duration::from_millis(900);
9 9
@@ -3,7 +3,7 @@ use std::time::Duration;
3use gpui_kit::component::Icon;
3use gpui_kit::component::Icon;
4use gpui_kit::*;
4use gpui_kit::*;
5
5
6use crate::theme;
6use app_base::theme;
7
7
8const SPIN_PERIOD: Duration = Duration::from_millis(900);
8const SPIN_PERIOD: Duration = Duration::from_millis(900);
9
9
crates/app/src/views/widgets.rs crates/app-ui-kit/src/widgets.rs renamed +16 −3
@@ -2,9 +2,22 @@ use gpui_kit::assets::IconName;
2 2 use gpui_kit::component::Icon;
3 3 use gpui_kit::*;
4 4
5 use crate::format;
6 use crate::sidebar_model::Unread;
7 use crate::theme;
5 use app_base::format;
6 use app_base::theme;
7
8 #[derive(Debug, Clone, Copy, PartialEq, Eq)]
9 pub enum Unread {
10 None,
11 Silent,
12 Dot,
13 Count(u32),
14 }
15
16 impl Unread {
17 pub fn is_unread(self) -> bool {
18 self != Unread::None
19 }
20 }
8 21
9 22 pub fn icon(name: IconName, size: f32, color: Hsla) -> Icon {
10 23 Icon::new(name).size(px(size)).text_color(color)
@@ -2,9 +2,22 @@ use gpui_kit::assets::IconName;
2use gpui_kit::component::Icon;
2use gpui_kit::component::Icon;
3use gpui_kit::*;
3use gpui_kit::*;
4
4
5use crate::format;
5use app_base::format;
6use crate::sidebar_model::Unread;
6use app_base::theme;
7use crate::theme;
7
8#[derive(Debug, Clone, Copy, PartialEq, Eq)]
9pub enum Unread {
10 None,
11 Silent,
12 Dot,
13 Count(u32),
14}
15
16impl Unread {
17 pub fn is_unread(self) -> bool {
18 self != Unread::None
19 }
20}
8
21
9pub fn icon(name: IconName, size: f32, color: Hsla) -> Icon {
22pub fn icon(name: IconName, size: f32, color: Hsla) -> Icon {
10 Icon::new(name).size(px(size)).text_color(color)
23 Icon::new(name).size(px(size)).text_color(color)
crates/app/Cargo.toml +1 −0
@@ -20,6 +20,7 @@ tempfile.workspace = true
20 20 [dependencies]
21 21 app-base.workspace = true
22 22 app-call-model.workspace = true
23 app-ui-kit.workspace = true
23 24 agents.workspace = true
24 25 calling.workspace = true
25 26 chatsvc.workspace = true
@@ -20,6 +20,7 @@ tempfile.workspace = true
20[dependencies]
20[dependencies]
21app-base.workspace = true
21app-base.workspace = true
22app-call-model.workspace = true
22app-call-model.workspace = true
23app-ui-kit.workspace = true
23agents.workspace = true
24agents.workspace = true
24calling.workspace = true
25calling.workspace = true
25chatsvc.workspace = true
26chatsvc.workspace = true
crates/app/src/agents/mod.rs +1 −2
@@ -6,10 +6,8 @@ mod run_chip;
6 6 mod runs;
7 7 mod runs_popover;
8 8 mod session_options;
9 mod settings_controls;
10 9 mod settings_forms;
11 10 mod settings_section;
12 mod spinner;
13 11 mod start_dialog;
14 12 mod start_dialog_pickers;
15 13 mod store;
@@ -18,6 +16,7 @@ use std::path::PathBuf;
18 16 use std::time::Duration;
19 17
20 18 use app_base::agents::{lanes, settings_problems};
19 use app_ui_kit::{settings_controls, spinner};
21 20 use agents::{AgentAction, Environment};
22 21 use directories::ProjectDirs;
23 22 use gpui_kit::*;
@@ -6,10 +6,8 @@ mod run_chip;
6mod runs;
6mod runs;
7mod runs_popover;
7mod runs_popover;
8mod session_options;
8mod session_options;
9mod settings_controls;
10mod settings_forms;
9mod settings_forms;
11mod settings_section;
10mod settings_section;
12mod spinner;
13mod start_dialog;
11mod start_dialog;
14mod start_dialog_pickers;
12mod start_dialog_pickers;
15mod store;
13mod store;
@@ -18,6 +16,7 @@ use std::path::PathBuf;
18use std::time::Duration;
16use std::time::Duration;
19
17
20use app_base::agents::{lanes, settings_problems};
18use app_base::agents::{lanes, settings_problems};
19use app_ui_kit::{settings_controls, spinner};
21use agents::{AgentAction, Environment};
20use agents::{AgentAction, Environment};
22use directories::ProjectDirs;
21use directories::ProjectDirs;
23use gpui_kit::*;
22use gpui_kit::*;
crates/app/src/layout_guard.rs +1 −1
@@ -4,7 +4,7 @@ use std::path::{Path, PathBuf};
4 4
5 5 use regex::Regex;
6 6
7 const WIDGETS_FILE: &str = "views/widgets.rs";
7 const WIDGETS_FILE: &str = "widgets.rs";
8 8 const SCAN_ALLOWLIST: &[(&str, &str)] = &[
9 9 ("views/toolbar_placement.rs", ".top(px(-SLOT_HEIGHT))"),
10 10 ("views/conversation.rs", ".bottom(px(-1.))"),
@@ -4,7 +4,7 @@ use std::path::{Path, PathBuf};
4
4
5use regex::Regex;
5use regex::Regex;
6
6
7const WIDGETS_FILE: &str = "views/widgets.rs";
7const WIDGETS_FILE: &str = "widgets.rs";
8const SCAN_ALLOWLIST: &[(&str, &str)] = &[
8const SCAN_ALLOWLIST: &[(&str, &str)] = &[
9 ("views/toolbar_placement.rs", ".top(px(-SLOT_HEIGHT))"),
9 ("views/toolbar_placement.rs", ".top(px(-SLOT_HEIGHT))"),
10 ("views/conversation.rs", ".bottom(px(-1.))"),
10 ("views/conversation.rs", ".bottom(px(-1.))"),
crates/app/src/main.rs +1 −1
@@ -33,7 +33,6 @@ mod people;
33 33 mod profile_model;
34 34 mod profile_state;
35 35 mod reaction_model;
36 mod render;
37 36 mod rows;
38 37 mod scheduled;
39 38 mod scheduled_rows;
@@ -45,6 +44,7 @@ mod translation_actions;
45 44 mod typing;
46 45 mod views;
47 46
47 pub use app_ui_kit::render;
48 48 pub use app_base::{
49 49 APP_NAME, assets, avatar_image, channel_files, crash_log, demo_cards, demo_chart_cards, demo_gifs,
50 50 demo_input_cards, demo_library, demo_recap, diagnostics, downloads, format, frame_log, fuzzy,
@@ -33,7 +33,6 @@ mod people;
33mod profile_model;
33mod profile_model;
34mod profile_state;
34mod profile_state;
35mod reaction_model;
35mod reaction_model;
36mod render;
37mod rows;
36mod rows;
38mod scheduled;
37mod scheduled;
39mod scheduled_rows;
38mod scheduled_rows;
@@ -45,6 +44,7 @@ mod translation_actions;
45mod typing;
44mod typing;
46mod views;
45mod views;
47
46
47pub use app_ui_kit::render;
48pub use app_base::{
48pub use app_base::{
49 APP_NAME, assets, avatar_image, channel_files, crash_log, demo_cards, demo_chart_cards, demo_gifs,
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,
50 demo_input_cards, demo_library, demo_recap, diagnostics, downloads, format, frame_log, fuzzy,
crates/app/src/sidebar_model.rs +1 −14
@@ -3,6 +3,7 @@ use std::collections::{HashMap, HashSet};
3 3 use chrono::{DateTime, FixedOffset, Utc};
4 4 use store::{ChannelRecord, ChatRecord, Sidebar, SidebarTeam};
5 5 use teams_core::ChatSection;
6 use app_ui_kit::widgets::Unread;
6 7
7 8 use crate::app_state::chat_title;
8 9 use crate::data::{
@@ -33,20 +34,6 @@ pub enum Preview {
33 34 },
34 35 }
35 36
36 #[derive(Debug, Clone, Copy, PartialEq, Eq)]
37 pub enum Unread {
38 None,
39 Silent,
40 Dot,
41 Count(u32),
42 }
43
44 impl Unread {
45 pub fn is_unread(self) -> bool {
46 self != Unread::None
47 }
48 }
49
50 37 #[derive(Debug, Clone, PartialEq, Eq)]
51 38 pub struct Face {
52 39 pub user_id: Option<String>,
@@ -3,6 +3,7 @@ use std::collections::{HashMap, HashSet};
3use chrono::{DateTime, FixedOffset, Utc};
3use chrono::{DateTime, FixedOffset, Utc};
4use store::{ChannelRecord, ChatRecord, Sidebar, SidebarTeam};
4use store::{ChannelRecord, ChatRecord, Sidebar, SidebarTeam};
5use teams_core::ChatSection;
5use teams_core::ChatSection;
6use app_ui_kit::widgets::Unread;
6
7
7use crate::app_state::chat_title;
8use crate::app_state::chat_title;
8use crate::data::{
9use crate::data::{
@@ -33,20 +34,6 @@ pub enum Preview {
33 },
34 },
34}
35}
35
36
36#[derive(Debug, Clone, Copy, PartialEq, Eq)]
37pub enum Unread {
38 None,
39 Silent,
40 Dot,
41 Count(u32),
42}
43
44impl Unread {
45 pub fn is_unread(self) -> bool {
46 self != Unread::None
47 }
48}
49
50#[derive(Debug, Clone, PartialEq, Eq)]
37#[derive(Debug, Clone, PartialEq, Eq)]
51pub struct Face {
38pub struct Face {
52 pub user_id: Option<String>,
39 pub user_id: Option<String>,
crates/app/src/views/call_view.rs +1 −1
@@ -33,7 +33,7 @@ use super::call_people::{lock_banner, lock_chip, options_dialog, people_button,
33 33 use super::call_stage::{StageMode, popped_placeholder, render_stage};
34 34 use super::call_view_menu::view_button;
35 35 use super::conversation::ConversationView;
36 use super::shell::ISLAND_GAP;
36 use app_ui_kit::layout::ISLAND_GAP;
37 37 use super::widgets::{Corner, corner_badge, count_badge, icon};
38 38 use crate::app_state::AppState;
39 39 use crate::call::REACTION_SHOWN;
@@ -33,7 +33,7 @@ use super::call_people::{lock_banner, lock_chip, options_dialog, people_button,
33use super::call_stage::{StageMode, popped_placeholder, render_stage};
33use super::call_stage::{StageMode, popped_placeholder, render_stage};
34use super::call_view_menu::view_button;
34use super::call_view_menu::view_button;
35use super::conversation::ConversationView;
35use super::conversation::ConversationView;
36use super::shell::ISLAND_GAP;
36use app_ui_kit::layout::ISLAND_GAP;
37use super::widgets::{Corner, corner_badge, count_badge, icon};
37use super::widgets::{Corner, corner_badge, count_badge, icon};
38use crate::app_state::AppState;
38use crate::app_state::AppState;
39use crate::call::REACTION_SHOWN;
39use crate::call::REACTION_SHOWN;
crates/app/src/views/conversation/shared.rs +1 −3
@@ -20,13 +20,11 @@ use crate::views::attachment_tray::{display_name, read_attachment};
20 20 use crate::views::channel_tabs::{
21 21 ChannelPane, TabAction, TabBarActions, fallback_tab_link, render_tab_bar, tab_action,
22 22 };
23 use crate::views::rail::RAIL_WIDTH;
24 23 use crate::views::shared_tab::{
25 24 LibraryView, Listing, MessagesView, SharedCommand, SharedRun, SharedScope, render_library,
26 25 render_messages,
27 26 };
28 use crate::views::shell::ISLAND_GAP;
29 use crate::views::sidebar::SIDEBAR_WIDTH;
27 use app_ui_kit::layout::{ISLAND_GAP, RAIL_WIDTH, SIDEBAR_WIDTH};
30 28
31 29 const LIBRARY_KEY: &str = "library";
32 30 const NEW_FOLDER_PLACEHOLDER: &str = "Folder name";
@@ -20,13 +20,11 @@ use crate::views::attachment_tray::{display_name, read_attachment};
20use crate::views::channel_tabs::{
20use crate::views::channel_tabs::{
21 ChannelPane, TabAction, TabBarActions, fallback_tab_link, render_tab_bar, tab_action,
21 ChannelPane, TabAction, TabBarActions, fallback_tab_link, render_tab_bar, tab_action,
22};
22};
23use crate::views::rail::RAIL_WIDTH;
24use crate::views::shared_tab::{
23use crate::views::shared_tab::{
25 LibraryView, Listing, MessagesView, SharedCommand, SharedRun, SharedScope, render_library,
24 LibraryView, Listing, MessagesView, SharedCommand, SharedRun, SharedScope, render_library,
26 render_messages,
25 render_messages,
27};
26};
28use crate::views::shell::ISLAND_GAP;
27use app_ui_kit::layout::{ISLAND_GAP, RAIL_WIDTH, SIDEBAR_WIDTH};
29use crate::views::sidebar::SIDEBAR_WIDTH;
30
28
31const LIBRARY_KEY: &str = "library";
29const LIBRARY_KEY: &str = "library";
32const NEW_FOLDER_PLACEHOLDER: &str = "Folder name";
30const NEW_FOLDER_PLACEHOLDER: &str = "Folder name";
crates/app/src/views/mod.rs +2 −5
@@ -21,18 +21,15 @@ pub mod call_view;
21 21 pub mod call_view_menu;
22 22 pub mod calls_tab;
23 23 pub mod card_carousel;
24 pub mod card_chart;
25 24 pub mod card_code_block;
26 25 pub mod card_icon;
27 26 pub mod card_input;
28 27 pub mod card_media;
29 28 pub mod card_table;
30 29 pub mod card_widgets;
31 pub mod channel_tabs;
32 30 pub mod composer;
33 31 pub mod conversation;
34 32 pub mod dialog_overlay;
35 pub mod draft_style;
36 33 pub mod emoji_popup;
37 34 pub mod format_toolbar;
38 35 pub mod forward_dialog;
@@ -52,7 +49,6 @@ pub mod proposal_card;
52 49 pub mod rail;
53 50 pub mod reaction_picker;
54 51 pub mod reaction_pills;
55 pub mod reaction_proposal_pill;
56 52 pub mod recap_tab;
57 53 pub mod saved_panel;
58 54 pub mod scheduled_toolbar;
@@ -71,4 +67,5 @@ pub mod title_bar;
71 67 pub mod toolbar_placement;
72 68 pub mod transfer_picker;
73 69 pub mod translation_line;
74 pub mod widgets;
70
71 pub use app_ui_kit::{card_chart, channel_tabs, draft_style, reaction_proposal_pill, widgets};
@@ -21,18 +21,15 @@ pub mod call_view;
21pub mod call_view_menu;
21pub mod call_view_menu;
22pub mod calls_tab;
22pub mod calls_tab;
23pub mod card_carousel;
23pub mod card_carousel;
24pub mod card_chart;
25pub mod card_code_block;
24pub mod card_code_block;
26pub mod card_icon;
25pub mod card_icon;
27pub mod card_input;
26pub mod card_input;
28pub mod card_media;
27pub mod card_media;
29pub mod card_table;
28pub mod card_table;
30pub mod card_widgets;
29pub mod card_widgets;
31pub mod channel_tabs;
32pub mod composer;
30pub mod composer;
33pub mod conversation;
31pub mod conversation;
34pub mod dialog_overlay;
32pub mod dialog_overlay;
35pub mod draft_style;
36pub mod emoji_popup;
33pub mod emoji_popup;
37pub mod format_toolbar;
34pub mod format_toolbar;
38pub mod forward_dialog;
35pub mod forward_dialog;
@@ -52,7 +49,6 @@ pub mod proposal_card;
52pub mod rail;
49pub mod rail;
53pub mod reaction_picker;
50pub mod reaction_picker;
54pub mod reaction_pills;
51pub mod reaction_pills;
55pub mod reaction_proposal_pill;
56pub mod recap_tab;
52pub mod recap_tab;
57pub mod saved_panel;
53pub mod saved_panel;
58pub mod scheduled_toolbar;
54pub mod scheduled_toolbar;
@@ -71,4 +67,5 @@ pub mod title_bar;
71pub mod toolbar_placement;
67pub mod toolbar_placement;
72pub mod transfer_picker;
68pub mod transfer_picker;
73pub mod translation_line;
69pub mod translation_line;
74pub mod widgets;
70
71pub use app_ui_kit::{card_chart, channel_tabs, draft_style, reaction_proposal_pill, widgets};
crates/app/src/views/rail.rs +3 −5
@@ -4,7 +4,6 @@ use gpui_kit::component::{popover::Popover, tooltip::Tooltip, v_flex};
4 4 use gpui_kit::prelude::FluentBuilder as _;
5 5 use gpui_kit::*;
6 6
7 use super::shell::ISLAND_GAP;
8 7 use super::shortcuts::keys_for_label;
9 8 use super::sidebar::{SidebarTab, SidebarView};
10 9 use super::widgets::icon;
@@ -14,9 +13,8 @@ use crate::app_state::AppState;
14 13 use crate::format;
15 14 use crate::sidebar_model::{any_unread_channel, unread_chat_count};
16 15 use crate::theme;
16 use app_ui_kit::layout::{RAIL_ITEM_WIDTH, RAIL_WIDTH};
17 17
18 pub const RAIL_WIDTH: f32 = ITEM_WIDTH + 2. * ISLAND_GAP;
19 const ITEM_WIDTH: f32 = 48.;
20 18 const ITEM_HEIGHT: f32 = 52.;
21 19 const ICON_SIZE: f32 = 20.;
22 20 const LABEL_INSET: f32 = 2.;
@@ -136,7 +134,7 @@ fn item_element(item: &RailItem, active: bool) -> Stateful<Div> {
136 134 div()
137 135 .id(SharedString::from(format!("rail-{}", item.label)))
138 136 .relative()
139 .w(px(ITEM_WIDTH))
137 .w(px(RAIL_ITEM_WIDTH))
140 138 .h(px(ITEM_HEIGHT))
141 139 .flex()
142 140 .flex_col()
@@ -154,7 +152,7 @@ fn item_element(item: &RailItem, active: bool) -> Stateful<Div> {
154 152 .child(icon(item.icon, ICON_SIZE, color))
155 153 .child(
156 154 div()
157 .max_w(px(ITEM_WIDTH - 2. * LABEL_INSET))
155 .max_w(px(RAIL_ITEM_WIDTH - 2. * LABEL_INSET))
158 156 .truncate()
159 157 .h(px(LABEL_HEIGHT))
160 158 .text_size(px(9.))
@@ -4,7 +4,6 @@ use gpui_kit::component::{popover::Popover, tooltip::Tooltip, v_flex};
4use gpui_kit::prelude::FluentBuilder as _;
4use gpui_kit::prelude::FluentBuilder as _;
5use gpui_kit::*;
5use gpui_kit::*;
6
6
7use super::shell::ISLAND_GAP;
8use super::shortcuts::keys_for_label;
7use super::shortcuts::keys_for_label;
9use super::sidebar::{SidebarTab, SidebarView};
8use super::sidebar::{SidebarTab, SidebarView};
10use super::widgets::icon;
9use super::widgets::icon;
@@ -14,9 +13,8 @@ use crate::app_state::AppState;
14use crate::format;
13use crate::format;
15use crate::sidebar_model::{any_unread_channel, unread_chat_count};
14use crate::sidebar_model::{any_unread_channel, unread_chat_count};
16use crate::theme;
15use crate::theme;
16use app_ui_kit::layout::{RAIL_ITEM_WIDTH, RAIL_WIDTH};
17
17
18pub const RAIL_WIDTH: f32 = ITEM_WIDTH + 2. * ISLAND_GAP;
19const ITEM_WIDTH: f32 = 48.;
20const ITEM_HEIGHT: f32 = 52.;
18const ITEM_HEIGHT: f32 = 52.;
21const ICON_SIZE: f32 = 20.;
19const ICON_SIZE: f32 = 20.;
22const LABEL_INSET: f32 = 2.;
20const LABEL_INSET: f32 = 2.;
@@ -136,7 +134,7 @@ fn item_element(item: &RailItem, active: bool) -> Stateful<Div> {
136 div()
134 div()
137 .id(SharedString::from(format!("rail-{}", item.label)))
135 .id(SharedString::from(format!("rail-{}", item.label)))
138 .relative()
136 .relative()
139 .w(px(ITEM_WIDTH))
137 .w(px(RAIL_ITEM_WIDTH))
140 .h(px(ITEM_HEIGHT))
138 .h(px(ITEM_HEIGHT))
141 .flex()
139 .flex()
142 .flex_col()
140 .flex_col()
@@ -154,7 +152,7 @@ fn item_element(item: &RailItem, active: bool) -> Stateful<Div> {
154 .child(icon(item.icon, ICON_SIZE, color))
152 .child(icon(item.icon, ICON_SIZE, color))
155 .child(
153 .child(
156 div()
154 div()
157 .max_w(px(ITEM_WIDTH - 2. * LABEL_INSET))
155 .max_w(px(RAIL_ITEM_WIDTH - 2. * LABEL_INSET))
158 .truncate()
156 .truncate()
159 .h(px(LABEL_HEIGHT))
157 .h(px(LABEL_HEIGHT))
160 .text_size(px(9.))
158 .text_size(px(9.))
crates/app/src/views/shell.rs +19 −3
@@ -14,7 +14,7 @@ use super::image_viewer::{ImageViewer, ImageViewerEvent};
14 14 use super::prejoin_view::PrejoinView;
15 15 use super::profile_card::{ProfileCard, ProfileCardEvent};
16 16 use gpui_kit::prelude::FluentBuilder as _;
17 use super::rail::{RAIL_WIDTH, RailView};
17 use super::rail::RailView;
18 18 use super::saved_panel::{SavedPanel, SavedPanelEvent};
19 19 use super::shortcuts::{
20 20 AcceptCall, DeclineCall, HangUpCall, JoinMeetingFromToast, NextConversation, OpenActivity,
@@ -24,7 +24,9 @@ use super::shortcuts::{
24 24 };
25 25 use super::call_pop_out::zoom_listener;
26 26 use super::shortcuts_dialog::{ShortcutsDialog, ShortcutsDialogEvent};
27 use super::sidebar::{SIDEBAR_WIDTH, SidebarView};
27 use super::sidebar::SidebarView;
28 use app_ui_kit::render::hooks::RenderHooks;
29 use app_ui_kit::layout::{ISLAND_GAP, RAIL_WIDTH, SIDEBAR_WIDTH};
28 30 use super::status_bar::render_status_bar;
29 31 use super::status_menu::own_status_button;
30 32 use super::status_message_dialog::{StatusMessageDialog, StatusMessageDialogEvent};
@@ -69,7 +71,6 @@ pub struct Startup {
69 71 pub reply_to_last: bool,
70 72 }
71 73
72 pub const ISLAND_GAP: f32 = 6.;
73 74 pub const SIDEBAR_HIDDEN_BELOW: f32 = 960.;
74 75
75 76 pub fn sidebar_hidden_in_call(window_width: f32, panel_open: bool) -> bool {
@@ -85,6 +86,21 @@ impl Global for UserInputHandle {}
85 86 pub fn install_globals(state: &Entity<AppState>, user_input: Arc<UserInput>, cx: &mut App) {
86 87 cx.set_global(crate::app_state::AppHandle(state.clone()));
87 88 cx.set_global(UserInputHandle(user_input));
89 cx.set_global(RenderHooks {
90 open_profile_link: super::profile_card::open_profile_link,
91 jump_to_quoted,
92 });
93 }
94
95 fn jump_to_quoted(message_id: String, cx: &mut App) {
96 let Some(handle) = cx.try_global::<crate::app_state::AppHandle>() else {
97 return;
98 };
99 handle.0.clone().update(cx, |state, cx| {
100 if let Some(selection) = state.selection.clone() {
101 state.jump_to_message(selection, message_id, cx);
102 }
103 });
88 104 }
89 105
90 106 pub struct AppShell {
@@ -14,7 +14,7 @@ use super::image_viewer::{ImageViewer, ImageViewerEvent};
14use super::prejoin_view::PrejoinView;
14use super::prejoin_view::PrejoinView;
15use super::profile_card::{ProfileCard, ProfileCardEvent};
15use super::profile_card::{ProfileCard, ProfileCardEvent};
16use gpui_kit::prelude::FluentBuilder as _;
16use gpui_kit::prelude::FluentBuilder as _;
17use super::rail::{RAIL_WIDTH, RailView};
17use super::rail::RailView;
18use super::saved_panel::{SavedPanel, SavedPanelEvent};
18use super::saved_panel::{SavedPanel, SavedPanelEvent};
19use super::shortcuts::{
19use super::shortcuts::{
20 AcceptCall, DeclineCall, HangUpCall, JoinMeetingFromToast, NextConversation, OpenActivity,
20 AcceptCall, DeclineCall, HangUpCall, JoinMeetingFromToast, NextConversation, OpenActivity,
@@ -24,7 +24,9 @@ use super::shortcuts::{
24};
24};
25use super::call_pop_out::zoom_listener;
25use super::call_pop_out::zoom_listener;
26use super::shortcuts_dialog::{ShortcutsDialog, ShortcutsDialogEvent};
26use super::shortcuts_dialog::{ShortcutsDialog, ShortcutsDialogEvent};
27use super::sidebar::{SIDEBAR_WIDTH, SidebarView};
27use super::sidebar::SidebarView;
28use app_ui_kit::render::hooks::RenderHooks;
29use app_ui_kit::layout::{ISLAND_GAP, RAIL_WIDTH, SIDEBAR_WIDTH};
28use super::status_bar::render_status_bar;
30use super::status_bar::render_status_bar;
29use super::status_menu::own_status_button;
31use super::status_menu::own_status_button;
30use super::status_message_dialog::{StatusMessageDialog, StatusMessageDialogEvent};
32use super::status_message_dialog::{StatusMessageDialog, StatusMessageDialogEvent};
@@ -69,7 +71,6 @@ pub struct Startup {
69 pub reply_to_last: bool,
71 pub reply_to_last: bool,
70}
72}
71
73
72pub const ISLAND_GAP: f32 = 6.;
73pub const SIDEBAR_HIDDEN_BELOW: f32 = 960.;
74pub const SIDEBAR_HIDDEN_BELOW: f32 = 960.;
74
75
75pub fn sidebar_hidden_in_call(window_width: f32, panel_open: bool) -> bool {
76pub fn sidebar_hidden_in_call(window_width: f32, panel_open: bool) -> bool {
@@ -85,6 +86,21 @@ impl Global for UserInputHandle {}
85pub fn install_globals(state: &Entity<AppState>, user_input: Arc<UserInput>, cx: &mut App) {
86pub fn install_globals(state: &Entity<AppState>, user_input: Arc<UserInput>, cx: &mut App) {
86 cx.set_global(crate::app_state::AppHandle(state.clone()));
87 cx.set_global(crate::app_state::AppHandle(state.clone()));
87 cx.set_global(UserInputHandle(user_input));
88 cx.set_global(UserInputHandle(user_input));
89 cx.set_global(RenderHooks {
90 open_profile_link: super::profile_card::open_profile_link,
91 jump_to_quoted,
92 });
93}
94
95fn jump_to_quoted(message_id: String, cx: &mut App) {
96 let Some(handle) = cx.try_global::<crate::app_state::AppHandle>() else {
97 return;
98 };
99 handle.0.clone().update(cx, |state, cx| {
100 if let Some(selection) = state.selection.clone() {
101 state.jump_to_message(selection, message_id, cx);
102 }
103 });
88}
104}
89
105
90pub struct AppShell {
106pub struct AppShell {
crates/app/src/views/sidebar.rs +1 −1
@@ -32,9 +32,9 @@ use crate::sidebar_model::{
32 32 visible_channel_ids, wants_older_chats,
33 33 };
34 34 use crate::theme;
35 use app_ui_kit::layout::SIDEBAR_WIDTH;
35 36
36 37 const COLLAPSED_TEAMS_META_KEY: &str = "sidebar_collapsed_teams";
37 pub const SIDEBAR_WIDTH: f32 = 300.;
38 38 const ROW_HEIGHT: f32 = 54.;
39 39 const PROPOSAL_DOT_SIZE: f32 = 8.;
40 40 const PINNED_CHANNEL_HEIGHT: f32 = 48.;
@@ -32,9 +32,9 @@ use crate::sidebar_model::{
32 visible_channel_ids, wants_older_chats,
32 visible_channel_ids, wants_older_chats,
33};
33};
34use crate::theme;
34use crate::theme;
35use app_ui_kit::layout::SIDEBAR_WIDTH;
35
36
36const COLLAPSED_TEAMS_META_KEY: &str = "sidebar_collapsed_teams";
37const COLLAPSED_TEAMS_META_KEY: &str = "sidebar_collapsed_teams";
37pub const SIDEBAR_WIDTH: f32 = 300.;
38const ROW_HEIGHT: f32 = 54.;
38const ROW_HEIGHT: f32 = 54.;
39const PROPOSAL_DOT_SIZE: f32 = 8.;
39const PROPOSAL_DOT_SIZE: f32 = 8.;
40const PINNED_CHANNEL_HEIGHT: f32 = 48.;
40const PINNED_CHANNEL_HEIGHT: f32 = 48.;