add event map

This commit is contained in:
Ren Amamiya
2026-03-31 09:28:54 +07:00
parent b0ba2549d7
commit c1b0b81e25
3 changed files with 26 additions and 7 deletions

View File

@@ -13,4 +13,5 @@ pub enum Command {
Copy(PublicKey),
Relays(PublicKey),
Njump(PublicKey),
Trace(EventId),
}

View File

@@ -658,9 +658,19 @@ impl ChatPanel {
Command::Njump(public_key) => {
self.open_njump(public_key, cx);
}
Command::Trace(id) => {
self.open_trace(id, window, cx);
}
}
}
fn open_trace(&mut self, id: &EventId, window: &mut Window, cx: &mut Context<Self>) {
window.open_modal(cx, move |this, _window, cx| {
// TODO
this.child(v_flex().child(""))
});
}
fn open_relays(&mut self, public_key: &PublicKey, window: &mut Window, cx: &mut Context<Self>) {
let profile = self.profile(public_key, cx);
@@ -1131,15 +1141,10 @@ impl ChatPanel {
.ghost()
.dropdown_menu({
let public_key = *public_key;
let _id = *id;
let id = *id;
move |this, _window, _cx| {
this.menu("Copy author", Box::new(Command::Copy(public_key)))
/*
.menu(
"Trace",
Box::new(Command::Trace(id)),
)
*/
.menu("Seen on", Box::new(Command::Trace(id)))
}
}),
)