feat(gui): the web half of the Connect page and the first run (P15 B3)

The Connect page gets "On the web": a switch "Allow web assistants" per company,
off by default; three lines of progress in plain words (getting an address,
getting a certificate, connected) with a spinner on the one under way; once it
works, the address for the company with Copy; the three steps for Claude on the
web that the plan stands behind (Settings, Connectors, Add custom connector,
paste, sign in and match the code); and, for ChatGPT and any other assistant,
"we haven't tested this yet" rather than steps nobody tried. What goes wrong is
in words and says whether the window and the assistants on this computer are
affected. A new address is asked for twice.

The first time a company is open and the server says no assistant was ever
connected, the Connect page opens by itself, once, remembered per installation.
The owner trait gains web_state, web_turn_on, web_turn_off and web_new_address;
an owner that does not offer them shows no switch. The tabs tests start with the
first run already done, since they are about tabs.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-21 13:40:00 -07:00
1 parent 861ed57d82
commit 13a3f1b519
7 files changed
+1026 -12

No files matched your search

+57
View File
@@ -253,6 +253,44 @@ pub struct WebApproval {
pub last_used: Option<i64>,
}
/// How far web assistants have got for a company (plan P15 B3): the steps
/// the page tells in words.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum WebStep {
/// Off.
Off,
/// Getting an address.
GettingAddress,
/// Making the line to the relay.
Connecting,
/// The line is up; the certificate is being got.
GettingCertificate,
/// A web assistant can reach the company now.
Connected,
}
/// What the Connect page shows of one company's web assistants. Read from
/// memory by the owner, every frame, never a wait.
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct WebConnect {
/// The switch.
pub on: bool,
/// How far it has got.
pub step: WebStep,
/// The address for the whole installation, while on.
pub address: Option<String>,
/// The address an assistant is given for this company.
pub connector: Option<String>,
/// A line of progress, in words.
pub words: String,
/// What is wrong, in words.
pub problem: Option<String>,
/// The problem needs the person (it will not mend itself).
pub needs_person: bool,
/// An address is kept for when web assistants are turned on again.
pub kept: bool,
}
/// Who is connected and who may connect, across the open companies.
#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub struct Roster {
@@ -349,6 +387,25 @@ pub trait Owner: Send + Sync {
fn web_set_post(&self, _approval: &str, _post: bool) -> Result<String, String> {
Err("not here".into())
}
/// The company's web assistants as they stand: `None` when this window
/// has no way to offer them (the switch is not drawn). Reads memory;
/// never waits.
fn web_state(&self, _book: &str) -> Option<WebConnect> {
None
}
/// Turn web assistants on for the company: `Ok` says what happens next
/// in words. Blocks (a request or two of the server).
fn web_turn_on(&self, _book: &str) -> Result<String, String> {
Err("not here".into())
}
/// Turn them off for the company. Blocks.
fn web_turn_off(&self, _book: &str) -> Result<String, String> {
Err("not here".into())
}
/// A new address for web assistants: the old one stops working. Blocks.
fn web_new_address(&self, _book: &str) -> Result<String, String> {
Err("not here".into())
}
/// This program run with `words`, as a line to type in a terminal (the
/// program's own path, the words, the data root if one was named): what
/// the Connect page shows for an assistant it has no button for.