diff options
| author | haoyuren <13851610112@163.com> | 2026-03-11 14:13:48 -0500 |
|---|---|---|
| committer | haoyuren <13851610112@163.com> | 2026-03-11 14:13:48 -0500 |
| commit | 771325c52e3db1a5dd2046e1f1b7869f7c554500 (patch) | |
| tree | 7b056d9a2086a8e009d07c58a24afc9acade6435 | |
| parent | 9994e69593de206a7cd8670f027de3af7ba2f33f (diff) | |
Show tied community tags joined with /
When multiple tags have the same top score, display them all
separated by " / " instead of picking just one.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| -rw-r--r-- | index.html | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -3226,16 +3226,17 @@ function communityAutoLabel(memberIds, allCommunityGroups) { }); // Score = coverage × specificity - let bestTag = null, bestScore = -1; + let bestTags = null, bestScore = -1; const size = memberIds.length; for (const [tag, intCount] of Object.entries(tagInternalCount)) { const coverage = intCount / size; const total = allTagTotal[tag] || intCount; const specificity = intCount / total; const score = coverage * specificity; - if (score > bestScore) { bestScore = score; bestTag = tag; } + if (score > bestScore) { bestScore = score; bestTags = [tag]; } + else if (score === bestScore && bestScore > 0) { bestTags.push(tag); } } - return bestTag; + return bestTags ? bestTags.join(' / ') : null; } function renderCommunityHulls() { |
