Skip to content

Conversation

@alltheseas
Copy link
Contributor

@alltheseas alltheseas commented Oct 30, 2025

Relay Badge Ready

image image
  • Relay badge icon now hides while hovered/open, keeping the server
    glyph only when idle.
  • Hover tooltip shows the full relay list (newline-separated) to match
    the popover contents.
  • Popover list is text-only; relay URLs remain sorted and deduped via
    collect_note_relays.

File touched: crates/notedeck_ui/src/note/mod.rs

Tests

  • cargo fmt --manifest-path Cargo.toml --all
  • cargo check -p notedeck_ui

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_actionbar signature to accept note and txn parameters needed for relay metadata

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +914 to +916
if bar_action.is_some() {
action = bar_action;
}
Copy link

Copilot AI Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
if bar_action.is_some() {
action = bar_action;
}
action = bar_action;

Copilot uses AI. Check for mistakes.
Comment on lines +988 to +991
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 {
Copy link

Copilot AI Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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 {

Copilot uses AI. Check for mistakes.
@alltheseas
Copy link
Contributor Author

@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

@kernelkind
Copy link
Member

  1. it's weird how the relay icon stops rendering when you're hovering over it
  2. on android, this introduced a regression where the spacing in the x direction changes for different notes as you scroll the timeline. I'm guessing it's due to https://github.com/alltheseas/notedeck/blob/05bb697c3c6923f0661f2697bdcb836929a7168b/crates/notedeck_ui/src/note/mod.rs#L235

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants