Files
correx/apps/tui-go/internal/app/debug.go
T
kami da3f6c84a3 feat(tui): QA fixes + approval Ctrl keys, workflow focus, session UUID
- gate session-list nav on idle so in-session arrows/jk don't move the list (5a)
- approval dismiss on esc + in-session 'a' reopens a pending approval (5b)
- auto-focus a newly started workflow session (was running invisibly)
- approval actions on Ctrl chords (^a/^r/^x) matching the modal; bare/Alt letters no longer approve; diff closes on ^x/esc
- steer hint in the approval modal; session UUID in the input bar
- env-gated debug logging (CORREX_TUI_LOG) with k.Alt in the key trace
2026-06-01 23:23:29 +04:00

48 lines
965 B
Go

package app
import "log"
// debugLog is a no-op unless EnableDebugLog is called from main (when the
// CORREX_TUI_LOG env var is set). Tracing must never write to stderr while the
// alt-screen is active, so it is routed through the standard logger which main
// points at a file via tea.LogToFile.
var debugLog = func(string, ...any) {}
// EnableDebugLog switches tracing on, sending it through the standard logger.
func EnableDebugLog() { debugLog = log.Printf }
func (d DisplayState) String() string {
switch d {
case StateIdle:
return "Idle"
case StateInSession:
return "InSession"
case StateApproval:
return "Approval"
default:
return "?"
}
}
func (i InputMode) String() string {
switch i {
case ModeRouter:
return "Router"
case ModeFilter:
return "Filter"
default:
return "?"
}
}
func (e EditMode) String() string {
switch e {
case ModeNormal:
return "Normal"
case ModeInsert:
return "Insert"
default:
return "?"
}
}