MCPcopy Create free account
hub / github.com/betta-tech/byo-coding-agent / toggleDebugFocus

Method toggleDebugFocus

internal/ui/program.go:650–669  ·  view source on GitHub ↗

toggleDebugFocus flips focus between the input box and the debug panel. On the first focus, picks the latest event as the selection so ↑/↓ has a starting point.

()

Source from the content-addressed store, hash-verified

648// On the first focus, picks the latest event as the selection so ↑/↓ has a
649// starting point.
650func (m harness) toggleDebugFocus() tea.Model {
651 m.debugFocus = !m.debugFocus
652 if m.debugFocus {
653 m.input.Blur()
654 if m.debugSelected == 0 {
655 events := debug.Snapshot()
656 if len(events) > 0 {
657 m.debugSelected = events[len(events)-1].ID
658 }
659 }
660 } else {
661 m.input.Focus()
662 }
663 // Always back to list mode on a focus change — Tab is a "reset" so the
664 // user never gets stuck inside the modal after pressing it.
665 m.debugMode = debugList
666 m.layout()
667 m.refreshDebugContent()
668 return m
669}
670
671// updateDebugFocus is the key handler used while the debug panel is focused.
672// It owns ↑/↓ navigation, Enter to drill in, Esc to back out, and forwards

Callers 1

UpdateMethod · 0.95

Calls 3

layoutMethod · 0.95
refreshDebugContentMethod · 0.95
SnapshotFunction · 0.92

Tested by

no test coverage detected