From c767cb9df14678151e65f44a889527987ec0e28b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 19 Dec 2025 19:13:54 +0000 Subject: [PATCH 1/7] Initial plan From d099a12a15cf0b3fe26ab1e75285585aed158710 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 19 Dec 2025 19:16:49 +0000 Subject: [PATCH 2/7] Add 3-second hidden delay before API POST in postApiAndRefreshMap Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com> --- content/wardrive.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/content/wardrive.js b/content/wardrive.js index afb79d7..292e0a8 100644 --- a/content/wardrive.js +++ b/content/wardrive.js @@ -1054,6 +1054,9 @@ async function postApiAndRefreshMap(lat, lon, accuracy, heardRepeats) { setStatus("Posting to API", STATUS_COLORS.info); + // Hidden 3-second delay before API POST (user sees "Posting to API" status during this time) + await new Promise(resolve => setTimeout(resolve, 3000)); + try { await postToMeshMapperAPI(lat, lon, heardRepeats); } catch (error) { From 36eb7c6670fa36aac9e5e3e88a3662016df69e41 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 19 Dec 2025 19:19:24 +0000 Subject: [PATCH 3/7] Standardize status messages: remove ellipsis and fix typo Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com> --- content/wardrive.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/content/wardrive.js b/content/wardrive.js index 292e0a8..5358e24 100644 --- a/content/wardrive.js +++ b/content/wardrive.js @@ -300,7 +300,7 @@ const autoCountdownTimer = createCountdownTimer( } if (state.skipReason === "too close") { return { - message: `Ping skipping, too close to last ping, waiting for next ping (${remainingSec}s)`, + message: `Ping skipped, too close to last ping, waiting for next ping (${remainingSec}s)`, color: STATUS_COLORS.warning }; } @@ -322,7 +322,7 @@ const rxListeningCountdownTimer = createCountdownTimer( () => state.rxListeningEndTime, (remainingSec) => { if (remainingSec === 0) { - return { message: "Finalizing heard repeats...", color: STATUS_COLORS.info }; + return { message: "Finalizing heard repeats", color: STATUS_COLORS.info }; } return { message: `Listening for heard repeats (${remainingSec}s)`, @@ -1500,7 +1500,7 @@ async function getGpsCoordinatesForPing(isAutoMode) { // Auto mode: validate GPS freshness before sending if (!state.lastFix) { debugWarn("Auto ping skipped: no GPS fix available yet"); - setStatus("Waiting for GPS fix...", STATUS_COLORS.warning); + setStatus("Waiting for GPS fix", STATUS_COLORS.warning); return null; } @@ -1652,14 +1652,14 @@ async function sendPing(manual = false) { // Manual ping during auto mode: pause the auto countdown debugLog("Manual ping during auto mode - pausing auto countdown"); pauseAutoCountdown(); - setStatus("Sending manual ping...", STATUS_COLORS.info); + setStatus("Sending manual ping", STATUS_COLORS.info); } else if (!manual && state.running) { // Auto ping: stop the countdown timer to avoid status conflicts stopAutoCountdown(); - setStatus("Sending auto ping...", STATUS_COLORS.info); + setStatus("Sending auto ping", STATUS_COLORS.info); } else if (manual) { // Manual ping when auto is not running - setStatus("Sending manual ping...", STATUS_COLORS.info); + setStatus("Sending manual ping", STATUS_COLORS.info); } // Get GPS coordinates @@ -1913,7 +1913,7 @@ async function connect() { return; } connectBtn.disabled = true; - setStatus("Connecting…", STATUS_COLORS.info); + setStatus("Connecting", STATUS_COLORS.info); try { debugLog("Opening BLE connection..."); @@ -1985,7 +1985,7 @@ async function disconnect() { } connectBtn.disabled = true; - setStatus("Disconnecting...", STATUS_COLORS.info); + setStatus("Disconnecting", STATUS_COLORS.info); // Delete the wardriving channel before disconnecting try { From 10305f1ce4b1256128215917e31c31735e4e7c13 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 19 Dec 2025 19:21:40 +0000 Subject: [PATCH 4/7] Update STATUS_MESSAGES.md with standardized messages and function names Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com> --- STATUS_MESSAGES.md | 316 ++++++++++++++++++++++++--------------------- 1 file changed, 171 insertions(+), 145 deletions(-) diff --git a/STATUS_MESSAGES.md b/STATUS_MESSAGES.md index c2ad59a..5f5ab5b 100644 --- a/STATUS_MESSAGES.md +++ b/STATUS_MESSAGES.md @@ -1,130 +1,184 @@ # Status Messages Documentation -This document provides a comprehensive inventory of all status messages displayed in the MeshCore Wardrive web application, along with their timing characteristics and visibility guarantees. +This document provides a comprehensive inventory of all status messages displayed in the MeshCore Wardrive web application. ## Overview -All status messages now enforce a **minimum visibility duration of 500ms** to ensure readability. This applies to non-timed messages. Countdown timers respect this minimum for their first display, but subsequent updates occur immediately. +All status messages enforce a **minimum visibility duration of 500ms** to ensure readability. This applies to non-timed messages. Countdown timers respect this minimum for their first display, but subsequent updates occur immediately. -## Status Message Categories +## Standardization Rules -### 1. Connection Status Messages +Status messages follow these consistent conventions: +- **No trailing punctuation** (no ellipsis or periods for short statuses) +- **Sentence case** capitalization +- **Present progressive tense** (-ing) for ongoing actions +- **Past tense** for completed actions +- **Concise and readable** phrasing -#### Disconnected -- **Message**: `"Disconnected"` -- **Color**: Red (error) -- **Location**: `wardrive.js:1929`, `wardrive.js:1833` -- **Timing**: Persists until connection is established -- **Context**: Initial state and when BLE device disconnects -- **Minimum Visibility**: N/A (persists until replaced by user action) +--- + +## Status Messages by Category + +### 1. Connection Status Messages #### Connecting -- **Message**: `"Connecting…"` +- **Message**: `"Connecting"` - **Color**: Sky blue (info) -- **Location**: `wardrive.js:1799` -- **Timing**: Natural async timing during BLE pairing +- **Used in**: `connect()` +- **Source**: `content/wardrive.js:1916` - **Context**: When user clicks Connect button -- **Minimum Visibility**: Governed by BLE connection time (typically 2-5 seconds) +- **Minimum Visibility**: Natural async timing during BLE pairing (typically 2-5 seconds) #### Connected - **Message**: `"Connected"` - **Color**: Green (success) -- **Location**: `wardrive.js:1809` -- **Timing**: Natural async timing after successful connection +- **Used in**: `connect()` +- **Source**: `content/wardrive.js:1926` - **Context**: After BLE device successfully pairs - **Minimum Visibility**: 500ms minimum enforced #### Disconnecting -- **Message**: `"Disconnecting..."` +- **Message**: `"Disconnecting"` - **Color**: Sky blue (info) -- **Location**: `wardrive.js:1871` -- **Timing**: Brief during disconnect operation +- **Used in**: `disconnect()` +- **Source**: `content/wardrive.js:1988` - **Context**: When user clicks Disconnect button - **Minimum Visibility**: 500ms minimum enforced -#### Connection Errors -- **Message**: `"Failed to connect"` or error message +#### Disconnected +- **Message**: `"Disconnected"` - **Color**: Red (error) -- **Location**: `wardrive.js:1859`, `wardrive.js:1942` -- **Timing**: Persists until user takes action +- **Used in**: `connect()`, `disconnect()`, event handlers +- **Source**: `content/wardrive.js:1950`, `content/wardrive.js:2046` +- **Context**: Initial state and when BLE device disconnects +- **Minimum Visibility**: N/A (persists until connection is established) + +#### Failed to connect +- **Message**: `"Failed to connect"` +- **Color**: Red (error) +- **Used in**: `connect()` +- **Source**: `content/wardrive.js:1976` - **Context**: BLE connection fails - **Minimum Visibility**: N/A (error state persists) +#### Channel setup failed +- **Message**: `"Channel setup failed"` (or error message) +- **Color**: Red (error) +- **Used in**: `connect()` +- **Source**: `content/wardrive.js:1944` +- **Context**: Channel creation or lookup fails during connection +- **Minimum Visibility**: N/A (error state persists) + +#### Connection error +- **Message**: `"Connection error"` (or error message) +- **Color**: Red (error) +- **Used in**: `disconnect()` +- **Source**: `content/wardrive.js:2059` +- **Context**: Error during connection event handling +- **Minimum Visibility**: N/A (error state persists) + +#### Disconnect failed +- **Message**: `"Disconnect failed"` (or error message) +- **Color**: Red (error) +- **Used in**: `disconnect()` +- **Source**: `content/wardrive.js:2018` +- **Context**: Error during disconnect operation +- **Minimum Visibility**: N/A (error state persists) + --- ### 2. Ping Operation Messages -#### Sending Ping -- **Message**: `"Sending manual ping..."` or `"Sending auto ping..."` +#### Sending manual ping +- **Message**: `"Sending manual ping"` +- **Color**: Sky blue (info) +- **Used in**: `sendPing()` +- **Source**: `content/wardrive.js:1655`, `content/wardrive.js:1662` +- **Context**: When ping button clicked +- **Minimum Visibility**: 500ms minimum enforced + +#### Sending auto ping +- **Message**: `"Sending auto ping"` - **Color**: Sky blue (info) -- **Location**: `wardrive.js:1555`, `wardrive.js:1559`, `wardrive.js:1562` -- **Timing**: Brief, displayed during GPS acquisition and validation -- **Context**: Immediately when ping button clicked or auto ping triggers +- **Used in**: `sendPing()` +- **Source**: `content/wardrive.js:1659` +- **Context**: Auto ping triggers +- **Minimum Visibility**: 500ms minimum enforced + +#### Ping sent +- **Message**: `"Ping sent"` +- **Color**: Green (success) +- **Used in**: `sendPing()` +- **Source**: `content/wardrive.js:1749` +- **Context**: After successful manual ping transmission to mesh device - **Minimum Visibility**: 500ms minimum enforced +- **Notes**: This was the primary message mentioned in previous issues as flashing too quickly -#### Ping Sent (Primary Issue Fixed) -- **Message**: `"Ping sent"` or `"Auto ping sent"` +#### Auto ping sent +- **Message**: `"Auto ping sent"` - **Color**: Green (success) -- **Location**: `wardrive.js:1724` -- **Timing**: **Now visible for ≥500ms** (previously ~100ms) -- **Context**: After successful ping transmission to mesh device -- **Minimum Visibility**: **500ms minimum enforced** ✅ -- **Notes**: This was the primary message mentioned in the issue as flashing too quickly +- **Used in**: `sendPing()` +- **Source**: `content/wardrive.js:1749` +- **Context**: After successful auto ping transmission to mesh device +- **Minimum Visibility**: 500ms minimum enforced + +#### Ping failed +- **Message**: `"Ping failed"` (or error message) +- **Color**: Red (error) +- **Used in**: `sendPing()` +- **Source**: `content/wardrive.js:1805` +- **Context**: Ping operation encounters an error +- **Minimum Visibility**: N/A (error state persists) -#### Ping Validation Failures +#### Ping skipped, outside of geo fenced region - **Message**: `"Ping skipped, outside of geo fenced region"` - **Color**: Amber (warning) -- **Location**: `wardrive.js:1588` -- **Timing**: Persists until next ping attempt (manual) or shows in countdown (auto) +- **Used in**: `sendPing()` +- **Source**: `content/wardrive.js:1688` - **Context**: GPS coordinates outside Ottawa 150km radius - **Minimum Visibility**: 500ms minimum enforced +#### Ping skipped, too close to last ping - **Message**: `"Ping skipped, too close to last ping"` - **Color**: Amber (warning) -- **Location**: `wardrive.js:1608` -- **Timing**: Persists until next ping attempt +- **Used in**: `sendPing()` +- **Source**: `content/wardrive.js:1708` - **Context**: Current location < 25m from last successful ping - **Minimum Visibility**: 500ms minimum enforced -#### Cooldown Messages -- **Message**: `"Please wait Xs before sending another ping"` +#### Please wait Xs before sending another ping +- **Message**: `"Please wait Xs before sending another ping"` (X is dynamic countdown) - **Color**: Amber (warning) -- **Location**: `wardrive.js:1546` -- **Timing**: Shows remaining cooldown seconds +- **Used in**: `sendPing()` +- **Source**: `content/wardrive.js:1646` - **Context**: User attempts manual ping during 7-second cooldown - **Minimum Visibility**: 500ms minimum enforced -- **Message**: `"Please wait Xs before toggling auto mode"` -- **Color**: Amber (warning) -- **Location**: `wardrive.js:1699`, `wardrive.js:1759` -- **Timing**: Shows remaining cooldown seconds -- **Context**: User attempts to toggle auto mode during cooldown -- **Minimum Visibility**: 500ms minimum enforced - --- ### 3. GPS Status Messages -#### GPS Acquisition -- **Message**: `"Waiting for GPS fix..."` +#### Waiting for GPS fix +- **Message**: `"Waiting for GPS fix"` - **Color**: Amber (warning) -- **Location**: `wardrive.js:1403` -- **Timing**: Persists until GPS lock acquired -- **Context**: Auto ping triggered but no GPS fix available yet +- **Used in**: `getGpsCoordinatesForPing()` +- **Source**: `content/wardrive.js:1503` +- **Context**: Auto ping triggered but no GPS lock acquired yet - **Minimum Visibility**: 500ms minimum enforced -#### GPS Stale Data +#### GPS data old, trying to refresh position - **Message**: `"GPS data old, trying to refresh position"` - **Color**: Amber (warning) -- **Location**: `wardrive.js:1414` -- **Timing**: Brief during GPS refresh attempt +- **Used in**: `getGpsCoordinatesForPing()` +- **Source**: `content/wardrive.js:1514` - **Context**: Auto ping with stale GPS data, attempting refresh - **Minimum Visibility**: 500ms minimum enforced +#### GPS data too old, requesting fresh position - **Message**: `"GPS data too old, requesting fresh position"` - **Color**: Amber (warning) -- **Location**: `wardrive.js:1467` -- **Timing**: Brief during GPS acquisition +- **Used in**: `getGpsCoordinatesForPing()` +- **Source**: `content/wardrive.js:1567` - **Context**: Manual ping with stale GPS data - **Minimum Visibility**: 500ms minimum enforced @@ -134,62 +188,54 @@ All status messages now enforce a **minimum visibility duration of 500ms** to en These messages use a hybrid approach: **first display respects 500ms minimum**, then updates occur immediately every second. -#### RX Listening Countdown -- **Message**: `"Listening for heard repeats (Xs)"` +#### Listening for heard repeats (Xs) +- **Message**: `"Listening for heard repeats (Xs)"` (X is dynamic countdown) - **Color**: Sky blue (info) -- **Location**: `wardrive.js:313` (countdown definition) -- **Timing**: - - **First display**: Respects 500ms minimum after "Ping sent" - - **Updates**: Immediate every 1 second (7s → 6s → 5s → ...) +- **Used in**: `rxListeningCountdownTimer` +- **Source**: `content/wardrive.js:328` - **Context**: After successful ping, listening for repeater echoes - **Duration**: 7 seconds total - **Minimum Visibility**: 500ms for first message, immediate for countdown updates -- **Message**: `"Finalizing heard repeats..."` +#### Finalizing heard repeats +- **Message**: `"Finalizing heard repeats"` - **Color**: Sky blue (info) -- **Location**: `wardrive.js:310` -- **Timing**: Displays at end of 7-second window +- **Used in**: `rxListeningCountdownTimer` +- **Source**: `content/wardrive.js:325` - **Context**: Countdown reached 0, processing repeater data - **Minimum Visibility**: Immediate (countdown update) -#### Auto Ping Countdown -- **Message**: `"Waiting for next auto ping (Xs)"` +#### Waiting for next auto ping (Xs) +- **Message**: `"Waiting for next auto ping (Xs)"` (X is dynamic countdown) - **Color**: Slate (idle) -- **Location**: `wardrive.js:299` -- **Timing**: - - **First display**: Respects 500ms minimum - - **Updates**: Immediate every 1 second +- **Used in**: `autoCountdownTimer` +- **Source**: `content/wardrive.js:314` - **Context**: Auto mode active, between pings - **Duration**: 15s, 30s, or 60s (user-selectable) - **Minimum Visibility**: 500ms for first message, immediate for countdown updates -- **Message**: `"Sending auto ping..."` -- **Color**: Sky blue (info) -- **Location**: `wardrive.js:278` -- **Timing**: Brief before auto ping execution -- **Context**: Auto countdown reaches 0 -- **Minimum Visibility**: Immediate (countdown update at 0) - -#### Auto Ping Countdown with Skip Reason -- **Message**: `"Ping skipped, outside of geo fenced region, waiting for next ping (Xs)"` +#### Ping skipped, outside of geo fenced region, waiting for next ping (Xs) +- **Message**: `"Ping skipped, outside of geo fenced region, waiting for next ping (Xs)"` (X is dynamic countdown) - **Color**: Amber (warning) -- **Location**: `wardrive.js:210` -- **Timing**: Updates every 1 second during countdown +- **Used in**: `autoCountdownTimer` +- **Source**: `content/wardrive.js:297` - **Context**: Auto ping skipped due to geofence, showing countdown - **Minimum Visibility**: 500ms for first message, immediate for updates -- **Message**: `"Ping skipping, too close to last ping, waiting for next ping (Xs)"` +#### Ping skipped, too close to last ping, waiting for next ping (Xs) +- **Message**: `"Ping skipped, too close to last ping, waiting for next ping (Xs)"` (X is dynamic countdown) - **Color**: Amber (warning) -- **Location**: `wardrive.js:216` -- **Timing**: Updates every 1 second during countdown +- **Used in**: `autoCountdownTimer` +- **Source**: `content/wardrive.js:303` - **Context**: Auto ping skipped due to distance check, showing countdown - **Minimum Visibility**: 500ms for first message, immediate for updates -- **Message**: `"Skipped (gps too old), next ping (Xs)"` +#### Skipped (X), next ping (Ys) +- **Message**: `"Skipped (X), next ping (Ys)"` (X is skip reason, Y is countdown) - **Color**: Amber (warning) -- **Location**: `wardrive.js:222` -- **Timing**: Updates every 1 second during countdown -- **Context**: Auto ping skipped due to GPS staleness, showing countdown +- **Used in**: `autoCountdownTimer` +- **Source**: `content/wardrive.js:309` +- **Context**: Auto ping skipped for generic reason (e.g., "gps too old"), showing countdown - **Minimum Visibility**: 500ms for first message, immediate for updates --- @@ -199,53 +245,47 @@ These messages use a hybrid approach: **first display respects 500ms minimum**, #### Posting to API - **Message**: `"Posting to API"` - **Color**: Sky blue (info) -- **Location**: `wardrive.js:1037` -- **Timing**: Visible during API POST operation (typically ~500-1500ms) +- **Used in**: `postApiAndRefreshMap()` +- **Source**: `content/wardrive.js:1055` - **Context**: After RX listening window, posting ping data to MeshMapper API -- **Minimum Visibility**: 500ms minimum enforced (naturally ~1000ms due to API timing) +- **Timing**: Visible during API POST operation (3-second hidden delay + API call time, typically ~3.5-4.5s total) +- **Minimum Visibility**: 500ms minimum enforced (naturally ~4s due to 3s delay + API timing) +- **Notes**: A 3-second hidden delay occurs before the actual API call to ensure good visibility -#### Idle State +#### Idle - **Message**: `"Idle"` - **Color**: Slate (idle) -- **Location**: `wardrive.js:1070` -- **Timing**: Persists until next operation +- **Used in**: `postApiAndRefreshMap()` +- **Source**: `content/wardrive.js:1091` - **Context**: Manual mode, after API post completes - **Minimum Visibility**: 500ms minimum enforced --- -### 6. Channel and Setup Messages - -#### Channel Setup -- **Message**: Error message from channel setup failure -- **Color**: Red (error) -- **Location**: `wardrive.js:1827` -- **Timing**: Persists until user takes action -- **Context**: Channel creation or lookup fails during connection -- **Minimum Visibility**: N/A (error state persists) - ---- +### 6. Auto Mode Messages -### 7. Page Visibility Messages +#### Auto mode stopped +- **Message**: `"Auto mode stopped"` +- **Color**: Slate (idle) +- **Used in**: `disconnect()` (event handler for stopping auto mode) +- **Source**: `content/wardrive.js:2070` +- **Context**: User clicks "Stop Auto Ping" button +- **Minimum Visibility**: 500ms minimum enforced -#### Lost Focus +#### Lost focus, auto mode stopped - **Message**: `"Lost focus, auto mode stopped"` - **Color**: Amber (warning) -- **Location**: `wardrive.js:1915` -- **Timing**: Persists until page regains focus +- **Used in**: `disconnect()` (page visibility handler) +- **Source**: `content/wardrive.js:2032` - **Context**: Browser tab hidden while auto mode running - **Minimum Visibility**: 500ms minimum enforced ---- - -### 8. Auto Mode Toggle Messages - -#### Auto Mode Stopped -- **Message**: `"Auto mode stopped"` -- **Color**: Slate (idle) -- **Location**: `wardrive.js:1953` -- **Timing**: Brief confirmation message -- **Context**: User clicks "Stop Auto Ping" button +#### Please wait Xs before toggling auto mode +- **Message**: `"Please wait Xs before toggling auto mode"` (X is dynamic countdown) +- **Color**: Amber (warning) +- **Used in**: `stopAutoPing()`, `startAutoPing()` +- **Source**: `content/wardrive.js:1816`, `content/wardrive.js:1876` +- **Context**: User attempts to toggle auto mode during cooldown period - **Minimum Visibility**: 500ms minimum enforced --- @@ -305,30 +345,16 @@ Result: "Message A" (visible 500ms) → "Message C" --- -## Testing - -To test status message visibility: -1. Connect to a MeshCore device via Bluetooth -2. Observe "Connected" message remains visible for ≥500ms -3. Click "Send Ping" button -4. Verify "Ping sent" message is visible for ≥500ms before "Listening for heard repeats" appears -5. Observe countdown updates occur immediately (7s → 6s → 5s...) -6. In auto mode, verify countdown messages update every second without delay - ---- - ## Summary -**Total Status Messages**: 26 unique message patterns -- **Connection**: 6 messages -- **Ping Operation**: 5 messages +**Total Status Messages**: 28 unique message patterns +- **Connection**: 8 messages +- **Ping Operation**: 7 messages - **GPS**: 3 messages - **Countdown Timers**: 6 message patterns (with dynamic countdown values) - **API/Map**: 2 messages -- **Channel Setup**: 1 message category -- **Page Visibility**: 1 message -- **Auto Mode**: 2 messages +- **Auto Mode**: 3 messages **Minimum Visibility**: All non-countdown messages enforce **500ms minimum visibility**. Countdown messages respect this minimum on first display, then update immediately. -**Primary Fix**: The "Ping sent" message (the example in the original issue) now remains visible for **at least 500ms** before being replaced by "Listening for heard repeats". +**Standardization**: All messages follow consistent conventions with no trailing punctuation, sentence case capitalization, and appropriate verb tenses. From 75e8535e2c57f43d88a833e5995e7478e1f0ab1b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 19 Dec 2025 20:45:15 +0000 Subject: [PATCH 5/7] Consolidate duplicate GPS status messages into single standardized message Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com> --- STATUS_MESSAGES.md | 16 ++++------------ content/wardrive.js | 2 +- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/STATUS_MESSAGES.md b/STATUS_MESSAGES.md index 5f5ab5b..d7811f5 100644 --- a/STATUS_MESSAGES.md +++ b/STATUS_MESSAGES.md @@ -166,20 +166,12 @@ Status messages follow these consistent conventions: - **Context**: Auto ping triggered but no GPS lock acquired yet - **Minimum Visibility**: 500ms minimum enforced -#### GPS data old, trying to refresh position -- **Message**: `"GPS data old, trying to refresh position"` -- **Color**: Amber (warning) -- **Used in**: `getGpsCoordinatesForPing()` -- **Source**: `content/wardrive.js:1514` -- **Context**: Auto ping with stale GPS data, attempting refresh -- **Minimum Visibility**: 500ms minimum enforced - #### GPS data too old, requesting fresh position - **Message**: `"GPS data too old, requesting fresh position"` - **Color**: Amber (warning) - **Used in**: `getGpsCoordinatesForPing()` -- **Source**: `content/wardrive.js:1567` -- **Context**: Manual ping with stale GPS data +- **Source**: `content/wardrive.js:1514`, `content/wardrive.js:1567` +- **Context**: GPS data is stale and needs refresh (used in both auto and manual ping modes) - **Minimum Visibility**: 500ms minimum enforced --- @@ -347,10 +339,10 @@ Result: "Message A" (visible 500ms) → "Message C" ## Summary -**Total Status Messages**: 28 unique message patterns +**Total Status Messages**: 27 unique message patterns - **Connection**: 8 messages - **Ping Operation**: 7 messages -- **GPS**: 3 messages +- **GPS**: 2 messages - **Countdown Timers**: 6 message patterns (with dynamic countdown values) - **API/Map**: 2 messages - **Auto Mode**: 3 messages diff --git a/content/wardrive.js b/content/wardrive.js index 5358e24..291d6b1 100644 --- a/content/wardrive.js +++ b/content/wardrive.js @@ -1511,7 +1511,7 @@ async function getGpsCoordinatesForPing(isAutoMode) { if (ageMs >= maxAge) { debugLog(`GPS data too old for auto ping (${ageMs}ms), attempting to refresh`); - setStatus("GPS data old, trying to refresh position", STATUS_COLORS.warning); + setStatus("GPS data too old, requesting fresh position", STATUS_COLORS.warning); try { return await acquireFreshGpsPosition(); From 579ee85d62890143f88851ef24df7001aad74c7f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 19 Dec 2025 20:48:43 +0000 Subject: [PATCH 6/7] Fix remaining message inconsistencies: remove ellipsis and standardize error format Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com> --- STATUS_MESSAGES.md | 24 ++++++++---------------- content/wardrive.js | 6 +++--- 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/STATUS_MESSAGES.md b/STATUS_MESSAGES.md index d7811f5..69cf53c 100644 --- a/STATUS_MESSAGES.md +++ b/STATUS_MESSAGES.md @@ -53,12 +53,12 @@ Status messages follow these consistent conventions: - **Context**: Initial state and when BLE device disconnects - **Minimum Visibility**: N/A (persists until connection is established) -#### Failed to connect -- **Message**: `"Failed to connect"` +#### Connection failed +- **Message**: `"Connection failed"` (or error message) - **Color**: Red (error) -- **Used in**: `connect()` -- **Source**: `content/wardrive.js:1976` -- **Context**: BLE connection fails +- **Used in**: `connect()`, event handlers +- **Source**: `content/wardrive.js:1976`, `content/wardrive.js:2059` +- **Context**: BLE connection fails or connection button error - **Minimum Visibility**: N/A (error state persists) #### Channel setup failed @@ -69,14 +69,6 @@ Status messages follow these consistent conventions: - **Context**: Channel creation or lookup fails during connection - **Minimum Visibility**: N/A (error state persists) -#### Connection error -- **Message**: `"Connection error"` (or error message) -- **Color**: Red (error) -- **Used in**: `disconnect()` -- **Source**: `content/wardrive.js:2059` -- **Context**: Error during connection event handling -- **Minimum Visibility**: N/A (error state persists) - #### Disconnect failed - **Message**: `"Disconnect failed"` (or error message) - **Color**: Red (error) @@ -339,8 +331,8 @@ Result: "Message A" (visible 500ms) → "Message C" ## Summary -**Total Status Messages**: 27 unique message patterns -- **Connection**: 8 messages +**Total Status Messages**: 26 unique message patterns +- **Connection**: 7 messages - **Ping Operation**: 7 messages - **GPS**: 2 messages - **Countdown Timers**: 6 message patterns (with dynamic countdown values) @@ -349,4 +341,4 @@ Result: "Message A" (visible 500ms) → "Message C" **Minimum Visibility**: All non-countdown messages enforce **500ms minimum visibility**. Countdown messages respect this minimum on first display, then update immediately. -**Standardization**: All messages follow consistent conventions with no trailing punctuation, sentence case capitalization, and appropriate verb tenses. +**Standardization**: All messages follow consistent conventions with no trailing punctuation, sentence case capitalization, appropriate verb tenses, and consistent error message format (X failed). diff --git a/content/wardrive.js b/content/wardrive.js index 291d6b1..17847c5 100644 --- a/content/wardrive.js +++ b/content/wardrive.js @@ -289,7 +289,7 @@ const autoCountdownTimer = createCountdownTimer( (remainingSec) => { if (!state.running) return null; if (remainingSec === 0) { - return { message: "Sending auto ping...", color: STATUS_COLORS.info }; + return { message: "Sending auto ping", color: STATUS_COLORS.info }; } // If there's a skip reason, show it with the countdown in warning color if (state.skipReason === "outside geofence") { @@ -1973,7 +1973,7 @@ async function connect() { } catch (e) { debugError(`BLE connection failed: ${e.message}`, e); - setStatus("Failed to connect", STATUS_COLORS.error); + setStatus("Connection failed", STATUS_COLORS.error); connectBtn.disabled = false; } } @@ -2056,7 +2056,7 @@ export async function onLoad() { } } catch (e) { debugError(`Connection button error: ${e.message}`, e); - setStatus(e.message || "Connection error", STATUS_COLORS.error); + setStatus(e.message || "Connection failed", STATUS_COLORS.error); } }); sendPingBtn.addEventListener("click", () => { From a4479a2447de495ce7e6338e1ae0a02d13c1d4ae Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 19 Dec 2025 20:59:08 +0000 Subject: [PATCH 7/7] Final consistency pass: consolidate duplicates, fix capitalization, standardize tone Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com> --- STATUS_MESSAGES.md | 45 ++++++++++++++++++++++----------------------- content/wardrive.js | 12 ++++++------ 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/STATUS_MESSAGES.md b/STATUS_MESSAGES.md index 69cf53c..58f5e6a 100644 --- a/STATUS_MESSAGES.md +++ b/STATUS_MESSAGES.md @@ -102,17 +102,9 @@ Status messages follow these consistent conventions: - **Color**: Green (success) - **Used in**: `sendPing()` - **Source**: `content/wardrive.js:1749` -- **Context**: After successful manual ping transmission to mesh device -- **Minimum Visibility**: 500ms minimum enforced -- **Notes**: This was the primary message mentioned in previous issues as flashing too quickly - -#### Auto ping sent -- **Message**: `"Auto ping sent"` -- **Color**: Green (success) -- **Used in**: `sendPing()` -- **Source**: `content/wardrive.js:1749` -- **Context**: After successful auto ping transmission to mesh device +- **Context**: After successful ping transmission to mesh device (both manual and auto pings) - **Minimum Visibility**: 500ms minimum enforced +- **Notes**: Consolidated from separate "Ping sent" and "Auto ping sent" messages #### Ping failed - **Message**: `"Ping failed"` (or error message) @@ -122,11 +114,11 @@ Status messages follow these consistent conventions: - **Context**: Ping operation encounters an error - **Minimum Visibility**: N/A (error state persists) -#### Ping skipped, outside of geo fenced region -- **Message**: `"Ping skipped, outside of geo fenced region"` +#### Ping skipped, outside of geofenced region +- **Message**: `"Ping skipped, outside of geofenced region"` - **Color**: Amber (warning) -- **Used in**: `sendPing()` -- **Source**: `content/wardrive.js:1688` +- **Used in**: `sendPing()`, `autoCountdownTimer` +- **Source**: `content/wardrive.js:1688`, `content/wardrive.js:297` - **Context**: GPS coordinates outside Ottawa 150km radius - **Minimum Visibility**: 500ms minimum enforced @@ -138,8 +130,8 @@ Status messages follow these consistent conventions: - **Context**: Current location < 25m from last successful ping - **Minimum Visibility**: 500ms minimum enforced -#### Please wait Xs before sending another ping -- **Message**: `"Please wait Xs before sending another ping"` (X is dynamic countdown) +#### Wait Xs before sending another ping +- **Message**: `"Wait Xs before sending another ping"` (X is dynamic countdown) - **Color**: Amber (warning) - **Used in**: `sendPing()` - **Source**: `content/wardrive.js:1646` @@ -198,8 +190,8 @@ These messages use a hybrid approach: **first display respects 500ms minimum**, - **Duration**: 15s, 30s, or 60s (user-selectable) - **Minimum Visibility**: 500ms for first message, immediate for countdown updates -#### Ping skipped, outside of geo fenced region, waiting for next ping (Xs) -- **Message**: `"Ping skipped, outside of geo fenced region, waiting for next ping (Xs)"` (X is dynamic countdown) +#### Ping skipped, outside of geofenced region, waiting for next ping (Xs) +- **Message**: `"Ping skipped, outside of geofenced region, waiting for next ping (Xs)"` (X is dynamic countdown) - **Color**: Amber (warning) - **Used in**: `autoCountdownTimer` - **Source**: `content/wardrive.js:297` @@ -264,8 +256,8 @@ These messages use a hybrid approach: **first display respects 500ms minimum**, - **Context**: Browser tab hidden while auto mode running - **Minimum Visibility**: 500ms minimum enforced -#### Please wait Xs before toggling auto mode -- **Message**: `"Please wait Xs before toggling auto mode"` (X is dynamic countdown) +#### Wait Xs before toggling auto mode +- **Message**: `"Wait Xs before toggling auto mode"` (X is dynamic countdown) - **Color**: Amber (warning) - **Used in**: `stopAutoPing()`, `startAutoPing()` - **Source**: `content/wardrive.js:1816`, `content/wardrive.js:1876` @@ -331,9 +323,9 @@ Result: "Message A" (visible 500ms) → "Message C" ## Summary -**Total Status Messages**: 26 unique message patterns +**Total Status Messages**: 25 unique message patterns - **Connection**: 7 messages -- **Ping Operation**: 7 messages +- **Ping Operation**: 6 messages (consolidated "Ping sent" for both manual and auto) - **GPS**: 2 messages - **Countdown Timers**: 6 message patterns (with dynamic countdown values) - **API/Map**: 2 messages @@ -341,4 +333,11 @@ Result: "Message A" (visible 500ms) → "Message C" **Minimum Visibility**: All non-countdown messages enforce **500ms minimum visibility**. Countdown messages respect this minimum on first display, then update immediately. -**Standardization**: All messages follow consistent conventions with no trailing punctuation, sentence case capitalization, appropriate verb tenses, and consistent error message format (X failed). +**Standardization**: All messages follow consistent conventions: +- No trailing punctuation +- Sentence case capitalization +- Present progressive tense (-ing) for ongoing actions +- Past tense for completed actions +- Consistent "X failed" format for error messages +- Consistent tone (direct, technical) - removed "Please" from wait messages +- Proper compound words ("geofenced" not "geo fenced") diff --git a/content/wardrive.js b/content/wardrive.js index 17847c5..e56379c 100644 --- a/content/wardrive.js +++ b/content/wardrive.js @@ -294,7 +294,7 @@ const autoCountdownTimer = createCountdownTimer( // If there's a skip reason, show it with the countdown in warning color if (state.skipReason === "outside geofence") { return { - message: `Ping skipped, outside of geo fenced region, waiting for next ping (${remainingSec}s)`, + message: `Ping skipped, outside of geofenced region, waiting for next ping (${remainingSec}s)`, color: STATUS_COLORS.warning }; } @@ -1643,7 +1643,7 @@ async function sendPing(manual = false) { if (manual && isInCooldown()) { const remainingSec = getRemainingCooldownSeconds(); debugLog(`Manual ping blocked by cooldown (${remainingSec}s remaining)`); - setStatus(`Please wait ${remainingSec}s before sending another ping`, STATUS_COLORS.warning); + setStatus(`Wait ${remainingSec}s before sending another ping`, STATUS_COLORS.warning); return; } @@ -1685,7 +1685,7 @@ async function sendPing(manual = false) { if (manual) { // Manual ping: show skip message that persists - setStatus("Ping skipped, outside of geo fenced region", STATUS_COLORS.warning); + setStatus("Ping skipped, outside of geofenced region", STATUS_COLORS.warning); } else if (state.running) { // Auto ping: schedule next ping and show countdown with skip message scheduleNextAutoPing(); @@ -1746,7 +1746,7 @@ async function sendPing(manual = false) { startCooldown(); // Update status after ping is sent - setStatus(manual ? "Ping sent" : "Auto ping sent", STATUS_COLORS.success); + setStatus("Ping sent", STATUS_COLORS.success); // Create UI log entry with placeholder for repeater data const logEntry = logPingToUI(payload, lat, lon); @@ -1813,7 +1813,7 @@ function stopAutoPing(stopGps = false) { if (!stopGps && isInCooldown()) { const remainingSec = getRemainingCooldownSeconds(); debugLog(`Auto ping stop blocked by cooldown (${remainingSec}s remaining)`); - setStatus(`Please wait ${remainingSec}s before toggling auto mode`, STATUS_COLORS.warning); + setStatus(`Wait ${remainingSec}s before toggling auto mode`, STATUS_COLORS.warning); return; } @@ -1873,7 +1873,7 @@ function startAutoPing() { if (isInCooldown()) { const remainingSec = getRemainingCooldownSeconds(); debugLog(`Auto ping start blocked by cooldown (${remainingSec}s remaining)`); - setStatus(`Please wait ${remainingSec}s before toggling auto mode`, STATUS_COLORS.warning); + setStatus(`Wait ${remainingSec}s before toggling auto mode`, STATUS_COLORS.warning); return; }