Skip to content

feat: make sidebar CI and review glyphs configurable via .env - #5

Open
ubuntudroid wants to merge 1 commit into
krystof018:mainfrom
ubuntudroid:feat/configurable-icons
Open

feat: make sidebar CI and review glyphs configurable via .env#5
ubuntudroid wants to merge 1 commit into
krystof018:mainfrom
ubuntudroid:feat/configurable-icons

Conversation

@ubuntudroid

@ubuntudroid ubuntudroid commented Jul 17, 2026

Copy link
Copy Markdown

Summary

Lets users override every sidebar glyph via the plugin's existing .env mechanism (gci_load_env), defaulting to the current emoji:

  • CI dot: GITLAB_CI_ICON_OK / _FAIL / _RUN / _NONE (defaults 🟢 🔴 🟡 ⚪)
  • Review badge / My-MRs glyphs: GITLAB_CI_ICON_CONFLICT / _CHANGES / _APPROVED / _DRAFT / _AWAITING (defaults ⚠️ 💬 ✅ 📝 👀)

Emoji stay the default so plain terminals keep working; the README shows a commented Nerd Font preset (needs a Nerd-patched font, else tofu). A var that is set but empty hides the glyph — e.g. GITLAB_CI_ICON_NONE= shows no dot for "no pipeline" — which is why the code uses ${VAR-default} rather than ${VAR:-default}.

Details worth calling out:

  • gci_strip_ci_prefix is driven by the same configured values, and additionally keeps hunting the emoji defaults — labels decorated before an icon-config change still strip instead of accumulating a prefix per poll tick. Empty patterns are skipped ("" would match anything and corrupt labels).
  • gci_review_badge_glyph now delegates to gci_review_glyph, so badge and My-MRs pane can't drift apart.
  • The "supported remote, no pipeline" path in poller-ctl.sh hardcoded ; it now routes through gci_status_emoji so the _NONE override applies there too.
  • Version left untouched for the maintainer to bump.

Heads-up: a separate PR adding a merged state + 🔀 badge is coming soon and touches the same glyph functions; whichever lands second just applies the same ${VAR-default} pattern to the merged glyph — trivial rebase.

Test plan

  • bash test.sh — 119 checks green. New coverage: per-state overrides, badge filtering with overrides, empty-override hiding, strip round-trips built the way poll_once builds labels, default-emoji-still-strips migration case, and the empty-pattern strip guard (each new test was watched failing first).
  • Verified live in herdr with a Nerd Font .env preset: sidebar labels render the monochrome glyphs, GITLAB_CI_ICON_NONE= hides the "no pipeline" dot, and poller stop restores labels cleanly.

🤖 Generated with Claude Code

Each glyph the poller puts on a space label — the CI dot
(GITLAB_CI_ICON_OK/_FAIL/_RUN/_NONE) and the review badge
(GITLAB_CI_ICON_CONFLICT/_CHANGES/_APPROVED/_DRAFT/_AWAITING) — can now
be overridden via the plugin's .env, e.g. with monochrome Nerd Font
icons. Emoji stay the default. A var that is set but empty hides the
glyph (hence ${VAR-default}, not ${VAR:-default}).

gci_strip_ci_prefix hunts the configured glyphs plus the emoji
defaults, so labels decorated before an icon-config change still strip
instead of accumulating, and skips empty patterns ("" would match
anything).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ubuntudroid added a commit to ubuntudroid/herdr-git-status that referenced this pull request Jul 22, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

# Conflicts:
#	lib.sh
#	test.sh
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.

1 participant