Skip to content

Optimize RX UI rendering, add Error Log, and standardize debug logging tags#136

Merged
MrAlders0n merged 6 commits into
devfrom
copilot/update-debug-logging-guidelines
Dec 23, 2025
Merged

Optimize RX UI rendering, add Error Log, and standardize debug logging tags#136
MrAlders0n merged 6 commits into
devfrom
copilot/update-debug-logging-guidelines

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 23, 2025

Fixes excessive debug console output from RX UI re-rendering all entries, removes queue status from user-visible status bar, adds Error Log UI for session error tracking, and standardizes 400+ debug messages with subsystem tags for filtering.

Changes

RX UI Rendering Optimization

  • Modified renderRxLogEntries() to support incremental vs full rendering modes
  • New entries append directly instead of clearing and re-rendering entire list
  • Full re-render only when removing old entries due to capacity limit

Before: Debug console logs all 12 entries on 13th arrival
After: Debug console logs only entry 13/13

Status Bar Cleanup

  • Removed Queued (X/50) from dynamic status bar (user-visible)
  • Removed Posting ${batch.length} to API from dynamic status bar
  • Debug logging preserved for both operations

Error Log UI

  • New collapsible Error Log panel below RX Log with matching visual style
  • Automatic error capture via debugError() hook when debug mode enabled
  • Displays timestamp, source tag, and message for each error
  • 50-entry capacity with incremental rendering
  • Summary bar shows error count and last occurrence time
// Error capture extracts tag from message
debugError("[BLE] Connection failed: timeout");
// → Appears in Error Log UI as:
//   [BLE] Connection failed: timeout
//   12:34:56 PM

Debug Log Tagging

Tagged all debug messages with subsystem identifiers for console filtering:

Tag Coverage
[BLE] Bluetooth connection and device communication
[GPS] GPS/geolocation operations
[PING] Ping sending, validation, and repeater tracking
[API QUEUE] API batch queue and MeshMapper operations
[UI] Status bar, buttons, controls
[CHANNEL] Channel setup and management
[TIMER] Countdown and scheduling
[GEOFENCE] Distance and boundary validation
[AUTO] Auto-ping mode operations

Plus: [RX BATCH], [PASSIVE RX], [PASSIVE RX UI], [SESSION LOG], [UNIFIED RX], [DECRYPT], [WAKE LOCK], [CAPACITY], [INIT], [ERROR LOG]

Updated docs/DEVELOPMENT_REQUIREMENTS.md with tag table and usage examples.

Example filter in console:

// Show only GPS-related messages
debugLog("[GPS] GPS fix acquired: lat=45.12345, lon=-75.12345, accuracy=8m")
Original prompt

MeshCore GOME WarDriver - Development Guidelines

Overview

This document defines the coding standards and requirements for all changes to the MeshCore GOME WarDriver repository. AI agents and contributors must follow these guidelines for every modification.


Code Style & Standards

Debug Logging

  • ALWAYS include debug console logging for significant operations
  • Use the existing debug helper functions:
    • debugLog(message, ...args) - For general debug information
    • debugWarn(message, ... args) - For warning conditions
    • debugError(message, ... args) - For error conditions
  • Debug logging is controlled by the DEBUG_ENABLED flag (URL parameter ? debug=true)
  • Log at key points: function entry, API calls, state changes, errors, and decision branches

Status Messages

  • ALWAYS update STATUS_MESSAGES.md when adding or modifying user-facing status messages
  • Use the setStatus(message, color) function for all UI status updates
  • Use appropriate STATUS_COLORS constants:
    • STATUS_COLORS.idle - Default/waiting state
    • STATUS_COLORS. success - Successful operations
    • STATUS_COLORS.warning - Warning conditions
    • STATUS_COLORS.error - Error states
    • STATUS_COLORS.info - Informational/in-progress states

Documentation Requirements

Code Comments

  • Document complex logic with inline comments
  • Use JSDoc-style comments for functions:
    • @param for parameters
    • @returns for return values
    • Brief description of purpose

docs/STATUS_MESSAGES.md Updates

