feat(gui): each company's assistants: three states, Ask your assistant, the Connect page, a warning before closing
P15 unit A4, plan 3.3 and D-79. The window only reads the books, so it now says so by what it offers. Each company is in one of three states (no assistant, connected, working) read from the books server's own sessions answer, never waited for, drawn as a shape on its tab and said in words with the last thing done at the right of the top bar; the sidebar gives up no height, because the links must all fit at 1479x519. Where a button that edits would be there is "Ask your assistant", which copies a ready sentence. The Connect page has a row per local tool with exact commands, the keys with who is on each, and Revoke through the existing command path. Closing the window or a tab with an assistant connected warns first, before and never beside the server's own close. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
1d1a2a5a88
commit
022c0c642f
32 files changed
+3083
-40
No files matched your search
@@ -43,7 +43,9 @@
|
||||
//! cut, whole in its hover text), then the strip scrolls, with a
|
||||
//! step control at each end; the tab shown is scrolled into view
|
||||
//! when it changes. Each tab leaves room left of its close control
|
||||
//! for a state mark (drawn by a later unit, nothing now).
|
||||
//! for the assistant state mark (`Tab::link`, connect.rs: plugs
|
||||
//! apart, plugs together, a turning arc, so it reads without colour;
|
||||
//! its words are in the tab's hover).
|
||||
//! 6. This only says what was asked (show, close, open); the app does
|
||||
//! it.
|
||||
//! 7. A tab whose company has a job under way that changes its books
|
||||
@@ -70,8 +72,8 @@ const CLOSE: f32 = 20.0;
|
||||
/// The badge's size, and its gap to the name.
|
||||
const BADGE: f32 = 18.0;
|
||||
const GAP: f32 = 8.0;
|
||||
/// Room left of the close control for the connection state, which a later
|
||||
/// unit draws there.
|
||||
/// Room left of the close control for the connection state mark
|
||||
/// (`Tab::link`).
|
||||
const STATE_W: f32 = 14.0;
|
||||
/// The room round a tab's content: left and right.
|
||||
const PAD_L: f32 = 10.0;
|
||||
@@ -100,6 +102,10 @@ pub struct Tab {
|
||||
/// running ("Restoring these books: wait for it to finish"). Its close
|
||||
/// control is off, and says so on hover.
|
||||
pub held: Option<String>,
|
||||
/// Whether an assistant is connected to the company, and whether it
|
||||
/// is working: drawn as a shape left of the close control, with its
|
||||
/// words in the tab's hover (nothing for `Link::Unknown`).
|
||||
pub link: crate::connections::Link,
|
||||
}
|
||||
|
||||
/// The badge hue of the company whose books have id `book_id`, light or
|
||||
@@ -517,6 +523,12 @@ fn one_tab(
|
||||
galley,
|
||||
p.text,
|
||||
);
|
||||
crate::connect::paint_mark(
|
||||
ui,
|
||||
egui::pos2(close_rect.left() - STATE_W / 2.0 - 2.0, rect.center().y),
|
||||
14.0,
|
||||
tab.link,
|
||||
);
|
||||
if close.hovered() && tab.held.is_none() {
|
||||
painter.rect_filled(close_rect, CornerRadius::same(5), p.selected);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user