gitFlow/internal
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
..
ai refactor: M1 — extract shared HTTP client from AI package 2026-08-02 09:04:12 +02:00
app feat: phase 6 — polish: completions, notifications, themes, rules, docs 2026-08-02 08:52:50 +02:00
config feat: phase 6 — polish: completions, notifications, themes, rules, docs 2026-08-02 08:52:50 +02:00
git feat: phase 1 — repository discovery and status scanning 2026-08-02 08:35:41 +02:00
httpclient refactor: M1 — extract shared HTTP client from AI package 2026-08-02 09:04:12 +02:00
notify feat: phase 6 — polish: completions, notifications, themes, rules, docs 2026-08-02 08:52:50 +02:00
presenter feat: M2 — TUI skeleton (bubbletea model/view/styles) 2026-08-02 09:08:10 +02:00
rules feat: phase 6 — polish: completions, notifications, themes, rules, docs 2026-08-02 08:52:50 +02:00
scanner feat: phase 1 — repository discovery and status scanning 2026-08-02 08:35:41 +02:00
scheduler feat: phase 4 — periodic scanning (watch mode) with change detection 2026-08-02 08:44:29 +02:00
tui feat: M4 — TUI AI panel on 'a' with toggle, loading/error states 2026-08-02 09:12:56 +02:00
version feat: phase 0 — project scaffolding and build tooling 2026-08-02 08:30:23 +02:00