gitFlow/internal/tui
dimitar a44c2e46c7 feat: M4 — TUI AI panel on 'a' with toggle, loading/error states
Add the on-demand AI suggestion panel to the TUI so pressing 'a' asks the
configured provider about the current scan result.

Model additions:
- aiSugs field ([]ai.Suggestion) and aiCmd() method that calls
  ai.Provider.Suggest(context.Background(), result)
- aiResultMsg/aiErrorMsg message types for the async flow

Update handler:
- 'a' toggles the panel: if visible, it hides; if hidden, it starts the AI
  request (aiLoading flag guards against duplicates)
- aiResultMsg populates aiSugs and opens the panel
- aiErrorMsg prepends "AI:" to the error and places it in the status bar
  error field (non-blocking — the scan result stays visible)

View:
- aiPanelView renders a separator line, "AI SUGGESTIONS" header, and one
  row per suggestion: [priority] action message, with an indented "$ cmd"
  line when a command is present
- loading state shows " asking AI..." with the dim style
- status bar right-hand hints include "a AI" only when a provider is
  configured (nil check)

Tests:
- 'a' fires aiCmd; second 'a' toggles the panel off
- aiResultMsg opens the panel and populates aiSugs
- aiErrorMsg closes the panel and sets the error with "AI:" prefix
- aiPanelView contains "AI SUGGESTIONS", priority labels, and messages
- AI toggle hides the panel on second press

Verified: go build, go vet, go test -race (12 packages), gofmt clean.
2026-08-02 09:12:56 +02:00
..
styles.go feat: M3 — TUI interaction (periodic scan, countdown, change markers) 2026-08-02 09:10:56 +02:00
tui_test.go feat: M4 — TUI AI panel on 'a' with toggle, loading/error states 2026-08-02 09:12:56 +02:00
tui.go feat: M4 — TUI AI panel on 'a' with toggle, loading/error states 2026-08-02 09:12:56 +02:00