Skip to content

Commit 0020aae

Browse files
authored
Migrate Dependencies (#39)
* Migrate dependencies to workspace dependencies pointing to scopeclient * update reqwest_client and get scope building
1 parent 436930f commit 0020aae

File tree

7 files changed

+55
-71
lines changed

7 files changed

+55
-71
lines changed

Cargo.lock

+36-36
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,10 @@ resolver = "2"
33
members = ["src/ui", "src/cache", "src/chat", "src/discord"]
44

55
[workspace.dependencies]
6-
chrono = "0.4.38"
6+
chrono = "0.4.38"
7+
gpui = { git = "https://github.com/scopeclient/zed.git", branch = "feature/export-platform-window", default-features = false, features = [
8+
"http_client",
9+
"font-kit",
10+
] }
11+
components = { package = "ui", git = "https://github.com/scopeclient/components", version = "0.1.0" }
12+
reqwest_client = { git = "https://github.com/scopeclient/zed.git", branch = "feature/export-platform-window", version = "0.1.0" }

src/cache/Cargo.toml

+1-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7-
gpui = { git = "https://github.com/huacnlee/zed.git", branch = "export-platform-window", default-features = false, features = [
8-
"http_client",
9-
"font-kit",
10-
] }
7+
gpui.workspace = true
118
rand = "0.8.5"
129
scope-chat = { version = "0.1.0", path = "../chat" }
1310
tokio = "1.41.1"

src/chat/Cargo.toml

+1-4
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7-
gpui = { git = "https://github.com/huacnlee/zed.git", branch = "export-platform-window", default-features = false, features = [
8-
"http_client",
9-
"font-kit",
10-
] }
117
tokio = "1.41.1"
128
chrono.workspace = true
9+
gpui.workspace = true

src/discord/Cargo.toml

+1-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7-
gpui = { git = "https://github.com/huacnlee/zed.git", branch = "export-platform-window", default-features = false, features = [
8-
"http_client",
9-
"font-kit",
10-
] }
7+
gpui.workspace = true
118
scope-chat = { version = "0.1.0", path = "../chat" }
129
serenity = { git = "https://github.com/scopeclient/serenity", version = "0.12" }
1310
tokio = "1.41.1"

src/ui/Cargo.toml

+3-6
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,16 @@ repository = "https://github.com/scopeclient/scope"
1313
keywords = ["discord", "scope", "reticle"]
1414

1515
[dependencies]
16-
gpui = { git = "https://github.com/huacnlee/zed.git", branch = "export-platform-window", version = "0.1.0", default-features = false, features = [
17-
"http_client",
18-
"font-kit",
19-
] }
20-
reqwest_client = { git = "https://github.com/huacnlee/zed.git", branch = "export-platform-window", version = "0.1.0" }
16+
gpui.workspace = true
17+
reqwest_client.workspace = true
2118
scope-chat = { version = "0.1.0", path = "../chat" }
2219
scope-util = { version = "0.1.0", path = "../util" }
2320
scope-backend-discord = { version = "0.1.0", path = "../discord" }
2421
scope-backend-cache = { version = "0.1.0", path = "../cache" }
2522
dotenv = "0.15.0"
2623
env_logger = "0.11.5"
2724
tokio = { version = "1.41.1", features = ["full"] }
28-
components = { package = "ui", git = "https://github.com/longbridgeapp/gpui-component", version = "0.1.0" }
25+
components.workspace = true
2926
log = "0.4.22"
3027
random-string = "1.1.0"
3128
rust-embed = "8.5.0"

src/ui/src/channel/message.rs

+6-16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use gpui::{div, img, rgb, Element, IntoElement, ParentElement, Styled};
2-
use gpui::prelude::FluentBuilder;
31
use chrono::Local;
2+
use gpui::prelude::FluentBuilder;
3+
use gpui::{div, img, rgb, Element, IntoElement, ParentElement, Styled, StyledImage};
44
use scope_chat::message::{Message, MessageAuthor};
55

66
#[derive(Clone)]
@@ -26,7 +26,7 @@ impl<M: Message> MessageGroup<M> {
2626
self.contents.push(message);
2727
}
2828

29-
pub fn contents(&self) -> impl IntoIterator<Item=impl Element + '_> {
29+
pub fn contents(&self) -> impl IntoIterator<Item = impl Element + '_> {
3030
self.contents.iter().map(|v| v.get_content())
3131
}
3232

@@ -74,19 +74,9 @@ pub fn message<M: Message>(message: MessageGroup<M>) -> impl IntoElement {
7474
// enabling this, and thus enabling ellipsis causes a consistent panic!?
7575
// .child(div().text_ellipsis().min_w_0().child(message.get_author().get_display_name()))
7676
.child(
77-
div()
78-
.min_w_0()
79-
.flex()
80-
.gap_2()
81-
.child(message.get_author().get_display_name())
82-
.when_some(message.last().get_timestamp(), |d, ts| {
83-
d.child(
84-
div()
85-
.min_w_0()
86-
.text_color(rgb(0xAFBAC7))
87-
.text_sm()
88-
.child(ts.with_timezone(&Local).format("%I:%M %p").to_string()))
89-
})
77+
div().min_w_0().flex().gap_2().child(message.get_author().get_display_name()).when_some(message.last().get_timestamp(), |d, ts| {
78+
d.child(div().min_w_0().text_color(rgb(0xAFBAC7)).text_sm().child(ts.with_timezone(&Local).format("%I:%M %p").to_string()))
79+
}),
9080
)
9181
.children(message.contents()),
9282
)

0 commit comments

Comments
 (0)