Skip to content

Use git-describe versions for firmware/UI comparison with suppression controls and optimized memory usage - #265

Draft
MaslowBot with Copilot wants to merge 5 commits into
Maslow-Mainfrom
copilot/modify-version-comparison-popup
Draft

MaslowBot with Copilot wants to merge 5 commits into
Maslow-Mainfrom
copilot/modify-version-comparison-popup

Conversation

Copilot AI commented Nov 17, 2025 •

Copy link
Copy Markdown

Description

The version comparison popup was comparing incompatible version formats: firmware reported FluidNC v1.14 (head-7fe778c0) while UI used github.com/BarbourSmith/ESP3D-WEBUI@v1.14. Both systems generate versions via git describe --always --tags --dirty but the comparison logic wasn't extracting them correctly.

This PR extracts git-describe format versions from both firmware and UI, implements a strict exact-match comparison to ensure firmware and UI are in sync, and adds user controls to suppress version warnings. Additionally, the dialog has been optimized to minimize memory usage to prevent low memory warnings on ESP32 devices.

Fixes #264

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Changes Made

Version extraction and comparison

  • Extract git-describe format from both firmware (FluidNC v1.14 (v1.14) → v1.14) and UI (github.com/.../ESP3D-WEBUI@v1.14-4-g4b33628 → v1.14-4-g4b33628)
  • Strict exact-match comparison: Only identical versions are considered compatible
    • v1.14 vs v1.14-2-gabcd123 → WARNING (release vs development)
    • v1.14-2-gabcd123 vs v1.14-3-gdef456 → WARNING (different commits)
    • v1.14 vs v1.14 → NO WARNING (exact match only)
  • Replace old multi-type version parser with focused git-describe extractor

Suppression mechanism

  • Add suppress_version_warning preference field (stores JSON {fw, ui} or "do_not_alert")
  • Check suppression before showing warning; skip if versions match stored values or permanently disabled
  • Custom warning dialog replaces standard alert with two buttons: "Dismiss" and "Don't warn until next release"

Preferences UI

  • Add "Version Warnings" panel showing status (Enabled/Disabled/Suppressed) and stored versions
  • "Disable version warnings" button sets permanent "do_not_alert" value
  • "Enable version warnings" button clears suppression

Memory optimizations

  • Removed 3 unnecessary addMessage() calls to serial log
  • Replaced large HTML template strings with DOM element creation methods
  • Used textContent instead of innerHTML where possible to avoid HTML parsing overhead
  • Replaced arrow functions with named functions to reduce closure memory
  • Used onclick instead of addEventListener to prevent event listener accumulation
  • Simplified console logging to reduce string allocations
  • File size reduced: 132.51 kB → 132.40 kB (110 bytes saved after gzip compression)

Screenshots

Memory-optimized version warning dialog:

Example

// Firmware version from ESP800 response
fw_version = "FluidNC v1.14 (v1.14)"
// UI version from build
web_ui_version = "github.com/BarbourSmith/ESP3D-WEBUI@v1.14-2-gabcd123"

extractGitDescribeVersion(fw_version)  // → "v1.14"
extractGitDescribeVersion(web_ui_version)  // → "v1.14-2-gabcd123"

areGitVersionsCompatible("v1.14", "v1.14-2-gabcd123")  // → false (exact match required)

Checklist:

  • I have thoroughly tested this on hardware and these changes do not break any existing functionality. This is important!
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
Original prompt

This section details on the original issue you should resolve

<issue_title>modify version comparison popup</issue_title>
<issue_description>the version comparison popup is comparing the wrong values
currently it compares something like:

FluidNC v1.14 (head-7fe778c0)
and
github.com/BarbourSmith/ESP3D-WEBUI@v1.14

in both the firmware and the UI there is a version that is defined to be git describe --always --tags --dirty
something like v1.14-6-g7fe778c0

change the version comparison to use these values instead of what is currently used.

Add a button to the popup to say 'don't warn until next release', and when that is hit, store the current versions in the preferences.json file and don't do another popup until one of the releases changes.

Also have a value for this saved versions of "do not alert" that will never generate a popup

