mirror of
https://github.com/dergigi/boris.git
synced 2026-01-10 10:24:21 +01:00
fix(highlights): improve relay indicator tooltip accuracy
Update tooltip text to be more accurate about relay information: - Show 'Published to X relays' for user-created highlights with publishedRelays - Show 'Seen on X relays' for highlights with seenOnRelays tracking - Show 'Fetched from network' for highlights without relay metadata - Add seenOnRelays field to Highlight type for future relay tracking
This commit is contained in:
@@ -178,7 +178,7 @@ export const HighlightItem: React.FC<HighlightItemProps> = ({
|
||||
}
|
||||
}
|
||||
|
||||
// Always show server icon, even if we don't have relay info
|
||||
// Show server icon with relay info if available
|
||||
if (highlight.publishedRelays && highlight.publishedRelays.length > 0) {
|
||||
const relayNames = highlight.publishedRelays.map(url =>
|
||||
url.replace(/^wss?:\/\//, '').replace(/\/$/, '')
|
||||
@@ -190,10 +190,21 @@ export const HighlightItem: React.FC<HighlightItemProps> = ({
|
||||
}
|
||||
}
|
||||
|
||||
if (highlight.seenOnRelays && highlight.seenOnRelays.length > 0) {
|
||||
const relayNames = highlight.seenOnRelays.map(url =>
|
||||
url.replace(/^wss?:\/\//, '').replace(/\/$/, '')
|
||||
)
|
||||
return {
|
||||
icon: faServer,
|
||||
tooltip: `Seen on ${relayNames.length} relay(s):\n${relayNames.join('\n')}\n\nClick to rebroadcast`,
|
||||
spin: false
|
||||
}
|
||||
}
|
||||
|
||||
// Default server icon for highlights without relay info
|
||||
return {
|
||||
icon: faServer,
|
||||
tooltip: 'Click to rebroadcast to all relays',
|
||||
tooltip: 'Fetched from network\n\nClick to rebroadcast to all relays',
|
||||
spin: false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,8 @@ export interface Highlight {
|
||||
// Level classification (computed based on user's context)
|
||||
level?: HighlightLevel
|
||||
// Relay tracking for offline/local-only highlights
|
||||
publishedRelays?: string[] // URLs of relays that acknowledged this event
|
||||
publishedRelays?: string[] // URLs of relays where this was published (for user-created highlights)
|
||||
seenOnRelays?: string[] // URLs of relays where this event was fetched from
|
||||
isLocalOnly?: boolean // true if only published to local relays
|
||||
isOfflineCreated?: boolean // true if created while in flight mode (offline)
|
||||
isSyncing?: boolean // true if currently being synced to remote relays
|
||||
|
||||
Reference in New Issue
Block a user