@@ -532,6 +532,7 @@ declare -a CMD_INDICES=() # indices into DISPLAY_LINES that are commands
532532declare -a SECTION_FIRST_CMD= () # cursor indices (into CMD_INDICES) of first cmd per section
533533
534534build_display_list () {
535+ _MAX_CONTENT_WIDTH=0
535536 for i in " ${! SECTION_TITLES[@]} " ; do
536537 local title=" ${SECTION_TITLES[$i]} "
537538 local body=" ${SECTION_BODIES[$i]} "
@@ -559,6 +560,7 @@ build_display_list() {
559560 DISPLAY_LINES+=(" $tcmd " )
560561 LINE_TYPES+=(" command" )
561562 LINE_CMDS+=(" $tcmd " )
563+ (( ${# tcmd} + 4 > _MAX_CONTENT_WIDTH )) && _MAX_CONTENT_WIDTH=$(( ${# tcmd} + 4 ))
562564 done <<< " $title_cmds"
563565 fi
564566
@@ -620,6 +622,7 @@ build_display_list() {
620622 DISPLAY_LINES+=(" $_entry " )
621623 LINE_TYPES+=(" command" )
622624 LINE_CMDS+=(" $_entry " )
625+ (( ${# _entry} + 4 > _MAX_CONTENT_WIDTH )) && _MAX_CONTENT_WIDTH=$(( ${# _entry} + 4 ))
623626 done <<< " $cmds"
624627 fi
625628
@@ -647,7 +650,7 @@ render_static() {
647650 if $RAW ; then
648651 printf " \n## %s\n" " $line "
649652 else
650- printf " \n%s%s ▸ %s%s \n" " $BOLD " " $CYAN " " $line " " $RESET "
653+ _section_header " $line " ; printf " \n%s\n" " $_SH "
651654 fi
652655 ;;
653656 subheader)
@@ -698,7 +701,7 @@ render_full() {
698701 continue
699702 fi
700703
701- printf " \n%s%s ▸ %s%s \n" " $BOLD " " $CYAN " " $title " " $RESET "
704+ _section_header " $title " ; printf " \n%s\n" " $_SH "
702705
703706 local in_code=false
704707 local code_buf=" "
@@ -806,6 +809,21 @@ _term_height() {
806809 echo 24
807810}
808811
812+ # Pre-computed dash string (200 chars covers any reasonable terminal width)
813+ _DASH_POOL= " ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────"
814+
815+ # Format a section header with trailing dashes (sets _SH, no subshell)
816+ # _MAX_CONTENT_WIDTH is computed during build_display_list
817+ _SH= " "
818+ _section_header () {
819+ local prefix=" ▸ $1 "
820+ local prefix_len=${# prefix}
821+ local target=$(( _MAX_CONTENT_WIDTH > prefix_len ? _MAX_CONTENT_WIDTH : prefix_len + 4 ))
822+ local n=$(( target - prefix_len ))
823+ (( n < 2 )) && n=2
824+ _SH=" ${BOLD}${CYAN}${prefix}${RESET}${DIM}${_DASH_POOL: 0: n}${RESET} "
825+ }
826+
809827# Screen lines per display entry type — sets _SL (no subshell)
810828# Headers/subheaders take 2 lines (blank + text), others take 1
811829_SL= 1
@@ -945,7 +963,8 @@ draw_picker() {
945963 all) hdr+=" ${DIM} [all]${RESET} " ;;
946964 esac
947965 _line " $hdr "
948- local chrome=3
966+ _blank
967+ local chrome=4
949968
950969 # Scroll-up indicator (only if meaningful content is above the viewport)
951970 local has_above=false
@@ -986,7 +1005,7 @@ draw_picker() {
9861005 if (( idx != VIEWPORT_TOP )) ; then
9871006 _blank; (( rendered += 1 ))
9881007 fi
989- _line " ${BOLD}${CYAN} ▸ ${line}${RESET} "
1008+ _section_header " $line " ; _line " $_SH "
9901009 (( rendered += 1 ))
9911010 ;;
9921011 subheader)
@@ -1482,11 +1501,18 @@ _PLATFORM_DISPLAY=""
14821501build_platform_display () {
14831502 _PLATFORM_DISPLAY=" "
14841503 if (( ${# PLATFORM_NAMES[@]} == 0 )) ; then return ; fi
1485- local parts=" "
1504+ local parts=" " prev_low=false
14861505 for i in " ${! PLATFORM_NAMES[@]} " ; do
1487- if [[ -n " $parts " ]]; then parts+=" , " ; fi
1506+ if [[ -n " $parts " ]]; then
1507+ if $prev_low ; then parts+=" " ; else parts+=" , " ; fi
1508+ fi
14881509 parts+=" ${PLATFORM_NAMES[$i]} "
1489- if [[ " ${PLATFORM_CONFIDENCE[$i]} " == " low" ]]; then parts+=" ?" ; fi
1510+ if [[ " ${PLATFORM_CONFIDENCE[$i]} " == " low" ]]; then
1511+ parts+=" ?"
1512+ prev_low=true
1513+ else
1514+ prev_low=false
1515+ fi
14901516 done
14911517 _PLATFORM_DISPLAY=" $parts "
14921518}
@@ -1817,7 +1843,7 @@ else
18171843 ;;
18181844 all) printf " %s[all]%s" " $DIM " " $RESET " ;;
18191845 esac
1820- printf " \n"
1846+ printf " \n\n "
18211847 fi
18221848
18231849 if $FULL ; then
0 commit comments