Shape search tagIndex: 25% dead rows, no editable source
While auditing shape search tags I found problems with Sidebar.prototype.tagIndex (js/diagramly/sidebar/Sidebar.js, line 12) — the compressed lookup table of extra search tags that
addTagIndex decodes into shapetags and getTagsForStencil merges into the search index.
192 of its 776 rows can never match.
addTagIndexbuilds keys with.replace(' ', '_'), which replaces only the first space. Stencil names are fully underscored at registration (Graph.js ~16991,name.replace(/ /g,"_")), so any row whose shape name has 2+ spaces gets a dead key. Example:mxGraph.arrows.Jump-in Arrow 1→ key...jump-in_arrow 1, actual namejump-in_arrow_1. All those synonyms are silently lost. One-char fix:.replace(/ /g, '_').The source text file for the blob isn't in the repo. Editing the table today means decode → edit → re-encode by hand. It should be checked in as plain TSV and compressed at build time (or at least ship a documented encode/decode script).
Old TODO at ~1421 (
Use shapetags for programmatic stencils) — the table never got wired into that path.
For reference, the decoded table covers only legacy sets (electrical 140, signs 109, ios7 85, aws2 71, azure-v1 67, cisco 59, pid, floorplan, …) and looks untouched since ≤2018. Once 1+2 are fixed, extending coverage to current sets (aws4, azure2, gcp3, …) is just data entry — I'll handle that separately.
Issue text generated by Claude.
(Mate): I'm planning to clean up the existing stencil tags and add new ones, so Claude suggested better to fix this first. Not urgent.
Source: jgraph/drawio