pi-agent: Implement Help navigation consistency
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user