From f8aedc5899c9ab47fd66334573291eacb2daed6b Mon Sep 17 00:00:00 2001 From: MarekWo Date: Tue, 30 Dec 2025 12:43:50 +0100 Subject: [PATCH 1/2] feat(contacts): Add Map button to open GPS location in Google Maps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add Map button between Copy Key and Delete buttons on existing contacts cards. Button appears only when contact has GPS coordinates (adv_lat/adv_lon != 0). Opens contact location in Google Maps in new tab. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- app/static/js/contacts.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/app/static/js/contacts.js b/app/static/js/contacts.js index e2b1933..c4aa776 100644 --- a/app/static/js/contacts.js +++ b/app/static/js/contacts.js @@ -974,13 +974,23 @@ function createExistingContactCard(contact, index) { copyBtn.innerHTML = ' Copy Key'; copyBtn.onclick = () => copyContactKey(contact.public_key_prefix, copyBtn); + actionsDiv.appendChild(copyBtn); + + // Map button (only if GPS coordinates available) + if (contact.adv_lat && contact.adv_lon && (contact.adv_lat !== 0 || contact.adv_lon !== 0)) { + const mapBtn = document.createElement('button'); + mapBtn.className = 'btn btn-sm btn-outline-primary'; + mapBtn.innerHTML = ' Map'; + mapBtn.onclick = () => openGoogleMaps(contact.adv_lat, contact.adv_lon); + actionsDiv.appendChild(mapBtn); + } + // Delete button const deleteBtn = document.createElement('button'); deleteBtn.className = 'btn btn-sm btn-outline-danger'; deleteBtn.innerHTML = ' Delete'; deleteBtn.onclick = () => showDeleteModal(contact); - actionsDiv.appendChild(copyBtn); actionsDiv.appendChild(deleteBtn); // Assemble card @@ -1014,6 +1024,14 @@ function copyContactKey(publicKeyPrefix, buttonEl) { }); } +function openGoogleMaps(lat, lon) { + // Create Google Maps URL with coordinates + const mapsUrl = `https://www.google.com/maps?q=${lat},${lon}`; + + // Open in new tab + window.open(mapsUrl, '_blank'); +} + function showDeleteModal(contact) { contactToDelete = contact; From 3f6f584d395d095dd1b9866ff64b5057c3fa5fee Mon Sep 17 00:00:00 2001 From: MarekWo Date: Tue, 30 Dec 2025 12:45:04 +0100 Subject: [PATCH 2/2] docs: Update documentation for GPS Map button feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add information about new Map button feature in README.md and CLAUDE.md. Button allows viewing contact location on Google Maps when GPS coordinates available. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e02fc10..33587f4 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ A lightweight web interface for meshcore-cli, providing browser-based access to - **Advanced sorting:** Sort contacts by name (A-Z/Z-A) or last advertisement time (newest/oldest) - **Smart filtering:** Search by name/key, filter by contact type (CLI, REP, ROOM, SENS) - **Activity indicators:** Visual status icons (🟢 active, 🟡 recent, 🔴 inactive) based on last advertisement + - **GPS location:** View contact location on Google Maps (when GPS coordinates available) - **Cleanup tool:** Remove inactive contacts with configurable threshold (moved from Settings) - 📦 **Message archiving** - Automatic daily archiving with browse-by-date selector - ⚡ **Efficient polling** - Lightweight update checks every 10s, UI refreshes only when needed