#!/bin/bash

echo "Testing column search fix with hidden columns"
echo "=============================================="
echo ""
echo "This test verifies that column search correctly highlights columns"
echo "when some columns are hidden."
echo ""
echo "Test scenario:"
echo "1. Load data with columns including 'externalOrderId'"
echo "2. Hide 'comments' column (index 4)"  
echo "3. Search for 'order'"
echo "4. Should highlight 'externalOrderId' (DataTable index 20)"
echo "   Not 'exchange' (DataTable index 19)"
echo ""
echo "To run the test manually:"
echo "  ./target/release/sql-cli trades_20k.csv"
echo "  Press 'H' to enter hide mode"
echo "  Navigate to 'comments' and press Enter to hide it"
echo "  Press '/' to search columns"
echo "  Type 'order' and press Enter"
echo "  Verify 'externalOrderId' is highlighted (not 'exchange')"
echo ""
echo "With debug logging:"
echo "  RUST_LOG=column_search=debug ./target/release/sql-cli trades_20k.csv"