Document new menu uniformity QA checks (104-107) in REFDB

Added comprehensive documentation for new QA checks:

CHECK 104: Menu Input Validation (MEDIUM)
- Detects menu inputs without proper range validation
- Flags: read without [[ validation ]] patterns
- Fix: Add numeric range checks

CHECK 105: Menu Color Code Consistency (LOW)
- Detects menu options without color codes
- Flags: plain echo without ${CYAN}${NC} format
- Fix: Use standardized color format

CHECK 106: Menu Retry Loop Implementation (LOW)
- Detects input validation without retry loops
- Flags: Validation without 'while true' loop
- Fix: Wrap in proper retry loop

CHECK 107: Standardized Yes/No Prompts (LOW)
- Detects non-standard confirmation prompts
- Flags: read "(yes/no):" instead of confirm()
- Fix: Use confirm() library function

Included usage examples and integration details.
These checks validate all 9 scripts we standardized.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
cschantz
2026-02-17 18:53:57 -05:00
parent fc5dc18031
commit b26ab9dfc9
+51 -1
View File
@@ -4210,7 +4210,7 @@ LEVEL 3: NICE-TO-HAVE (Quality improvements)
QA ENFORCEMENT:
================================================================================
CHECK 32 in toolkit-qa-check.sh validates menu standards:
LEGACY CHECK 32 in toolkit-qa-check.sh validates menu standards:
1. Back Button Check:
- Finds all show_*_menu() and handle_*_menu() functions
@@ -4227,6 +4227,56 @@ CHECK 32 in toolkit-qa-check.sh validates menu standards:
- Reports LOW issue if inline domain selection found
Status: ✅ ACTIVE (commit 201dc3c)
NEW MENU UNIFORMITY CHECKS (Phase 11 - 2026-02-11):
====================================================
CHECK 104: Menu Input Validation (MEDIUM)
Purpose: Detect menu inputs without proper range validation
Pattern: Finds read -p "Select option" without [[ validation ]]
Detects: read statements for menu input lacking numeric range checks
Impact: Scripts crash or behave unpredictably with invalid input
Fix: Add validation like: [[ "$choice" =~ ^[1-5]$ ]]
Status: ✅ ACTIVE (commit fc5dc18)
CHECK 105: Menu Color Code Consistency (LOW)
Purpose: Enforce consistent menu color styling
Pattern: Finds echo " 1) Option" without ${CYAN}1)${NC}
Detects: Menu options missing color codes
Impact: Visual inconsistency, poor UX
Fix: Use ${CYAN}1)${NC} format for consistency
Status: ✅ ACTIVE (commit fc5dc18)
CHECK 106: Menu Retry Loop Implementation (LOW)
Purpose: Ensure users can retry after invalid input
Pattern: Finds input validation without 'while true' loops
Detects: Invalid input handling without retry mechanism
Impact: Bad UX - users must restart script on invalid input
Fix: Wrap validation in: while true; do ... [[ valid ]] && break; done
Status: ✅ ACTIVE (commit fc5dc18)
CHECK 107: Standardized Yes/No Prompts (LOW)
Purpose: Standardize confirmation prompts across scripts
Pattern: Finds read -p "... (yes/no):" instead of confirm()
Detects: Manual yes/no prompts instead of library function
Impact: Inconsistent UX - different prompt styles
Fix: Replace with: if ! confirm "Continue?"; then return; fi
Status: ✅ ACTIVE (commit fc5dc18)
USAGE EXAMPLES:
# Scan a specific script for menu uniformity:
bash toolkit-qa-check.sh --file /path/to/script.sh
# View all menu uniformity issues:
grep 'MENU-VALIDATION\|MENU-COLORS\|MENU-RETRY\|PROMPT-STYLE' /tmp/qa-report.txt
# Check if script passes menu standards:
if ! grep -q 'MENU-VALIDATION\|MENU-COLORS\|MENU-RETRY' /tmp/qa-report.txt; then
echo "Script passes menu uniformity checks!"
fi
# Run full QA with menu checks included:
bash toolkit-qa-check.sh /root/server-toolkit 2>&1 | grep -E "104:|105:|106:|107:"
Location: tools/toolkit-qa-check.sh:957-1012
FUTURE TODO (Enhancements based on this analysis):