feat(gui): the notice for a host that holds the books has a button that closes it
Plan P15 unit A5, fix round. When an older build's detached host (or `wanderbooks serve`) holds the books, the app's start is refused, and the notice said to run `wanderbooks close`. A packaged Mac or Windows install may have no command line on the path. The notice now says what will happen, and carries a "Close it" button that asks the host to close the books and waits until it has (`commands::close_the_host`, what `wanderbooks close` does, over the unchanged lease protocol, which an older host speaks), then starts the app's own server and takes the notice away. The line to type stays in the words as the fallback. A close that fails says why and offers the button again; a start refused for any other reason offers none. The `Owner` trait gets two methods with default bodies (`serve_host_holds`, `serve_close_host`), so existing implementations, test mocks included, are untouched. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
6164d0fa68
commit
c47144a401
6 files changed
+388
-1
No files matched your search
@@ -96,6 +96,14 @@ impl ledger_gui::owner::Owner for ViewerOwner {
|
||||
self.server.start(open)
|
||||
}
|
||||
|
||||
fn serve_host_holds(&self) -> bool {
|
||||
ledger_host::commands::a_host_holds(self.common.root.as_deref())
|
||||
}
|
||||
|
||||
fn serve_close_host(&self) -> Result<String, String> {
|
||||
ledger_host::commands::close_the_host(self.common.root.as_deref())
|
||||
}
|
||||
|
||||
fn serve_open(&self, book: &str) -> Result<Option<String>, String> {
|
||||
self.server.open_book(book)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user