mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-31 19:05:00 +07:00
collab: Add 'Copy channel notes link' to right click menu on channels (#41298)
Release Notes: - Added a "Copy Channel Notes Link" action to right-click menu of Zed channels.
This commit is contained in:
parent
ba26ca4aee
commit
172984978f
1 changed files with 16 additions and 0 deletions
|
|
@ -1265,6 +1265,13 @@ impl CollabPanel {
|
||||||
window.handler_for(&this, move |this, _, cx| {
|
window.handler_for(&this, move |this, _, cx| {
|
||||||
this.copy_channel_link(channel_id, cx)
|
this.copy_channel_link(channel_id, cx)
|
||||||
}),
|
}),
|
||||||
|
)
|
||||||
|
.entry(
|
||||||
|
"Copy Channel Notes Link",
|
||||||
|
None,
|
||||||
|
window.handler_for(&this, move |this, _, cx| {
|
||||||
|
this.copy_channel_notes_link(channel_id, cx)
|
||||||
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
let mut has_destructive_actions = false;
|
let mut has_destructive_actions = false;
|
||||||
|
|
@ -2220,6 +2227,15 @@ impl CollabPanel {
|
||||||
cx.write_to_clipboard(item)
|
cx.write_to_clipboard(item)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn copy_channel_notes_link(&mut self, channel_id: ChannelId, cx: &mut Context<Self>) {
|
||||||
|
let channel_store = self.channel_store.read(cx);
|
||||||
|
let Some(channel) = channel_store.channel_for_id(channel_id) else {
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
let item = ClipboardItem::new_string(channel.notes_link(None, cx));
|
||||||
|
cx.write_to_clipboard(item)
|
||||||
|
}
|
||||||
|
|
||||||
fn render_signed_out(&mut self, cx: &mut Context<Self>) -> Div {
|
fn render_signed_out(&mut self, cx: &mut Context<Self>) -> Div {
|
||||||
let collab_blurb = "Work with your team in realtime with collaborative editing, voice, shared notes and more.";
|
let collab_blurb = "Work with your team in realtime with collaborative editing, voice, shared notes and more.";
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue