Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds a relay indicator to the note action bar that displays which relays a note has been seen on. The indicator appears as a badge showing the count of relays and provides a context menu to view the full list.
- Added relay indicator badge that displays relay count and provides relay details on interaction
- Refactored action bar layout to use right-to-left layout with relay indicator on the right side
- Extended
render_note_actionbarsignature to acceptnoteandtxnparameters needed for relay metadata
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if bar_action.is_some() { | ||
| action = bar_action; | ||
| } |
There was a problem hiding this comment.
The conditional assignment if bar_action.is_some() { action = bar_action; } is redundant. Since bar_action is Option<NoteAction>, you can directly assign it with action = bar_action; or use action = bar_action.or(action); to preserve any previous action if bar_action is None.
| if bar_action.is_some() { | |
| action = bar_action; | |
| } | |
| action = bar_action; |
| let tooltip_relays = relays.clone(); | ||
| response = response.on_hover_ui(move |ui| { | ||
| ui.spacing_mut().item_spacing.y = 2.0; | ||
| for relay in tooltip_relays { |
There was a problem hiding this comment.
The clone of relays (a Vec<&str>) is unnecessary here. Since the hover_ui closure is not 'move' and runs synchronously within the same frame, you can capture &relays by reference instead. Remove the clone and change the closure to use &relays directly.
| let tooltip_relays = relays.clone(); | |
| response = response.on_hover_ui(move |ui| { | |
| ui.spacing_mut().item_spacing.y = 2.0; | |
| for relay in tooltip_relays { | |
| response = response.on_hover_ui(|ui| { | |
| ui.spacing_mut().item_spacing.y = 2.0; | |
| for relay in &relays { |
|
@kernelkind I ran puffin, and I don't see major jumps in the puffin graphs when I interact with the relay badge UI element relaybadgenote.mp4 |
|
Relay Badge Ready
glyph only when idle.
the popover contents.
collect_note_relays.
File touched: crates/notedeck_ui/src/note/mod.rs
Tests