pi-agent: Implement Help navigation consistency

This commit is contained in:
proxyctl coordinator
2026-07-17 23:33:56 +08:00
parent 112f700650
commit c93dc61ef6
10 changed files with 544 additions and 64 deletions
+13 -2
View File
@@ -68,6 +68,7 @@ type presentationState struct {
driftResolutionTargetID string
picker profilePickerState
form formState
help helpDialogState
confirmation *app.Confirmation
confirmationDialog *confirmationDialog
status string
@@ -122,11 +123,21 @@ func (p terminalPresentation) Render(state presentationState) string {
page = p.profilesView(state)
case formPage:
page = p.formView(state)
case helpPage:
page = p.helpView(state)
default:
page = p.mainView(state, width, height)
}
if state.help.top(state.confirmation) {
help := p.helpDialogView(state)
// Retain the underlying page header so Help is visibly contextual and
// modal rather than a replacement navigation destination.
page.primary = help.primary
page.context = ""
page.footer = help.footer
page.focusLine = help.focusLine
page.primaryOffset = help.primaryOffset
page.contextOffset = 0
page.dashboard = nil
}
page.status = renderStatus(state)
page.statusExpanded = state.errorExpanded && state.currentError != nil
page.statusOffset = state.errorOffset