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
+4 -4
View File
@@ -70,8 +70,8 @@ func TestCompleteModelKeepsDashboardAndHelpBrowsableWhileMutationIsSerialized(t
model = updateKey(model, "tab")
model = updateKey(model, "down")
model = updateKey(model, "?")
if model.page != helpPage || !strings.Contains(model.View(), "proxyctl Help") {
t.Fatalf("Help was not reachable while mutation ran:\n%s", model.View())
if model.page != mainPage || !model.help.open || !strings.Contains(model.View(), "Contextual Help") {
t.Fatalf("Help was not reachable as a dashboard dialog while mutation ran:\n%s", model.View())
}
model = updateKey(model, "q")
if model.page != mainPage {
@@ -179,7 +179,7 @@ func TestCompleteModelUsesStructuredConfirmationAndSafeCancellation(t *testing.T
close(confirmation)
model, _ = applyOperationCommand(t, model, command)
view := model.View()
assertUsableFrame(t, view, 120, 36, "Confirm Docker restart", "Running work may be disrupted", "Enter/n/Esc: Cancel")
assertUsableFrame(t, view, 120, 36, "Confirm Docker restart", "Running work may be disrupted", "n/q/Esc: cancel", "> Cancel")
updated, next := model.Update(tea.KeyMsg{Type: tea.KeyEnter})
model = updated.(Model)
@@ -234,7 +234,7 @@ func TestCompleteModelVisiblyDefersCtrlCFromHelpAndStartsNoNewWork(t *testing.T)
t.Fatalf("deferred exit prevented read-only Target browsing: selected=%q", model.selectedTargetID)
}
model = updateKey(model, "?")
if model.page != helpPage {
if model.page != mainPage || !model.help.open {
t.Fatal("deferred exit prevented opening read-only Help")
}
model = updateKey(model, "q")