refactor(gui): remove "Close the books": the app is the host and a company's tab closes the company

The menu item asked a host's lease socket, which the app does not have, and
under the app could only answer "the app has these books open". Closing a
company's tab closes that company in the app's server (WB-app-2) and closing
the window closes them all (WB-app-4), so the item had no job left. The
Owner trait loses close_books; the test owners lose their copies.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-21 11:03:23 -07:00
1 parent eafd269ba0
commit 8d2187bae7
11 files changed
+10 -90

No files matched your search

-3
View File
@@ -207,9 +207,6 @@ impl Owner for Fake {
self.note(format!("connect {} {book}", agent.key()));
Ok(vec![format!("{} reaches the books.", agent.label())])
}
fn close_books(&self) -> Result<String, String> {
Err("not here".into())
}
fn new_books(&self, _: &str, _: &str) -> Result<String, String> {
Err("not here".into())
}
-3
View File
@@ -28,9 +28,6 @@ struct Fake {
}
impl Owner for Fake {
fn close_books(&self) -> Result<String, String> {
Err("not here".into())
}
fn new_books(&self, _: &str, _: &str) -> Result<String, String> {
Err("not here".into())
}
@@ -80,9 +80,6 @@ struct Fake {
}
impl Owner for Fake {
fn close_books(&self) -> Result<String, String> {
Err("not in these tests".into())
}
fn new_books(&self, _id: &str, _currency: &str) -> Result<String, String> {
Err("not in these tests".into())
}
+4 -19
View File
@@ -33,10 +33,6 @@ impl Fake {
}
impl Owner for Fake {
fn close_books(&self) -> Result<String, String> {
self.said("close".into());
Ok("The books are closing.".into())
}
fn new_books(&self, id: &str, currency: &str) -> Result<String, String> {
self.said(format!("new {id} {currency}"));
Ok(format!("Made new books \"{id}\" ({currency})."))
@@ -247,19 +243,11 @@ fn the_books_menu_hands_each_action_to_the_owner_and_writes_nothing() {
"restore /media/disk/acme.git acme 7"
);
// Close the books: asked first; cancelled, nothing; then done.
// There is no "Close the books": a company's tab, or the window, closes
// the books (WB-app-2, WB-app-4).
open_menu(&mut h);
h.get_by_label_contains("Close the books").click();
h.run_steps(3);
h.get_by_label("Cancel").click();
h.run_steps(3);
assert_eq!(f.asked.lock().unwrap().len(), start + 4);
open_menu(&mut h);
h.get_by_label_contains("Close the books").click();
h.run_steps(3);
h.get_by_label("Close the books").click();
settle(&mut h, &f, start + 5);
assert_eq!(f.asked.lock().unwrap()[start + 4], "close");
assert!(h.query_by_label_contains("Close the books").is_none());
h.run_steps(2);
// The viewer wrote nothing of the books.
drop(h);
@@ -409,7 +397,4 @@ fn screenshots() {
settle(&mut h, &f, n + 1);
shot(&mut h, "restore-plan");
h.get_by_label("Cancel").click();
open_menu(&mut h);
h.get_by_label_contains("Close the books").click();
shot(&mut h, "close");
}
-6
View File
@@ -173,9 +173,6 @@ impl Owner for Fake {
fn serve_exited(&self) -> Option<String> {
self.exited.lock().unwrap().clone()
}
fn close_books(&self) -> Result<String, String> {
Err("not here".into())
}
fn new_books(&self, _: &str, _: &str) -> Result<String, String> {
Err("not here".into())
}
@@ -461,9 +458,6 @@ fn a_window_with_no_server_asks_nothing_of_any() {
// An owner that does not host a server: the default.
struct Plain;
impl Owner for Plain {
fn close_books(&self) -> Result<String, String> {
Err("not here".into())
}
fn new_books(&self, _: &str, _: &str) -> Result<String, String> {
Err("not here".into())
}
-3
View File
@@ -36,9 +36,6 @@ use std::sync::{Arc, OnceLock};
struct Quiet;
impl Owner for Quiet {
fn close_books(&self) -> Result<String, String> {
Err("not here".into())
}
fn new_books(&self, _: &str, _: &str) -> Result<String, String> {
Err("not here".into())
}
-7
View File
@@ -578,9 +578,6 @@ struct Agentic {
}
impl Owner for Agentic {
fn close_books(&self) -> Result<String, String> {
Err("not here".into())
}
fn new_books(&self, _: &str, _: &str) -> Result<String, String> {
Err("not here".into())
}
@@ -2095,10 +2092,6 @@ impl Gated {
}
impl Owner for Gated {
fn close_books(&self) -> Result<String, String> {
self.block();
Ok("The books are closing.".into())
}
fn new_books(&self, _: &str, _: &str) -> Result<String, String> {
Err("not here".into())
}
-3
View File
@@ -33,9 +33,6 @@ impl Fake {
}
impl Owner for Fake {
fn close_books(&self) -> Result<String, String> {
Err("not in these tests".into())
}
fn new_books(&self, _: &str, _: &str) -> Result<String, String> {
Err("not in these tests".into())
}
-3
View File
@@ -35,9 +35,6 @@ impl Fake {
}
impl Owner for Fake {
fn close_books(&self) -> Result<String, String> {
Err("not here".into())
}
fn new_books(&self, id: &str, currency: &str) -> Result<String, String> {
self.said(format!("new {id} {currency}"));
let (_, root) = self.root_path();