From 0ae1f29be82c5b5a81cb9a7c62a42b6985a46dce Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Wed, 2 Aug 2023 15:52:56 -0700 Subject: [PATCH] wip --- crates/client/src/channel_store.rs | 12 ++++-------- crates/collab/src/db/tests.rs | 2 +- crates/collab_ui/src/face_pile.rs | 2 -- crates/collab_ui/src/panel.rs | 17 ++++++----------- crates/collab_ui/src/panel/channel_modal.rs | 8 ++++---- script/zed-with-local-servers | 5 ++++- styles/.eslintrc.js | 1 + styles/src/style_tree/collab_panel.ts | 1 + styles/tsconfig.json | 4 +++- 9 files changed, 24 insertions(+), 28 deletions(-) diff --git a/crates/client/src/channel_store.rs b/crates/client/src/channel_store.rs index 558570475e..534bd0b05a 100644 --- a/crates/client/src/channel_store.rs +++ b/crates/client/src/channel_store.rs @@ -115,10 +115,6 @@ impl ChannelStore { } } - pub fn is_channel_invite_pending(&self, channel: &Arc) -> bool { - false - } - pub fn remove_channel(&self, channel_id: ChannelId) -> impl Future> { let client = self.client.clone(); async move { @@ -127,6 +123,10 @@ impl ChannelStore { } } + pub fn is_channel_invite_pending(&self, _: &Arc) -> bool { + false + } + pub fn remove_member( &self, channel_id: ChannelId, @@ -144,10 +144,6 @@ impl ChannelStore { todo!() } - pub fn add_guest_channel(&self, channel_id: ChannelId) -> Task> { - todo!() - } - async fn handle_update_channels( this: ModelHandle, message: TypedEnvelope, diff --git a/crates/collab/src/db/tests.rs b/crates/collab/src/db/tests.rs index a6249bb548..a1d1a23dc9 100644 --- a/crates/collab/src/db/tests.rs +++ b/crates/collab/src/db/tests.rs @@ -1080,7 +1080,7 @@ test_both_dbs!( test_channel_invites_sqlite, db, { - let owner_id = db.create_server("test").await.unwrap().0 as u32; + db.create_server("test").await.unwrap(); let user_1 = db .create_user( diff --git a/crates/collab_ui/src/face_pile.rs b/crates/collab_ui/src/face_pile.rs index 7e95a7677c..30fcb97506 100644 --- a/crates/collab_ui/src/face_pile.rs +++ b/crates/collab_ui/src/face_pile.rs @@ -10,8 +10,6 @@ use gpui::{ AnyElement, Axis, Element, LayoutContext, SceneBuilder, View, ViewContext, }; -use crate::CollabTitlebarItem; - pub(crate) struct FacePile { overlap: f32, faces: Vec>, diff --git a/crates/collab_ui/src/panel.rs b/crates/collab_ui/src/panel.rs index 406daae0f2..667e8d3a5c 100644 --- a/crates/collab_ui/src/panel.rs +++ b/crates/collab_ui/src/panel.rs @@ -1259,8 +1259,8 @@ impl CollabPanel { fn render_channel_editor( &self, - theme: &theme::CollabPanel, - depth: usize, + _theme: &theme::CollabPanel, + _depth: usize, cx: &AppContext, ) -> AnyElement { ChildView::new(&self.channel_name_editor, cx).into_any() @@ -1276,7 +1276,7 @@ impl CollabPanel { let channel_id = channel.id; MouseEventHandler::::new(channel.id as usize, cx, |state, cx| { Flex::row() - .with_child({ Svg::new("icons/file_icons/hash.svg").aligned().left() }) + .with_child(Svg::new("icons/file_icons/hash.svg").aligned().left()) .with_child( Label::new(channel.name.clone(), theme.contact_username.text.clone()) .contained() @@ -1329,12 +1329,7 @@ impl CollabPanel { let button_spacing = theme.contact_button_spacing; Flex::row() - .with_child({ - Svg::new("icons/file_icons/hash.svg") - // .with_style(theme.contact_avatar) - .aligned() - .left() - }) + .with_child(Svg::new("icons/file_icons/hash.svg").aligned().left()) .with_child( Label::new(channel.name.clone(), theme.contact_username.text.clone()) .contained() @@ -1616,7 +1611,7 @@ impl CollabPanel { } } } else if let Some((editing_state, channel_name)) = self.take_editing_state(cx) { - let create_channel = self.channel_store.update(cx, |channel_store, cx| { + let create_channel = self.channel_store.update(cx, |channel_store, _| { channel_store.create_channel(&channel_name, editing_state.parent_id) }); @@ -1687,7 +1682,7 @@ impl CollabPanel { cx.spawn(|_, mut cx| async move { if answer.next().await == Some(0) { if let Err(e) = channel_store - .update(&mut cx, |channels, cx| channels.remove_channel(channel_id)) + .update(&mut cx, |channels, _| channels.remove_channel(channel_id)) .await { cx.prompt( diff --git a/crates/collab_ui/src/panel/channel_modal.rs b/crates/collab_ui/src/panel/channel_modal.rs index fff1dc8624..aa1b3e5a13 100644 --- a/crates/collab_ui/src/panel/channel_modal.rs +++ b/crates/collab_ui/src/panel/channel_modal.rs @@ -9,7 +9,7 @@ pub fn init(cx: &mut AppContext) { pub struct ChannelModal { has_focus: bool, - input_editor: ViewHandle, + filter_editor: ViewHandle, } pub enum Event { @@ -30,7 +30,7 @@ impl ChannelModal { ChannelModal { has_focus: false, - input_editor, + filter_editor: input_editor, } } @@ -55,7 +55,7 @@ impl View for ChannelModal { enum ChannelModal {} MouseEventHandler::::new(0, cx, |_, cx| { Flex::column() - .with_child(ChildView::new(self.input_editor.as_any(), cx)) + .with_child(ChildView::new(self.filter_editor.as_any(), cx)) .with_child(Label::new("ADD OR BROWSE CHANNELS HERE", style)) .contained() .with_style(modal_container) @@ -71,7 +71,7 @@ impl View for ChannelModal { fn focus_in(&mut self, _: AnyViewHandle, cx: &mut ViewContext) { self.has_focus = true; if cx.is_self_focused() { - cx.focus(&self.input_editor); + cx.focus(&self.filter_editor); } } diff --git a/script/zed-with-local-servers b/script/zed-with-local-servers index c47b0e3de0..e1b224de60 100755 --- a/script/zed-with-local-servers +++ b/script/zed-with-local-servers @@ -1,3 +1,6 @@ #!/bin/bash -ZED_ADMIN_API_TOKEN=secret ZED_IMPERSONATE=as-cii ZED_SERVER_URL=http://localhost:8080 cargo run $@ +: "${ZED_IMPERSONATE:=as-cii}" +export ZED_IMPERSONATE + +ZED_ADMIN_API_TOKEN=secret ZED_SERVER_URL=http://localhost:8080 cargo run $@ diff --git a/styles/.eslintrc.js b/styles/.eslintrc.js index 485ff73d10..82e9636189 100644 --- a/styles/.eslintrc.js +++ b/styles/.eslintrc.js @@ -28,6 +28,7 @@ module.exports = { }, rules: { "linebreak-style": ["error", "unix"], + "@typescript-eslint/no-explicit-any": "off", semi: ["error", "never"], }, } diff --git a/styles/src/style_tree/collab_panel.ts b/styles/src/style_tree/collab_panel.ts index 49a343e6c9..3390dd51f8 100644 --- a/styles/src/style_tree/collab_panel.ts +++ b/styles/src/style_tree/collab_panel.ts @@ -8,6 +8,7 @@ import { import { interactive, toggleable } from "../element" import { useTheme } from "../theme" + export default function contacts_panel(): any { const theme = useTheme() diff --git a/styles/tsconfig.json b/styles/tsconfig.json index a1913027b7..281bd74b21 100644 --- a/styles/tsconfig.json +++ b/styles/tsconfig.json @@ -24,5 +24,7 @@ "useUnknownInCatchVariables": false, "baseUrl": "." }, - "exclude": ["node_modules"] + "exclude": [ + "node_modules" + ] }