Complete the presentation layer with popup queue picker, keybindings, and status-line segment. Changes: - bin/trailboss-popup: Rewritten with python3 JSON parsing, box drawing UI, and index-based selection that navigates directly to chosen pane - bin/trailboss-status: Status-line segment showing "⚠ N" when stuck - tmux.conf: Keybindings for Next (prefix+Tab), Skip (prefix+s), Popup (prefix+g) - test-presentation.sh: Phase 5 exit criterion tests (all passing) Verified: CLI commands work, popup lists queue with selection, status shows stuck count, keybindings configured. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
24 lines
747 B
Bash
Executable file
24 lines
747 B
Bash
Executable file
#!/bin/bash
|
|
# Trail Boss status-line segment — shows stuck count
|
|
# Usage in tmux.conf: set -g status-right '#[fg=colour196,bold]#(trailboss-status)#[default] | %H:%M'
|
|
DAEMON_URL="${TRAILBOSS_URL:-http://127.0.0.1:4000}"
|
|
|
|
# Fetch status from daemon (timeout 100ms for responsiveness)
|
|
STATUS=$(curl -s --max-time 0.1 "$DAEMON_URL/status" 2>/dev/null || echo '{"stuckCount":-1}')
|
|
|
|
# Extract count using python3 for reliable parsing
|
|
RESULT=$(python3 -c "
|
|
import json, sys
|
|
try:
|
|
data = json.load(sys.stdin)
|
|
count = data.get('stuckCount', -1)
|
|
if count > 0:
|
|
print(count)
|
|
except:
|
|
pass
|
|
" <<< "$STATUS")
|
|
|
|
# Output with warning icon if stuck, empty otherwise
|
|
if [ -n "$RESULT" ] && [ "$RESULT" != "0" ]; then
|
|
echo "⚠ $RESULT"
|
|
fi
|