add an entry to the preferences menu that shows the saved versions, and has a button to disable the popup (by saving 'do not alert' to the saved variable'</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits November 17, 2025 20:59
Co-authored-by: MaslowBot <231786780+MaslowBot@users.noreply.github.com>
Co-authored-by: MaslowBot <231786780+MaslowBot@users.noreply.github.com>
Copilot AI changed the title [WIP] Modify version comparison popup functionality Use git-describe versions for firmware/UI comparison and add suppression controls Nov 17, 2025
Copilot AI requested a review from MaslowBot November 17, 2025 21:05
@davidelang

Copy link
Copy Markdown
Collaborator

@MaslowBot
will v1.14 and v1.14-2-gabcd123 produce a warning? It should.

@MaslowBot

Copy link
Copy Markdown
Collaborator

@copilot-swe-agent

User @davidelang mentioned @MaslowBot with the following request:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

@MaslowBot
will v1.14 and v1.14-2-gabcd123 produce a warning? It should.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

This comment was automatically relayed by MaslowBot so that @copilot-swe-agent can respond to the request.

@davidelang

Copy link
Copy Markdown
Collaborator

@MaslowBot minimize memory usage of this popup, some users are getting low memory warnings when it pops up.

@MaslowBot

Copy link
Copy Markdown
Collaborator

@copilot-swe-agent

User @davidelang mentioned @MaslowBot with the following request:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

@MaslowBot minimize memory usage of this popup, some users are getting low memory warnings when it pops up.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

This comment was automatically relayed by MaslowBot so that @copilot-swe-agent can respond to the request.

…d123

Co-authored-by: MaslowBot <231786780+MaslowBot@users.noreply.github.com>

Copilot AI commented Nov 17, 2025

Copy link
Copy Markdown
Author

@copilot-swe-agent

User @davidelang mentioned @MaslowBot with the following request:...

Yes, v1.14 and v1.14-2-gabcd123 will now produce a warning. The comparison logic has been updated to require exact version matches only.

Fixed in commit 4b33628.

The new behavior:

  • ✅ v1.14 vs v1.14-2-gabcd123 → WARNING (release vs development)
  • ✅ v1.14-2-gabcd123 vs v1.14 → WARNING (development vs release)
  • ✅ v1.14-2-gabcd123 vs v1.14-3-gdef456 → WARNING (different commits)
  • ✅ v1.14 vs v1.14 → NO WARNING (exact match)

Screenshot

@davidelang

Copy link
Copy Markdown
Collaborator

@MaslowBot /build

@github-actions

Copy link
Copy Markdown

🤖 WebUI Compilation Complete 🤖

✅ Successfully compiled ESP3D WebUI for English language

Build Details:

  • Commit: 4b3362827e05e1c318df3b5b1ca30555e7ce085a
  • Language: en (English)
  • WebUI size: 129.40 KB (compressed)
  • Build time: ~3 seconds

Download:
Download the "Updated UI.zip" file from the Actions tab.

Installation Instructions:

  1. Download and extract the "Updated UI.zip" file
  2. Upload the index.html.gz file from the extracted folder to your ESP3D device
  3. The README.txt file in the zip contains detailed instructions

This comment was automatically generated in response to a build request comment.

Co-authored-by: MaslowBot <231786780+MaslowBot@users.noreply.github.com>

Copilot AI commented Nov 17, 2025

Copy link
Copy Markdown
Author

@copilot-swe-agent

User @davidelang mentioned @MaslowBot with the following request:...

Memory usage has been minimized. Fixed in commit 032ef9d.

Optimizations made:

  • Removed 3 unnecessary addMessage() calls to serial log
  • Replaced large HTML template strings with DOM element creation
  • Used textContent instead of innerHTML where possible
  • Replaced arrow functions with named functions to reduce closure memory
  • Used onclick instead of addEventListener to prevent event listener accumulation
  • Simplified console logging to reduce string allocations

Result: File size reduced from 132.51 kB to 132.40 kB (110 bytes saved after compression).

Optimized Dialog

Copilot AI changed the title Use git-describe versions for firmware/UI comparison and add suppression controls Use git-describe versions for firmware/UI comparison with suppression controls and optimized memory usage Nov 17, 2025
@davidelang

Copy link
Copy Markdown
Collaborator

@MaslowBot /build

@github-actions

Copy link
Copy Markdown

🤖 WebUI Compilation Complete 🤖

✅ Successfully compiled ESP3D WebUI for English language

Build Details:

  • Commit: 032ef9d35dbe92282a4434e912e14c603098c488
  • Language: en (English)
  • WebUI size: 129.29 KB (compressed)
  • Build time: ~3 seconds

Download:
Download the "Updated UI.zip" file from the Actions tab.

Installation Instructions:

  1. Download and extract the "Updated UI.zip" file
  2. Upload the index.html.gz file from the extracted folder to your ESP3D device
  3. The README.txt file in the zip contains detailed instructions

This comment was automatically generated in response to a build request comment.

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.

modify version comparison popup

3 participants