You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Language Bars always shows four languages. Each slot falls back to its default with || (src/templates/github/language-bars.ts:44-49), so clearing Language 3 and Language 4 brings back CSS 8.3% and Other 5.2%. A repo with two or three languages can't be shown.
To Reproduce
Open the Language Bars template in the editor
Set Language 1 to Go / 81.0% and Language 2 to Shell / 19.0%
Clear Language 3, Percentage 3, Language 4 and Percentage 4
The legend still lists CSS 8.3% and Other 5.2%, and the bar has their segments
Expected behavior
Only Go and Shell, with the bar split 81/19.
Actual behavior Go 81.0% · Shell 19.0% · CSS 8.3% · Other 5.2%
Environment
Browser: Chrome
OS: macOS
Additional context
Since #217 a cleared field reaches the template as an empty string, so the template is the one putting the default back.
@anurag629 I'd like to fix this one if it makes sense to you. Plan: fall back to the default only when a language's field is missing, skip slots whose name is empty, and add a test in tests/templates/. I'm at two right now (toolbelt#440 and #349), so whenever one of those is merged.
Activity
prakashNalla commentedon Oct 31, 2026
@anurag629 I'd like to fix this one if it makes sense to you. Plan: fall back to the default only when a language's field is missing, skip slots whose name is empty, and add a test in
tests/templates/. I'm at two right now (toolbelt#440 and #349), so whenever one of those is merged.prakashNalla commentedon Oct 31, 2026
@anurag629 codercops/toolbelt#441 is merged, so I'm free for this one. The fix is ready.
anurag629 commentedon Oct 31, 2026
Hey @prakashNalla, confirmed, the
||fallbacks bring the defaults back for every cleared slot. It's yours, so with #349 that's your two.