normalize filter values before comparing them - #443
Open
grische wants to merge 2 commits into
Open
Conversation
Member
|
@grische can you rebase this please :) |
The leaflet Map import shadows the global Map for the whole module, so declaring a Map<K, V> fails to compile: error TS2315: Type 'Map' is not generic The error is reported at the declaration rather than at the import responsible for it. Rename the import to LeafletMap and update its sole use in getTileBBox. No functional change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Node attribute values are compared with === against the filter value, which assumes every node spells a given value identically. Firmware does not: OpenWrt renames devices between releases, so one node can report "ZyXEL WSM20" while another running a newer image reports "Zyxel WSM20", and some model names carry runs of padding whitespace. The statistics sidebar therefore lists one row per spelling, and activating a row silently excludes the nodes using any other spelling. Rows that differ only in whitespace are indistinguishable in the UI, leaving no way to tell why a node is missing from the map. applyFiltersFromHash makes this worse for shared links: it collapses whitespace in the value taken from the URL but not in the node value it is compared against, so a filter on a value containing padding whitespace matches when clicked and matches nothing once the URL it produced is reloaded. Normalize both sides of the comparison. collapseWhitespace provides the display and URL form, normalizeFilterValue folds case on top of it for matching, and mergeSpellingVariants merges the counted values so a group occupies a single row labelled with its most common spelling. Key GenericNodeFilter on the normalized value so variants of a value toggle the same filter. While here, skip undefined attribute values when counting: the node.update modifier returns d.branch, which is undefined when a node has the autoupdater enabled but no branch configured, producing a row labelled "undefined". Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
grische
force-pushed
the
fix/normalize-filter-values
branch
from
August 11, 2026 07:33
ee4630c to
9f3c40d
Compare
Contributor
|
Preview deployed: https://freifunk.github.io/meshviewer/pr-preview/pr-443/ Updated for commit 9f3c40d. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Ignores whitespaces and make device type filters case-insensitive.
Motivation and Context
With OpenWrt renaming ZyXEL to Zyxel, the filters in the map are ambigious at best. This PR allows filtering even if they are using different version of Gluon/OpenWrt.
How Has This Been Tested?
https://map.ffmuc.net/
Screenshots/links:
Checklist: