Keep the agents overview open when there is no chat to return to (#60271)

## What changed

Only allow the cancel action to dismiss the agents overview when a chat is displayed or a startup thread is pending. Hide the `esc back` footer hint when there is no chat to return to, while retaining back hints for help and metadata editing.

## Testing

Add coverage for returning to a chat that is still starting and for pressing Escape in the overview after cancelling folder trust. Update snapshots and test setup to reflect whether a chat is available.

GitOrigin-RevId: af259330eb2a743fde449bbbd47c7f0eb6fa937e
This commit is contained in:
Eric Traut
2026-11-08 17:26:39 +00:00
committed by copyberry
parent a73fa8a869
commit 9ba7a3df52
12 changed files with 45 additions and 33 deletions
+4 -16
View File
@@ -32,12 +32,6 @@ async fn agents_defers_launch_directory_trust_until_starting_a_task() -> Result<
daemon_startup("agents-untrusted").await
}
#[tokio::test]
#[cfg(unix)]
async fn agents_checks_trust_when_starting_after_dismissing_overview() -> Result<()> {
daemon_startup("agents-untrusted-new").await
}
#[tokio::test]
#[cfg(unix)]
async fn discovered_managed_daemon_can_restart_with_auto_start_disabled() -> Result<()> {
@@ -202,7 +196,7 @@ async fn daemon_startup(command: &str) -> Result<()> {
""
},
serde_json::to_string(&workspace_path)?,
if command.starts_with("agents-untrusted") {
if command == "agents-untrusted" {
"untrusted"
} else {
"trusted"
@@ -246,7 +240,6 @@ async fn daemon_startup(command: &str) -> Result<()> {
| "agents"
| "agents-no-daemon"
| "agents-untrusted"
| "agents-untrusted-new"
| "discovered"
| "bedrock"
| "bedrock-running"
@@ -316,18 +309,13 @@ async fn daemon_startup(command: &str) -> Result<()> {
"Notconnectedtothelocalbackgroundserver"
} else if command == "agents" {
args.push("agents".into());
steps.push_back(("Notasksyet", b"\x1b"));
steps.push_back(("Notasksyet", b"n"));
steps.push_back(("GPT-5.6-Terra", b"/daemon\r"));
steps.push_back(("Restartbackgroundserver", b"\x1b[F\r"));
"Restartbackgroundserver?"
} else if command.starts_with("agents-untrusted") {
} else if command == "agents-untrusted" {
args.push("agents".into());
if command == "agents-untrusted-new" {
steps.push_back(("Notasksyet", b"\x1b"));
steps.push_back(("GPT-5.6-Terra", b"/new\r"));
} else {
steps.push_back(("Notasksyet", b"n"));
}
steps.push_back(("Notasksyet", b"n"));
"entercontinue·escback"
} else if command == "discovered" {
args.extend(["--disable".into(), "daemon_auto_start".into()]);
@@ -41,7 +41,7 @@ expression: transition
│
│
│
? help esc back ↑/↓ move enter open n new
? help ↑/↓ move enter open n new
--- Start a task ---