feat(viewer): the agent dock and the first-run page (P11b)

D-27: a terminal panel along the bottom of the viewer (alacritty_terminal over
a PTY) runs Claude Code (default) or Codex in the book's books home, resizable,
collapsible, the choice remembered. The agent is an ordinary child process the
owner describes (agent_start); the viewer stays read-only: the agent writes
through the server like any other. A missing agent is offered through its
vendor's installer (a command to copy), never bundled; no folder is marked
trusted (Q-7, recommended answer: let Codex ask). Windows is not offered until
its ConPTY checks are recorded.

P11a found that onboarding with no terminal was false: the viewer opened only an
existing book. With no books and an owner, wanderbooks gui now shows a first-run
page: the private folder, the owner passphrase (typed in the viewer, optional),
the first books, an agent, then the books open. connect and New books... make
the books home. Tests: dock.rs, welcome.rs, books_home.rs (host and cli).
Docs: testing.md record and For P12, architecture, parity, gui.md, README.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
This commit is contained in:
swaitsandClaude Fable 5.1 committed 2026-10-29 17:06:14 -06:00
1 parent 0442ab804e
commit 8f2e3378e8
15 files changed
+2620 -33

No files matched your search

+4 -7
View File
@@ -1355,14 +1355,11 @@ pub fn installer(agent: &str) -> Option<Installer> {
}
}
/// The folder holding the user's documents: `$XDG_DOCUMENTS_DIR` if
/// absolute, else `Documents` in the home (the same word on every system
/// this program runs on).
/// The folder holding the user's documents: `Documents` in the home (the
/// word the spec uses on every system this program runs on; nothing in the
/// environment moves it, so a test's own `HOME` is all a test needs).
pub fn documents_dir() -> Option<PathBuf> {
std::env::var_os("XDG_DOCUMENTS_DIR")
.map(PathBuf::from)
.filter(|d| d.is_absolute())
.or_else(|| home_dir_env().map(|h| h.join("Documents")))
home_dir_env().map(|h| h.join("Documents"))
}
/// The books home of `book` (D-27): a visible folder,