Dial in the channel creating/renaming UI

* Ensure channel list is in a consistent state with no flicker while the
  channel creation / rename request is outstanding.
* Maintain selection properly when renaming and creating channels.
* Style the channel name editor more consistently with the non-editable
  channel names.

Co-authored-by: Mikayla <mikayla@zed.dev>
This commit is contained in:
Max Brunsfeld 2023-08-09 17:11:52 -07:00
parent 076b72cf2b
commit b3447ada27
8 changed files with 260 additions and 110 deletions

View file

@ -2146,16 +2146,18 @@ async fn create_channel(
.create_channel(&request.name, parent_id, &live_kit_room, session.user_id)
.await?;
response.send(proto::CreateChannelResponse {
channel_id: id.to_proto(),
})?;
let mut update = proto::UpdateChannels::default();
update.channels.push(proto::Channel {
let channel = proto::Channel {
id: id.to_proto(),
name: request.name,
parent_id: request.parent_id,
});
};
response.send(proto::ChannelResponse {
channel: Some(channel.clone()),
})?;
let mut update = proto::UpdateChannels::default();
update.channels.push(channel);
let user_ids_to_notify = if let Some(parent_id) = parent_id {
db.get_channel_members(parent_id).await?
@ -2317,14 +2319,16 @@ async fn rename_channel(
.rename_channel(channel_id, session.user_id, &request.name)
.await?;
response.send(proto::Ack {})?;
let mut update = proto::UpdateChannels::default();
update.channels.push(proto::Channel {
let channel = proto::Channel {
id: request.channel_id,
name: new_name,
parent_id: None,
});
};
response.send(proto::ChannelResponse {
channel: Some(channel.clone()),
})?;
let mut update = proto::UpdateChannels::default();
update.channels.push(channel);
let member_ids = db.get_channel_members(channel_id).await?;