From 281a3c607141a6557a2f8d8e7c5fe4c752f4580d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 21 Dec 2025 14:34:31 +0000 Subject: [PATCH 1/5] Initial plan From 441d7c219ff99e6876a84e4cc70171ea20f74c10 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 21 Dec 2025 14:37:32 +0000 Subject: [PATCH 2/5] Fix manual ping skip status during auto mode When a manual ping is blocked (GPS stale, outside geofence, or too close to last ping) during auto mode, the UI now resumes the auto ping countdown instead of staying stuck on the skip message. Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com> --- content/wardrive.js | 27 +++++++++++++++++++++++++++ docs/STATUS_MESSAGES.md | 6 ++++++ 2 files changed, 33 insertions(+) diff --git a/content/wardrive.js b/content/wardrive.js index 65f5a84..63a6631 100644 --- a/content/wardrive.js +++ b/content/wardrive.js @@ -1874,6 +1874,15 @@ async function sendPing(manual = false) { if (!manual && state.running) { scheduleNextAutoPing(); } + // For manual ping during auto mode, resume the paused countdown + if (manual && state.running) { + debugLog("Manual ping failed (no GPS) during auto mode - resuming auto countdown"); + const resumed = resumeAutoCountdown(); + if (!resumed) { + debugLog("No paused countdown to resume, scheduling new auto ping"); + scheduleNextAutoPing(); + } + } return; } @@ -1890,6 +1899,15 @@ async function sendPing(manual = false) { if (manual) { // Manual ping: show skip message that persists setDynamicStatus("Ping skipped, outside of geofenced region", STATUS_COLORS.warning); + // If auto mode is running, resume the paused countdown + if (state.running) { + debugLog("Manual ping blocked during auto mode - resuming auto countdown"); + const resumed = resumeAutoCountdown(); + if (!resumed) { + debugLog("No paused countdown to resume, scheduling new auto ping"); + scheduleNextAutoPing(); + } + } } else if (state.running) { // Auto ping: schedule next ping and show countdown with skip message scheduleNextAutoPing(); @@ -1910,6 +1928,15 @@ async function sendPing(manual = false) { if (manual) { // Manual ping: show skip message that persists setDynamicStatus("Ping skipped, too close to last ping", STATUS_COLORS.warning); + // If auto mode is running, resume the paused countdown + if (state.running) { + debugLog("Manual ping blocked during auto mode - resuming auto countdown"); + const resumed = resumeAutoCountdown(); + if (!resumed) { + debugLog("No paused countdown to resume, scheduling new auto ping"); + scheduleNextAutoPing(); + } + } } else if (state.running) { // Auto ping: schedule next ping and show countdown with skip message scheduleNextAutoPing(); diff --git a/docs/STATUS_MESSAGES.md b/docs/STATUS_MESSAGES.md index d44ecc9..5098d10 100644 --- a/docs/STATUS_MESSAGES.md +++ b/docs/STATUS_MESSAGES.md @@ -234,12 +234,18 @@ These messages appear in the Dynamic App Status Bar. They NEVER include connecti - **Message**: `"Ping skipped, outside of geofenced region"` - **Color**: Amber (warning) - **When**: GPS coordinates outside Ottawa 150km radius +- **Behavior**: + - In manual mode (auto OFF): Message persists until next action + - In manual mode (auto ON): Message shown briefly, then auto countdown resumes - **Source**: `content/wardrive.js:sendPing()` ##### Ping skipped, too close to last ping - **Message**: `"Ping skipped, too close to last ping"` - **Color**: Amber (warning) - **When**: Current location < 25m from last successful ping +- **Behavior**: + - In manual mode (auto OFF): Message persists until next action + - In manual mode (auto ON): Message shown briefly, then auto countdown resumes - **Source**: `content/wardrive.js:sendPing()` ##### Wait Xs before sending another ping From 1d62bf3e85a98a7505c3ffbac79d345029e840ce Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 21 Dec 2025 14:40:57 +0000 Subject: [PATCH 3/5] Refactor: Extract duplicate countdown resume logic Created handleManualPingFailureDuringAutoMode() helper function to eliminate code duplication across three manual ping failure paths. Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com> --- content/wardrive.js | 42 +++++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/content/wardrive.js b/content/wardrive.js index 63a6631..cf8751a 100644 --- a/content/wardrive.js +++ b/content/wardrive.js @@ -392,6 +392,21 @@ function resumeAutoCountdown() { return false; } +/** + * Handle manual ping failure during auto mode by resuming the paused countdown + * This ensures the UI returns to showing the auto countdown instead of staying stuck on the skip message + */ +function handleManualPingFailureDuringAutoMode() { + if (state.running) { + debugLog("Manual ping blocked during auto mode - resuming auto countdown"); + const resumed = resumeAutoCountdown(); + if (!resumed) { + debugLog("No paused countdown to resume, scheduling new auto ping"); + scheduleNextAutoPing(); + } + } +} + function startRxListeningCountdown(delayMs) { debugLog(`Starting RX listening countdown: ${delayMs}ms`); state.rxListeningEndTime = Date.now() + delayMs; @@ -1875,13 +1890,8 @@ async function sendPing(manual = false) { scheduleNextAutoPing(); } // For manual ping during auto mode, resume the paused countdown - if (manual && state.running) { - debugLog("Manual ping failed (no GPS) during auto mode - resuming auto countdown"); - const resumed = resumeAutoCountdown(); - if (!resumed) { - debugLog("No paused countdown to resume, scheduling new auto ping"); - scheduleNextAutoPing(); - } + if (manual) { + handleManualPingFailureDuringAutoMode(); } return; } @@ -1900,14 +1910,7 @@ async function sendPing(manual = false) { // Manual ping: show skip message that persists setDynamicStatus("Ping skipped, outside of geofenced region", STATUS_COLORS.warning); // If auto mode is running, resume the paused countdown - if (state.running) { - debugLog("Manual ping blocked during auto mode - resuming auto countdown"); - const resumed = resumeAutoCountdown(); - if (!resumed) { - debugLog("No paused countdown to resume, scheduling new auto ping"); - scheduleNextAutoPing(); - } - } + handleManualPingFailureDuringAutoMode(); } else if (state.running) { // Auto ping: schedule next ping and show countdown with skip message scheduleNextAutoPing(); @@ -1929,14 +1932,7 @@ async function sendPing(manual = false) { // Manual ping: show skip message that persists setDynamicStatus("Ping skipped, too close to last ping", STATUS_COLORS.warning); // If auto mode is running, resume the paused countdown - if (state.running) { - debugLog("Manual ping blocked during auto mode - resuming auto countdown"); - const resumed = resumeAutoCountdown(); - if (!resumed) { - debugLog("No paused countdown to resume, scheduling new auto ping"); - scheduleNextAutoPing(); - } - } + handleManualPingFailureDuringAutoMode(); } else if (state.running) { // Auto ping: schedule next ping and show countdown with skip message scheduleNextAutoPing(); From ded68e1137730a81a8a8b002a547b3748eac77f6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 21 Dec 2025 14:42:03 +0000 Subject: [PATCH 4/5] Add JSDoc documentation to helper function Added comprehensive JSDoc comments to handleManualPingFailureDuringAutoMode() following codebase conventions. Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com> --- content/wardrive.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/content/wardrive.js b/content/wardrive.js index cf8751a..f1f2658 100644 --- a/content/wardrive.js +++ b/content/wardrive.js @@ -395,6 +395,13 @@ function resumeAutoCountdown() { /** * Handle manual ping failure during auto mode by resuming the paused countdown * This ensures the UI returns to showing the auto countdown instead of staying stuck on the skip message + * + * When a manual ping is blocked during auto mode, this function: + * 1. Attempts to resume the paused auto countdown timer with remaining time + * 2. If no paused countdown exists, schedules a new auto ping + * 3. Does nothing if auto mode is not running + * + * @returns {void} */ function handleManualPingFailureDuringAutoMode() { if (state.running) { From 8491055e5c2a223314c17a98be3da13e66dc5e6a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 21 Dec 2025 14:43:36 +0000 Subject: [PATCH 5/5] Improve function naming for clarity Renamed handleManualPingFailureDuringAutoMode to handleManualPingBlockedDuringAutoMode to better reflect that it handles blocked pings, not failures. Updated JSDoc to clarify it handles GPS unavailable, geofence, and distance checks. Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com> --- content/wardrive.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/content/wardrive.js b/content/wardrive.js index f1f2658..abcfc7c 100644 --- a/content/wardrive.js +++ b/content/wardrive.js @@ -393,17 +393,17 @@ function resumeAutoCountdown() { } /** - * Handle manual ping failure during auto mode by resuming the paused countdown + * Handle manual ping blocked during auto mode by resuming the paused countdown * This ensures the UI returns to showing the auto countdown instead of staying stuck on the skip message * - * When a manual ping is blocked during auto mode, this function: + * When a manual ping is blocked during auto mode (GPS unavailable, outside geofence, or too close), this function: * 1. Attempts to resume the paused auto countdown timer with remaining time * 2. If no paused countdown exists, schedules a new auto ping * 3. Does nothing if auto mode is not running * * @returns {void} */ -function handleManualPingFailureDuringAutoMode() { +function handleManualPingBlockedDuringAutoMode() { if (state.running) { debugLog("Manual ping blocked during auto mode - resuming auto countdown"); const resumed = resumeAutoCountdown(); @@ -1898,7 +1898,7 @@ async function sendPing(manual = false) { } // For manual ping during auto mode, resume the paused countdown if (manual) { - handleManualPingFailureDuringAutoMode(); + handleManualPingBlockedDuringAutoMode(); } return; } @@ -1917,7 +1917,7 @@ async function sendPing(manual = false) { // Manual ping: show skip message that persists setDynamicStatus("Ping skipped, outside of geofenced region", STATUS_COLORS.warning); // If auto mode is running, resume the paused countdown - handleManualPingFailureDuringAutoMode(); + handleManualPingBlockedDuringAutoMode(); } else if (state.running) { // Auto ping: schedule next ping and show countdown with skip message scheduleNextAutoPing(); @@ -1939,7 +1939,7 @@ async function sendPing(manual = false) { // Manual ping: show skip message that persists setDynamicStatus("Ping skipped, too close to last ping", STATUS_COLORS.warning); // If auto mode is running, resume the paused countdown - handleManualPingFailureDuringAutoMode(); + handleManualPingBlockedDuringAutoMode(); } else if (state.running) { // Auto ping: schedule next ping and show countdown with skip message scheduleNextAutoPing();