feat(ui): Enhanced flag display with color coordination and clean separation

Display Enhancements:
• Added color-coordinated flag lines (bold yellow flags, dim separator)
• Enhanced bottom preview panel (3 lines → 8 lines)
• Implemented bordered box design with flag 🏴 and description 📝 emojis
• Added clean flag/description separation using AWK-based parsing
• Flag section shows ONLY bash input (e.g., -s sig)
• Description section shows ONLY explanation text
• Cyan bold for flags, green for descriptions in preview
• Handles missing descriptions with dimmed "(No description available)"

Technical Improvements:
• Modified extract_all_flags() to add ANSI color codes to output
• Enhanced browse_flags_fuzzy() preview with intelligent parsing
• Uses AWK field separator on em dash (—) for robust splitting
• Replaced xargs with sed for trimming to avoid flag interpretation
• Added fallback handling for flags without descriptions

Project Organization:
• Moved documentation files to docs/ directory for better structure

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-01 13:22:46 -07:00
parent f8e31d49e0
commit 3ce1d2ec1f
16 changed files with 2242 additions and 9 deletions
+31 -9
View File
@@ -663,9 +663,9 @@ extract_all_flags() {
if (flag != "") {
gsub(/^[[:space:]]+|[[:space:]]+$/, "", desc)
if (desc != "") {
printf "%s — %s\n", flag, desc
printf "\033[1;33m%s\033[0m \033[2m—\033[0m %s\n", flag, desc
} else {
printf "%s\n", flag
printf "\033[1;33m%s\033[0m\n", flag
}
}
@@ -709,9 +709,9 @@ extract_all_flags() {
if (flag != "") {
gsub(/^[[:space:]]+|[[:space:]]+$/, "", desc)
if (desc != "") {
printf "%s — %s\n", flag, desc
printf "\033[1;33m%s\033[0m \033[2m—\033[0m %s\n", flag, desc
} else {
printf "%s\n", flag
printf "\033[1;33m%s\033[0m\n", flag
}
}
exit
@@ -722,9 +722,9 @@ extract_all_flags() {
if (flag != "") {
gsub(/^[[:space:]]+|[[:space:]]+$/, "", desc)
if (desc != "") {
printf "%s — %s\n", flag, desc
printf "\033[1;33m%s\033[0m \033[2m—\033[0m %s\n", flag, desc
} else {
printf "%s\n", flag
printf "\033[1;33m%s\033[0m\n", flag
}
}
}
@@ -773,13 +773,35 @@ browse_flags_fuzzy() {
"$cmd_desc" \
"$flag_count"
# Show in fzf with integrated command info
# Show in fzf with integrated command info and enhanced bottom display
echo "$all_flags" | fzf \
--height 95% \
--border=none \
--header "$header" \
--preview 'echo {}' \
--preview-window=down:3:wrap \
--preview 'line=$(echo {} | sed -E "s/\x1b\[[0-9;]*m//g");
if echo "$line" | grep -qF " — "; then
flag=$(echo "$line" | awk -F " — " "{print \$1}" | sed -e "s/^[[:space:]]*//" -e "s/[[:space:]]*$//");
desc=$(echo "$line" | awk -F " — " "{for(i=2;i<=NF;i++) printf \"%s \", \$i; print \"\"}" | sed -e "s/^[[:space:]]*//" -e "s/[[:space:]]*$//");
else
flag=$(echo "$line" | sed -e "s/^[[:space:]]*//" -e "s/[[:space:]]*$//");
desc="(No description available)";
fi;
if [ -z "$desc" ] || [ "$desc" = "$flag" ]; then
desc="(No description available)";
fi;
echo "┌─────────────────────────────────────────────────────────────────────────────┐";
printf "│ 🏴 Flag: \033[1;36m%-66s\033[0m│\n" "$flag";
echo "├─────────────────────────────────────────────────────────────────────────────┤";
echo "│ 📝 Description: │";
if [ "$desc" != "(No description available)" ]; then
echo "$desc" | fold -s -w 72 | while IFS= read -r dline; do
printf "│ \033[0;32m%-72s\033[0m│\n" "$dline";
done;
else
printf "│ \033[2;37m%-72s\033[0m│\n" "$desc";
fi;
echo "└─────────────────────────────────────────────────────────────────────────────┘"' \
--preview-window=down:8:wrap \
--prompt "⚡ Search: " \
--multi \
--bind 'ctrl-a:select-all' \