When adding new status messages, include:

  • The exact status message text
  • When it appears (trigger condition)
  • The status color used
  • Any follow-up actions or states���

docs/CONNECTION_WORKFLOW.md Updates

When modifying connect or disconnect logic, you must:

  • Read docs/CONNECTION_WORKFLOW.md before making the change (to understand current intended behavior).
  • Update docs/CONNECTION_WORKFLOW.md so it remains accurate after the change:
    • Steps/sequence of the workflow
    • Any new states, retries, timeouts, or error handling
    • Any UI impacts (buttons, indicators, status messages)

docs/PING_AUTO_PING_WORKFLOW.md Updates

When modifying ping or auto-ping logic, you must:

  • Read docs/PING_AUTO_PING_WORKFLOW.md before making the change (to understand current intended behavior).
  • Update docs/PING_AUTO_PING_WORKFLOW.md so it remains accurate after the change:
    • Ping flows (manual sendPing(), auto-ping lifecycle)
    • Validation logic (geofence, distance, cooldown)
    • GPS acquisition and payload construction
    • Repeater tracking and MeshMapper API posting
    • Control locking and cooldown management
    • Auto mode behavior (intervals, wake lock, page visibility)
    • Any UI impacts (buttons, status messages, countdown displays)

Requested Change

MeshCore GOME WarDriver: Bug Fixes and Enhancements

Summary

Fix debug logging issues, simplify status bar messaging, add a new Error Log UI component, and standardize debug log tagging in the MeshCore GOME WarDriver web app.


Bug Fix 1: PASSIVE RX UI Re-rendering All Entries on Each New Event

Current Behavior

The renderRxLogEntries() function clears and re-renders ALL entries every time a new RX event is received. This causes excessive debug console output showing all entries being appended each time:

[DEBUG] [PASSIVE RX UI] Rendering 12 RX log entries
[DEBUG] [PASSIVE RX UI] Appended entry 1/12
[DEBUG] [PASSIVE RX UI] Appended entry 2/12
... 
[DEBUG] [PASSIVE RX UI] Appended entry 12/12
[DEBUG] [PASSIVE RX UI] Auto-scrolled to top

Then when a 13th entry arrives:

[DEBUG] [PASSIVE RX UI] Rendering 13 RX log entries
[DEBUG] [PASSIVE RX UI] Appended entry 1/13
[DEBUG] [PASSIVE RX UI] Appended entry 2/13
... 
[DEBUG] [PASSIVE RX UI] Appended entry 13/13

Expected Behavior

When a new RX entry is added, only append the new entry to the DOM instead of re-rendering all entries. The debug log should only show the new entry being added (e.g., Appended entry 13/13).

Files Affected

  • content/wardrive.js - renderRxLogEntries() function and addRxLogEntry() function

Bug Fix 2: Remove "Status applied" Debug Messages

Current Behavior

The applyStatusImmediately() function logs [DEBUG] Status applied: "<message>" for every status update. This clutters the debug console:

[DEBUG] Status applied:  "Queued (1/50)"
[DEBUG] Status applied:  "Queued (2/50)"

Expected Behavior

Remove or suppress the debugLog(Status applied: "${text}") call. The existing debug logging earlier in the status update flow is sufficient.

Files Affected

  • content/wardrive.js - applyStatusImmediately() function (line 296)

Enhancement 1: Add ERROR Log UI Below RX Log

Description

Add a new "Error Log" section below the existing RX Log in the user interface. This log should capture and display all errors that occur during the session so...


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 5 commits December 23, 2025 02:06
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
…NCE)

Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Copilot AI changed the title [WIP] Update debug logging standards for WarDriver Optimize RX UI rendering, add Error Log, and standardize debug logging tags Dec 23, 2025
Copilot AI requested a review from MrAlders0n December 23, 2025 02:24
@MrAlders0n MrAlders0n marked this pull request as ready for review December 23, 2025 02:26
@MrAlders0n MrAlders0n merged commit bdb2ae7 into dev Dec 23, 2025
@MrAlders0n MrAlders0n deleted the copilot/update-debug-logging-guidelines branch December 23, 2025 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants