diff --git a/lib/aprsme_web/live/map_live/index.ex b/lib/aprsme_web/live/map_live/index.ex
index 937f182..369e9a0 100644
--- a/lib/aprsme_web/live/map_live/index.ex
+++ b/lib/aprsme_web/live/map_live/index.ex
@@ -200,7 +200,8 @@ defmodule AprsmeWeb.MapLive.Index do
overlay_callsign: "",
# Slideover state - will be set based on screen size
slideover_open: true,
- # Track when last update occurred for display
+ # Track when last update occurred for real-time display in map sidebar
+ # Updated when packets are processed or map bounds change
last_update_at: DateTime.utc_now()
)
end
@@ -1311,10 +1312,14 @@ defmodule AprsmeWeb.MapLive.Index do
{gettext("Last Update")}
-
{time_ago_in_words(@last_update_at)}
-
- {Calendar.strftime(@last_update_at, "%Y-%m-%d %H:%M UTC")}
-
+ <%= if @last_update_at do %>
+
{time_ago_in_words(@last_update_at)}
+
+ {Calendar.strftime(@last_update_at, "%Y-%m-%d %H:%M UTC")}
+
+ <% else %>
+
No updates yet
+ <% end %>
@@ -1641,6 +1646,7 @@ defmodule AprsmeWeb.MapLive.Index do
socket
|> assign(map_bounds: map_bounds, packet_state: updated_packet_state)
|> assign(needs_initial_historical_load: false)
+ # Update last update timestamp when map bounds change - this triggers data refresh
|> assign(last_update_at: DateTime.utc_now())
# Load historical packets for the new bounds (now socket.assigns.map_bounds is correct)
diff --git a/lib/aprsme_web/live/map_live/packet_processor.ex b/lib/aprsme_web/live/map_live/packet_processor.ex
index 3c7f407..7fddaf9 100644
--- a/lib/aprsme_web/live/map_live/packet_processor.ex
+++ b/lib/aprsme_web/live/map_live/packet_processor.ex
@@ -39,7 +39,8 @@ defmodule AprsmeWeb.MapLive.PacketProcessor do
# Handle packet visibility logic
socket = handle_packet_visibility(packet, lat, lon, callsign_key, socket)
- # Update last update timestamp for display purposes
+ # Update last update timestamp for real-time display in map sidebar
+ # This timestamp is shown to users to indicate when data was last refreshed
socket = assign(socket, :last_update_at, DateTime.utc_now())
{:noreply, socket}