Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 36 additions & 36 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,10 @@ resolver = "2"
members = ["src/ui", "src/cache", "src/chat", "src/discord"]

[workspace.dependencies]
chrono = "0.4.38"
chrono = "0.4.38"
gpui = { git = "https://github.com/scopeclient/zed.git", branch = "feature/export-platform-window", default-features = false, features = [
"http_client",
"font-kit",
] }
components = { package = "ui", git = "https://github.com/scopeclient/components", version = "0.1.0" }
reqwest_client = { git = "https://github.com/scopeclient/zed.git", branch = "feature/export-platform-window", version = "0.1.0" }
5 changes: 1 addition & 4 deletions src/cache/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ version = "0.1.0"
edition = "2021"

[dependencies]
gpui = { git = "https://github.com/huacnlee/zed.git", branch = "export-platform-window", default-features = false, features = [
"http_client",
"font-kit",
] }
gpui.workspace = true
rand = "0.8.5"
scope-chat = { version = "0.1.0", path = "../chat" }
tokio = "1.41.1"
5 changes: 1 addition & 4 deletions src/chat/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ version = "0.1.0"
edition = "2021"

[dependencies]
gpui = { git = "https://github.com/huacnlee/zed.git", branch = "export-platform-window", default-features = false, features = [
"http_client",
"font-kit",
] }
tokio = "1.41.1"
chrono.workspace = true
gpui.workspace = true
5 changes: 1 addition & 4 deletions src/discord/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ version = "0.1.0"
edition = "2021"

[dependencies]
gpui = { git = "https://github.com/huacnlee/zed.git", branch = "export-platform-window", default-features = false, features = [
"http_client",
"font-kit",
] }
gpui.workspace = true
scope-chat = { version = "0.1.0", path = "../chat" }
serenity = { git = "https://github.com/scopeclient/serenity", version = "0.12" }
tokio = "1.41.1"
Expand Down
9 changes: 3 additions & 6 deletions src/ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,16 @@ repository = "https://github.com/scopeclient/scope"
keywords = ["discord", "scope", "reticle"]

[dependencies]
gpui = { git = "https://github.com/huacnlee/zed.git", branch = "export-platform-window", version = "0.1.0", default-features = false, features = [
"http_client",
"font-kit",
] }
reqwest_client = { git = "https://github.com/huacnlee/zed.git", branch = "export-platform-window", version = "0.1.0" }
gpui.workspace = true
reqwest_client.workspace = true
scope-chat = { version = "0.1.0", path = "../chat" }
scope-util = { version = "0.1.0", path = "../util" }
scope-backend-discord = { version = "0.1.0", path = "../discord" }
scope-backend-cache = { version = "0.1.0", path = "../cache" }
dotenv = "0.15.0"
env_logger = "0.11.5"
tokio = { version = "1.41.1", features = ["full"] }
components = { package = "ui", git = "https://github.com/longbridgeapp/gpui-component", version = "0.1.0" }
components.workspace = true
log = "0.4.22"
random-string = "1.1.0"
rust-embed = "8.5.0"
Expand Down
22 changes: 6 additions & 16 deletions src/ui/src/channel/message.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use gpui::{div, img, rgb, Element, IntoElement, ParentElement, Styled};
use gpui::prelude::FluentBuilder;
use chrono::Local;
use gpui::prelude::FluentBuilder;
use gpui::{div, img, rgb, Element, IntoElement, ParentElement, Styled, StyledImage};
use scope_chat::message::{Message, MessageAuthor};

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

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

Expand Down Expand Up @@ -74,19 +74,9 @@ pub fn message<M: Message>(message: MessageGroup<M>) -> impl IntoElement {
// enabling this, and thus enabling ellipsis causes a consistent panic!?
// .child(div().text_ellipsis().min_w_0().child(message.get_author().get_display_name()))
.child(
div()
.min_w_0()
.flex()
.gap_2()
.child(message.get_author().get_display_name())
.when_some(message.last().get_timestamp(), |d, ts| {
d.child(
div()
.min_w_0()
.text_color(rgb(0xAFBAC7))
.text_sm()
.child(ts.with_timezone(&Local).format("%I:%M %p").to_string()))
})
div().min_w_0().flex().gap_2().child(message.get_author().get_display_name()).when_some(message.last().get_timestamp(), |d, ts| {
d.child(div().min_w_0().text_color(rgb(0xAFBAC7)).text_sm().child(ts.with_timezone(&Local).format("%I:%M %p").to_string()))
}),
)
.children(message.contents()),
)
Expand Down