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:
1 parent
861ed57d82
commit
13a3f1b519
7 files changed
+1026
-12
No files matched your search
@@ -188,6 +188,10 @@ pub struct App {
|
||||
assistants_ok: bool,
|
||||
/// "Now" for "10 seconds ago", fixed (tests, screenshots) or not.
|
||||
fixed_now: Option<chrono::DateTime<chrono::Utc>>,
|
||||
/// The Connect page has been opened by itself once, or an assistant has
|
||||
/// been connected: kept per installation, and never again after that
|
||||
/// (WB-app-6).
|
||||
first_connect_done: bool,
|
||||
}
|
||||
|
||||
/// The warning about assistants that is up (INVARIANT 10).
|
||||
@@ -206,6 +210,9 @@ enum Warn {
|
||||
/// for a moment does not make an assistant that was connected seem gone.
|
||||
const WARN_AGE: std::time::Duration = std::time::Duration::from_secs(60);
|
||||
|
||||
/// The kept preference that says the Connect page has opened by itself.
|
||||
const FIRST_CONNECT_KEY: &str = "first_connect_done";
|
||||
|
||||
/// What a window is called when no company is in front.
|
||||
const TITLE: &str = "wanderbooks";
|
||||
|
||||
@@ -334,9 +341,50 @@ impl App {
|
||||
let schemes = SchemeMenu::restored(get, ctx.global_style().visuals.dark_mode);
|
||||
let mut app = Self::bare(ctx, schemes);
|
||||
app.dock_prefs = (get("dock_open"), get("dock_agent"));
|
||||
app.first_connect_done = get(FIRST_CONNECT_KEY).is_some();
|
||||
app
|
||||
}
|
||||
|
||||
/// The first time a company is open and no assistant has ever been
|
||||
/// connected, the Connect page opens by itself, once (WB-app-6): a
|
||||
/// person who installs, starts the app and makes or opens their first
|
||||
/// company sees the way to connect an assistant without looking for it.
|
||||
/// "Never connected" is the server's own answer for the whole
|
||||
/// installation: no key, no session, no web approval. It is asked after
|
||||
/// the answer is known (never from a guess), it is remembered per
|
||||
/// installation, and it is not asked again once an assistant exists.
|
||||
fn first_connect(&mut self, statuses: &[Status]) {
|
||||
if self.first_connect_done {
|
||||
return;
|
||||
}
|
||||
let Some(roster) = self.connections.roster() else {
|
||||
return; // not known yet: not a guess
|
||||
};
|
||||
let any = !roster.tokens.is_empty()
|
||||
|| !roster.assistants.is_empty()
|
||||
|| !roster.web_approvals.is_empty()
|
||||
|| !roster.web_pending.is_empty();
|
||||
if any {
|
||||
self.first_connect_done = true;
|
||||
return;
|
||||
}
|
||||
let ready = statuses
|
||||
.get(self.active)
|
||||
.is_some_and(|s| s.serves && !s.down && s.link != Link::Unknown);
|
||||
if !ready {
|
||||
return;
|
||||
}
|
||||
if let Some(v) = self.views.get_mut(self.active) {
|
||||
v.open_connect();
|
||||
self.first_connect_done = true;
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether the Connect page has opened by itself already (tests).
|
||||
pub fn first_connect_done(&self) -> bool {
|
||||
self.first_connect_done
|
||||
}
|
||||
|
||||
/// The first-run page, if it is up (tests).
|
||||
pub fn welcome(&self) -> Option<&crate::welcome::Welcome> {
|
||||
self.welcome.as_ref()
|
||||
@@ -381,6 +429,7 @@ impl App {
|
||||
warn: Warn::Off,
|
||||
assistants_ok: false,
|
||||
fixed_now: None,
|
||||
first_connect_done: false,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1233,6 +1282,7 @@ impl eframe::App for App {
|
||||
for (v, s) in self.views.iter_mut().zip(&statuses) {
|
||||
v.set_assist(s.clone());
|
||||
}
|
||||
self.first_connect(&statuses);
|
||||
let tabs: Vec<Tab> = self
|
||||
.views
|
||||
.iter()
|
||||
@@ -1280,6 +1330,9 @@ impl eframe::App for App {
|
||||
|
||||
fn save(&mut self, storage: &mut dyn eframe::Storage) {
|
||||
self.schemes.keep(&mut |k, v| storage.set_string(k, v));
|
||||
if self.first_connect_done {
|
||||
storage.set_string(FIRST_CONNECT_KEY, "1".to_string());
|
||||
}
|
||||
// The dock, as the front tab has it, else as it was kept.
|
||||
match self.active_view() {
|
||||
Some(v) => v.dock_ref().keep(&mut |k, v| storage.set_string(k, v)),
|
||||
|
||||
@@ -228,6 +228,11 @@ impl CompanyView {
|
||||
self.assist = status;
|
||||
}
|
||||
|
||||
/// Open the Connect page (the first run does, once: app.rs).
|
||||
pub fn open_connect(&mut self) {
|
||||
self.nav.go(Route::Connect);
|
||||
}
|
||||
|
||||
/// What this view was last given of its assistants (tests).
|
||||
pub fn assist(&self) -> &crate::connections::Status {
|
||||
&self.assist
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
//! sentence; Connect is a page per company: on this computer, a row
|
||||
//! per tool, and the connections with Revoke); D-77 (bookkeeping is
|
||||
//! through an assistant, the window reads); WB-assist-1,
|
||||
//! WB-assist-3, WB-assist-4.
|
||||
//! WB-assist-3, WB-assist-4, WB-assist-6 (the web half), WB-app-6
|
||||
//! (the first run).
|
||||
//! INVARIANTS:
|
||||
//! 1. One place per fact: a tab carries the state as a shape (the same
|
||||
//! three shapes everywhere: plugs apart, plugs together, a turning
|
||||
@@ -43,8 +44,9 @@
|
||||
//! 6. Nothing here blocks the frame: every request of the server runs
|
||||
//! off the UI thread; what is shown while it is not known is "not
|
||||
//! known", never a guess.
|
||||
//! 7. The web half of the page (the switch, the address, the steps for
|
||||
//! Claude and ChatGPT) is unit B3's. Unit B1's part of it is here: a
|
||||
//! 7. The web half of the page (the switch, the progress, the address and
|
||||
//! the steps) is WB-assist-6's (`State::web_switch`, `web_progress`,
|
||||
//! `claude_steps`). Unit B1's part of it is here: a
|
||||
//! web assistant that asks to connect is shown to the person, in
|
||||
//! words, as a card that says who is asking, where it is sent back
|
||||
//! to, the address it asked from and what it will be able to do, with
|
||||
@@ -418,6 +420,10 @@ pub struct State {
|
||||
/// The waiting web assistants the person has ticked "let it post
|
||||
/// entries too" for.
|
||||
post_asked: std::collections::BTreeSet<String>,
|
||||
/// "Get a new address" was clicked once: the second click does it.
|
||||
new_address_asked: bool,
|
||||
/// The address was just copied (the time, for the word "Copied").
|
||||
copied_at: Option<f64>,
|
||||
}
|
||||
|
||||
/// The two lines an assistant set up by hand needs.
|
||||
@@ -458,16 +464,27 @@ impl State {
|
||||
&mut self,
|
||||
ui: &mut Ui,
|
||||
status: &Status,
|
||||
book: &str,
|
||||
owner: &Option<Arc<dyn Owner>>,
|
||||
jobs: &crate::jobs::Spawner,
|
||||
) {
|
||||
if status.web_pending.is_empty() && status.web_approvals.is_empty() {
|
||||
let web = owner.as_ref().and_then(|o| o.web_state(book));
|
||||
if web.is_none() && status.web_pending.is_empty() && status.web_approvals.is_empty() {
|
||||
return;
|
||||
}
|
||||
let p = pal(ui.ctx());
|
||||
ui.add_space(24.0);
|
||||
section(ui, "Assistants on the web");
|
||||
section(ui, "On the web");
|
||||
let mut want: Want = None;
|
||||
if let Some(web) = &web {
|
||||
if let Some(w) = self.web_switch(ui, status, book, web, owner) {
|
||||
want = Some(w);
|
||||
}
|
||||
ui.add_space(10.0);
|
||||
}
|
||||
if !(status.web_pending.is_empty() && status.web_approvals.is_empty()) {
|
||||
section(ui, "Assistants on the web");
|
||||
}
|
||||
let (shown, more) = newest_waiting(&status.web_pending);
|
||||
for request in shown {
|
||||
if let Some(w) = self.pending_card(ui, status, request, owner) {
|
||||
@@ -819,7 +836,7 @@ impl State {
|
||||
),
|
||||
};
|
||||
}
|
||||
self.web_section(ui, status, &owner, jobs);
|
||||
self.web_section(ui, status, book, &owner, jobs);
|
||||
ui.add_space(24.0);
|
||||
self.connections(ui, status, book, &owner, jobs);
|
||||
});
|
||||
@@ -1220,3 +1237,306 @@ fn connection_row(
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// ---- the web half of the page (plan P15 unit B3) ------------------------------
|
||||
|
||||
/// The exact steps for Claude on the web, for the address `connector`.
|
||||
/// Only what the plan can stand behind (plan/served.md 3 and the Connect
|
||||
/// card there: Settings, Connectors, Add custom connector, paste the
|
||||
/// address, sign in); the sign-in is this window's (D-83, D-90).
|
||||
pub fn claude_steps() -> [&'static str; 3] {
|
||||
[
|
||||
"In Claude on the web, open Settings, then Connectors.",
|
||||
"Choose \u{201c}Add custom connector\u{201d} and paste the address above.",
|
||||
"Claude opens a sign-in page that shows a code. Come back to this window, check that the code is the same, and choose Allow.",
|
||||
]
|
||||
}
|
||||
|
||||
/// What the page says for ChatGPT: no steps are given, because none were
|
||||
/// tried (plan 7: "ChatGPT Plus and write tools: OpenAI's two pages
|
||||
/// disagree").
|
||||
pub const CHATGPT_NOTE: &str = "We haven't tested this yet, so there are no steps to give. If you add the address above to ChatGPT as a connector, the sign-in comes to this window the same way.";
|
||||
|
||||
/// What the page says for any other assistant.
|
||||
pub const OTHER_NOTE: &str = "Other assistants (Gemini, Grok, muse.ai and the like): we haven't tested these yet. The same address may work; the sign-in comes to this window the same way.";
|
||||
|
||||
/// Words for the steps of turning web assistants on: what is done, what is
|
||||
/// being done, what waits. `current` is the one in progress (none once it
|
||||
/// is connected).
|
||||
pub fn web_progress(step: crate::owner::WebStep) -> [(&'static str, Progress); 3] {
|
||||
use crate::owner::WebStep as S;
|
||||
let first = match step {
|
||||
S::Off | S::GettingAddress | S::Connecting => Progress::Now,
|
||||
_ => Progress::Done,
|
||||
};
|
||||
let second = match step {
|
||||
S::GettingCertificate => Progress::Now,
|
||||
S::Connected => Progress::Done,
|
||||
_ => Progress::Waiting,
|
||||
};
|
||||
let third = match step {
|
||||
S::Connected => Progress::Done,
|
||||
_ => Progress::Waiting,
|
||||
};
|
||||
[
|
||||
("Getting an address", first),
|
||||
("Getting a certificate", second),
|
||||
("Connected", third),
|
||||
]
|
||||
}
|
||||
|
||||
/// Where one of the steps stands.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub enum Progress {
|
||||
/// Done.
|
||||
Done,
|
||||
/// Being done now.
|
||||
Now,
|
||||
/// Not started.
|
||||
Waiting,
|
||||
}
|
||||
|
||||
/// A switch: a pill that is on or off, with its label, as one control.
|
||||
/// The label is its accessible name, so it is found as "Allow web
|
||||
/// assistants".
|
||||
fn switch(ui: &mut Ui, on: bool, enabled: bool, label: &str) -> egui::Response {
|
||||
let p = pal(ui.ctx());
|
||||
let size = vec2(40.0, 22.0);
|
||||
let (rect, resp) = ui.allocate_exact_size(
|
||||
size,
|
||||
if enabled {
|
||||
Sense::click()
|
||||
} else {
|
||||
Sense::hover()
|
||||
},
|
||||
);
|
||||
if ui.is_rect_visible(rect) {
|
||||
let t = ui.ctx().animate_bool(resp.id, on);
|
||||
let fill = if on { p.accent } else { p.border };
|
||||
ui.painter().rect_filled(
|
||||
rect,
|
||||
CornerRadius::same(11),
|
||||
fill.gamma_multiply(if enabled { 1.0 } else { 0.5 }),
|
||||
);
|
||||
let r = rect.height() / 2.0 - 3.0;
|
||||
let x = egui::lerp((rect.left() + r + 3.0)..=(rect.right() - r - 3.0), t);
|
||||
ui.painter()
|
||||
.circle_filled(egui::pos2(x, rect.center().y), r, p.surface);
|
||||
}
|
||||
let name = label.to_string();
|
||||
resp.widget_info(move || {
|
||||
egui::WidgetInfo::selected(egui::WidgetType::Checkbox, enabled, on, name.clone())
|
||||
});
|
||||
resp
|
||||
}
|
||||
|
||||
impl State {
|
||||
/// The switch, the progress, the address with Copy and the steps
|
||||
/// (plan 3.3). What the person asks for, if anything.
|
||||
fn web_switch(
|
||||
&mut self,
|
||||
ui: &mut Ui,
|
||||
status: &Status,
|
||||
book: &str,
|
||||
web: &crate::owner::WebConnect,
|
||||
owner: &Option<Arc<dyn Owner>>,
|
||||
) -> Want {
|
||||
let p = pal(ui.ctx());
|
||||
let mut want: Want = None;
|
||||
let can = owner.is_some() && self.job.is_none();
|
||||
ui.horizontal(|ui| {
|
||||
let resp = switch(ui, web.on, can, "Allow web assistants");
|
||||
ui.label(RichText::new("Allow web assistants").font(theme::semibold(14.0)));
|
||||
if resp.clicked()
|
||||
&& let Some(o) = owner.clone()
|
||||
{
|
||||
let b = book.to_string();
|
||||
self.new_address_asked = false;
|
||||
want = Some(if web.on {
|
||||
(
|
||||
"Turning web assistants off".to_string(),
|
||||
"Turning web assistants off".to_string(),
|
||||
Box::new(move || o.web_turn_off(&b)) as Box<dyn FnOnce() -> Outcome + Send>,
|
||||
)
|
||||
} else {
|
||||
(
|
||||
"Turning web assistants on".to_string(),
|
||||
"Turning web assistants on".to_string(),
|
||||
Box::new(move || o.web_turn_on(&b)) as Box<dyn FnOnce() -> Outcome + Send>,
|
||||
)
|
||||
});
|
||||
}
|
||||
});
|
||||
ui.label(
|
||||
RichText::new(format!(
|
||||
"Claude and ChatGPT on the web can only reach {} if you give them an address on the internet. Turn this on to get one. Wanderbooks keeps it private to you, and nobody can read what passes through. An assistant on the web still has to be allowed here, by you, each time it connects.",
|
||||
status.company
|
||||
))
|
||||
.font(theme::regular(13.0))
|
||||
.color(p.muted),
|
||||
);
|
||||
if !web.on {
|
||||
ui.add_space(4.0);
|
||||
ui.label(
|
||||
RichText::new(if web.kept {
|
||||
"Off. Nothing on this computer can be reached from the internet. Turning it on again gives the same address as before."
|
||||
} else {
|
||||
"Off. Nothing on this computer can be reached from the internet."
|
||||
})
|
||||
.font(theme::regular(13.0))
|
||||
.color(p.muted),
|
||||
);
|
||||
return want;
|
||||
}
|
||||
ui.add_space(8.0);
|
||||
// Progress, in words.
|
||||
for (words, progress) in web_progress(web.step) {
|
||||
ui.horizontal(|ui| match progress {
|
||||
Progress::Done => {
|
||||
ui.label(RichText::new(icon::CHECK_CIRCLE).color(p.accent));
|
||||
ui.label(RichText::new(words).font(theme::regular(13.5)));
|
||||
}
|
||||
Progress::Now if web.problem.is_some() => {
|
||||
ui.label(RichText::new(icon::WARNING).color(p.warning));
|
||||
ui.label(RichText::new(words).font(theme::regular(13.5)));
|
||||
}
|
||||
Progress::Now => {
|
||||
ui.spinner();
|
||||
ui.label(RichText::new(format!("{words}\u{2026}")).font(theme::regular(13.5)));
|
||||
}
|
||||
Progress::Waiting => {
|
||||
ui.label(RichText::new(icon::CIRCLE).color(p.muted));
|
||||
ui.label(
|
||||
RichText::new(words)
|
||||
.font(theme::regular(13.5))
|
||||
.color(p.muted),
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
if web.step != crate::owner::WebStep::Connected || web.problem.is_some() {
|
||||
ui.ctx()
|
||||
.request_repaint_after(std::time::Duration::from_millis(500));
|
||||
}
|
||||
if let Some(problem) = &web.problem {
|
||||
ui.add_space(4.0);
|
||||
ui.label(
|
||||
RichText::new(problem)
|
||||
.font(theme::regular(13.0))
|
||||
.color(p.warning),
|
||||
);
|
||||
if !web.needs_person {
|
||||
ui.label(
|
||||
RichText::new(
|
||||
"Your assistants on this computer, and this window, are not affected.",
|
||||
)
|
||||
.font(theme::regular(12.5))
|
||||
.color(p.muted),
|
||||
);
|
||||
}
|
||||
}
|
||||
// The address is shown once it works (or while the page says why it
|
||||
// does not): not before, so nobody pastes one that cannot answer yet.
|
||||
if let Some(connector) = web
|
||||
.connector
|
||||
.as_ref()
|
||||
.filter(|_| web.step == crate::owner::WebStep::Connected || web.problem.is_some())
|
||||
{
|
||||
ui.add_space(10.0);
|
||||
ui.label(RichText::new("The address to give an assistant").font(theme::semibold(13.5)));
|
||||
ui.horizontal(|ui| {
|
||||
Frame::new()
|
||||
.fill(p.surface)
|
||||
.stroke(Stroke::new(1.0, p.border))
|
||||
.corner_radius(CornerRadius::same(6))
|
||||
.inner_margin(Margin::symmetric(8, 5))
|
||||
.show(ui, |ui| {
|
||||
ui.add(
|
||||
egui::Label::new(
|
||||
RichText::new(connector).font(egui::FontId::monospace(12.5)),
|
||||
)
|
||||
.selectable(true),
|
||||
);
|
||||
});
|
||||
let copy = ui.button(format!("{} Copy", icon::COPY));
|
||||
if copy.clicked() {
|
||||
ui.ctx().copy_text(connector.clone());
|
||||
self.copied_at = Some(ui.input(|i| i.time));
|
||||
}
|
||||
copy.widget_info(|| {
|
||||
egui::WidgetInfo::labeled(egui::WidgetType::Button, true, "Copy the address")
|
||||
});
|
||||
if let Some(at) = self.copied_at {
|
||||
if ui.input(|i| i.time) - at < 3.0 {
|
||||
ui.label(
|
||||
RichText::new("Copied")
|
||||
.font(theme::regular(12.5))
|
||||
.color(p.muted),
|
||||
);
|
||||
ui.ctx()
|
||||
.request_repaint_after(std::time::Duration::from_millis(500));
|
||||
} else {
|
||||
self.copied_at = None;
|
||||
}
|
||||
}
|
||||
});
|
||||
ui.label(
|
||||
RichText::new("Keep this address to yourself: anyone who has it can ask to connect (you would still be asked first).")
|
||||
.font(theme::regular(12.5))
|
||||
.color(p.muted),
|
||||
);
|
||||
ui.add_space(10.0);
|
||||
ui.label(RichText::new("Claude on the web").font(theme::semibold(13.5)));
|
||||
for (i, step) in claude_steps().iter().enumerate() {
|
||||
ui.label(RichText::new(format!("{}. {step}", i + 1)).font(theme::regular(13.0)));
|
||||
}
|
||||
ui.add_space(8.0);
|
||||
ui.label(RichText::new("ChatGPT").font(theme::semibold(13.5)));
|
||||
ui.label(
|
||||
RichText::new(CHATGPT_NOTE)
|
||||
.font(theme::regular(13.0))
|
||||
.color(p.muted),
|
||||
);
|
||||
ui.add_space(8.0);
|
||||
ui.label(RichText::new("Another assistant").font(theme::semibold(13.5)));
|
||||
ui.label(
|
||||
RichText::new(OTHER_NOTE)
|
||||
.font(theme::regular(13.0))
|
||||
.color(p.muted),
|
||||
);
|
||||
}
|
||||
// A new address, behind a confirmation.
|
||||
ui.add_space(12.0);
|
||||
if self.new_address_asked {
|
||||
ui.label(
|
||||
RichText::new("The old address stops working at once. Every assistant connected through it has to be connected again with the new one.")
|
||||
.font(theme::regular(13.0))
|
||||
.color(p.warning),
|
||||
);
|
||||
ui.horizontal(|ui| {
|
||||
if ui
|
||||
.add_enabled(can, egui::Button::new("Get a new address"))
|
||||
.clicked()
|
||||
&& let Some(o) = owner.clone()
|
||||
{
|
||||
let b = book.to_string();
|
||||
self.new_address_asked = false;
|
||||
want = Some((
|
||||
"Getting a new address".to_string(),
|
||||
"Getting a new address".to_string(),
|
||||
Box::new(move || o.web_new_address(&b)),
|
||||
));
|
||||
}
|
||||
if ui.button("Keep the old one").clicked() {
|
||||
self.new_address_asked = false;
|
||||
}
|
||||
});
|
||||
} else if ui
|
||||
.add_enabled(can, egui::Button::new("Get a new address\u{2026}"))
|
||||
.clicked()
|
||||
{
|
||||
self.new_address_asked = true;
|
||||
}
|
||||
want
|
||||
}
|
||||
}
|
||||
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user