From 80f56ef8156f65be10c0c894021801fdd79b962a Mon Sep 17 00:00:00 2001 From: bchanot Date: Wed, 11 Nov 2026 15:33:34 +0100 Subject: [PATCH] feat(banner): drop plugin-dev, hide the OFF row when every toggle is on plugin-dev was dropped 2026-07-02 yet the banner still printed it as OFF. With four toggles the >4 split branches were dead: one printf per row. --- hooks/session-start.sh | 49 ++++++-------------------------- lib/detect-plugins.sh | 6 ---- lib/tests/session-banner.test.sh | 15 +++++++++- 3 files changed, 23 insertions(+), 47 deletions(-) diff --git a/hooks/session-start.sh b/hooks/session-start.sh index 2cb9ae6..1927130 100644 --- a/hooks/session-start.sh +++ b/hooks/session-start.sh @@ -103,12 +103,11 @@ export PROFILE_PLAIN TOGGLE_ACTIVE=() TOGGLE_INACTIVE=() -for plugin in gstack uiux_pro_max plugin_dev context7 graphifyy; do +for plugin in gstack uiux_pro_max context7 graphifyy; do # Map function name to display name. graphifyy = the pipx PACKAGE name # (pypi:graphifyy); the CLI and skill are 'graphify' — display that. case "$plugin" in uiux_pro_max) display="ui-ux-pro-max" ;; - plugin_dev) display="plugin-dev" ;; graphifyy) display="graphify" ;; *) display="$plugin" ;; esac @@ -120,10 +119,6 @@ for plugin in gstack uiux_pro_max plugin_dev context7 graphifyy; do fi done -# --- Format output --- -ACTIVE_STR="${TOGGLE_ACTIVE[*]:-none}" -INACTIVE_STR="${TOGGLE_INACTIVE[*]:-none}" - # Profile row: the project's local profile, the conversation's --settings # one, or none (manifest defaults = full) with the /plugin-check pointer. _pname="$(sed -n 's/^profile=//p' <<<"$PROFILE_PLAIN" | head -1)" @@ -170,7 +165,7 @@ echo "┌─ Claude Code config ──────────────── # by the toggle row below are excluded (dual display). ALWAYS_ON=() detect_rtk &>/dev/null && ALWAYS_ON+=("rtk") -_toggle_owned=" gstack ui-ux-pro-max plugin-dev context7 graphify " +_toggle_owned=" gstack ui-ux-pro-max context7 graphify " while IFS= read -r _pl; do [ -n "$_pl" ] || continue case "$_toggle_owned" in @@ -180,9 +175,8 @@ while IFS= read -r _pl; do done < <(sed 's/@.*//' <<<"$(list_on_plugins)") unset _toggle_owned _pl ALWAYS_ON_STR="${ALWAYS_ON[*]:-none}" -# Same 40-char-width split policy as the toggle row below — keeps the -# right border aligned on overflow. Greedy width-fill (not a fixed 3-name -# cut: 3 long names overflowed line 1 and left line 2 empty). +# 40-char width, greedy split: keeps the right border aligned on overflow +# (not a fixed 3-name cut: 3 long names overflowed line 1, line 2 empty). if [ "${#ALWAYS_ON_STR}" -le 40 ]; then printf "│ ✅ ON : %-40s│\n" "$ALWAYS_ON_STR" else @@ -199,37 +193,12 @@ else unset _ao_l1 _ao_l2 _ao_e fi unset ALWAYS_ON ALWAYS_ON_STR -# Plugin display — all plugins shown, split across 2 lines if >4 -_active_count=${#TOGGLE_ACTIVE[@]} -_inactive_count=${#TOGGLE_INACTIVE[@]} - -if [ "$_active_count" -eq 0 ]; then - printf "│ 🟢 ON : %-40s│\n" "none" -elif [ "$_active_count" -le 4 ]; then - printf "│ 🟢 ON : %-40s│\n" "$ACTIVE_STR" -else - # Split: first 4 on line 1, rest on continuation line - _line1="${TOGGLE_ACTIVE[0]} ${TOGGLE_ACTIVE[1]} ${TOGGLE_ACTIVE[2]} ${TOGGLE_ACTIVE[3]}" - _rest=("${TOGGLE_ACTIVE[@]:4}") - _line2="${_rest[*]}" - printf "│ 🟢 ON : %-40s│\n" "$_line1" - printf "│ %-40s│\n" "$_line2" - unset _line1 _line2 _rest +# Toggle rows: the four display names (38 chars) must fit the 40-char +# field; a fifth toggle needs a split again. OFF prints only when non-empty. +printf "│ 🟢 ON : %-40s│\n" "${TOGGLE_ACTIVE[*]:-none}" +if [ ${#TOGGLE_INACTIVE[@]} -gt 0 ]; then + printf "│ ⚫ OFF : %-40s│\n" "${TOGGLE_INACTIVE[*]}" fi - -if [ "$_inactive_count" -eq 0 ]; then - printf "│ ⚫ OFF : %-40s│\n" "none" -elif [ "$_inactive_count" -le 4 ]; then - printf "│ ⚫ OFF : %-40s│\n" "$INACTIVE_STR" -else - _line1="${TOGGLE_INACTIVE[0]} ${TOGGLE_INACTIVE[1]} ${TOGGLE_INACTIVE[2]} ${TOGGLE_INACTIVE[3]}" - _rest=("${TOGGLE_INACTIVE[@]:4}") - _line2="${_rest[*]}" - printf "│ ⚫ OFF : %-40s│\n" "$_line1" - printf "│ %-40s│\n" "$_line2" - unset _line1 _line2 _rest -fi -unset _active_count _inactive_count printf "│ 🖥️ CLI : %-40s│\n" "$GSD_STATUS" printf "│ 📦 v%-45s│\n" "$CONFIG_VERSION" if [ -n "$GF_REFRESHED" ]; then diff --git a/lib/detect-plugins.sh b/lib/detect-plugins.sh index 854b2f0..d695044 100644 --- a/lib/detect-plugins.sh +++ b/lib/detect-plugins.sh @@ -64,12 +64,6 @@ detect_gsd() { command -v gsd &>/dev/null } -detect_plugin_dev() { - # plugin-dev replaces the old "skill-creator" reference - local cache_dir="$HOME/.claude/plugins/cache" - [ -d "$cache_dir" ] && compgen -G "$cache_dir"/*plugin-dev* &>/dev/null -} - detect_uiux_pro_max() { # installed (cache) AND enabled for this project (here-string: no pipe) local cache_dir="$HOME/.claude/plugins/cache" diff --git a/lib/tests/session-banner.test.sh b/lib/tests/session-banner.test.sh index a404080..378f090 100644 --- a/lib/tests/session-banner.test.sh +++ b/lib/tests/session-banner.test.sh @@ -20,7 +20,9 @@ has() { case "$1" in *"$2"*) echo 1 ;; *) echo 0 ;; esac; } claude_stub_install "$WORK" # rtk pinned present, whatever the machine has printf '#!/bin/sh\nexit 0\n' >"$WORK/stub/rtk" || exit 1 -chmod +x "$WORK/stub/rtk" || exit 1 +printf '#!/bin/sh\nexit 0\n' >"$WORK/stub/ctx7" || exit 1 +printf '#!/bin/sh\nexit 0\n' >"$WORK/stub/graphify" || exit 1 +chmod +x "$WORK/stub/rtk" "$WORK/stub/ctx7" "$WORK/stub/graphify" || exit 1 UIUX='"ui-ux-pro-max@ui-ux-pro-max-skill":true' SEC='"security-guidance@claude-code-plugins":true' @@ -89,6 +91,13 @@ check SB3-toggle-on-uiux "$(has "$(row '🟢 ON' "$out")" ui-ux-pro-max)" 1 ok="$(row '✅ ON' "$out")" check SB3-onrow-no-pr-review "$(has "$ok" pr-review-toolkit)" 0 +# SB11: every toggle on: all four in the ON row, no OFF row (SB3 output) +on="$(row '🟢 ON' "$out")" +for w in gstack ui-ux-pro-max context7 graphify; do + check "SB11-on-$w" "$(has "$on" "$w")" 1 +done +check SB11-no-off-row "$(row '⚫ OFF' "$out")" "" + # SB9: no passive-cost row and no plan budget in the banner check SB9-no-cost-row "$(has "$out" 💰)" 0 check SB9-no-budget "$(has "$out" budget)" 0 @@ -133,12 +142,16 @@ check SB8-no-claude-calls "$(claude_stub_calls)" 0 # SB10: no hand-copied passive-cost figure or dead plan path left # gone [filter]: 1 when no line (after the filter) matches gone() { + [ -f "$ROOT/$1" ] || { echo 0; return; } if grep -v "${3:-^\$}" "$ROOT/$1" | grep -qE -- "$2"; then echo 0 else echo 1; fi } check SB10-hook-costs "$(gone hooks/session-start.sh \ '_plugin_costs|TOKEN_WARN|detect_plan')" 1 check SB10-lib-detect-plan "$(gone lib/detect-plugins.sh detect_plan)" 1 +check SB10-lib-plugin-dev "$(gone lib/detect-plugins.sh \ + detect_plugin_dev)" 1 +check SB10-hook-plugin-dev "$(gone hooks/session-start.sh 'plugin.dev')" 1 check SB10-reporter-const "$(gone agents/status-reporter.md \ 'PLUGIN_TOKENS|~[1-9][0-9-]*t')" 1 check SB10-advisor-figures "$(gone agents/plugin-advisor.md \