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
@@ -56,10 +56,11 @@ impl RegisterRange {
|
||||
pub fn show_chart(ui: &mut Ui, b: &Books, shell: &mut Shell<'_>) {
|
||||
let p = pal(ui.ctx());
|
||||
page(ui, "accounts", |ui| {
|
||||
widgets::page_header(
|
||||
widgets::page_header_ask(
|
||||
ui,
|
||||
"Accounts",
|
||||
"Every account in the chart with today's balance. Click one for its register.",
|
||||
"add an account to the chart",
|
||||
);
|
||||
ui.checkbox(
|
||||
&mut shell.state.accounts.show_empty,
|
||||
|
||||
@@ -499,10 +499,11 @@ fn date_controls(ui: &mut Ui, b: &Books, shell: &mut Shell<'_>) -> NaiveDate {
|
||||
pub fn show_register(ui: &mut Ui, b: &Books, shell: &mut Shell<'_>) {
|
||||
let p = pal(ui.ctx());
|
||||
page(ui, "assets", |ui| {
|
||||
widgets::page_header(
|
||||
widgets::page_header_ask(
|
||||
ui,
|
||||
"Fixed assets",
|
||||
"Everything the company owns as a fixed asset: its label, what it cost, how much has been depreciated, and what it's worth on the books, reconciled to the general ledger.",
|
||||
"add a fixed asset",
|
||||
);
|
||||
if b.ledger.registered_assets().next().is_none() {
|
||||
widgets::card(ui, |ui| {
|
||||
|
||||
@@ -158,10 +158,11 @@ pub fn show(ui: &mut Ui, b: &Books, shell: &mut Shell<'_>) {
|
||||
let mut kept_go: Option<Route> = None;
|
||||
page(ui, "company", |ui| {
|
||||
let c = &b.settings.company;
|
||||
widgets::page_header(
|
||||
widgets::page_header_ask(
|
||||
ui,
|
||||
&c.name,
|
||||
"The company's profile and the standing parts of its books.",
|
||||
"change a company setting",
|
||||
);
|
||||
columns(ui, 980.0, &[1.0, 1.0], |i, ui| match i {
|
||||
0 => {
|
||||
|
||||
@@ -46,13 +46,14 @@ fn grid(ui: &mut Ui, b: &Books, selected: Option<u64>, shell: &mut Shell<'_>) {
|
||||
.iter()
|
||||
.filter(|a| a.withdrawn_at.is_none())
|
||||
.count();
|
||||
widgets::page_header(
|
||||
widgets::page_header_ask(
|
||||
ui,
|
||||
"Documents",
|
||||
&format!(
|
||||
"{} on file: receipts that prove entries, and the company's records. Bytes are content-addressed and verified on every read.",
|
||||
fmt::count(current, "document", "documents")
|
||||
),
|
||||
"attach a receipt or document",
|
||||
);
|
||||
let mut cats: Vec<String> = b.attachments.iter().map(|a| a.category.clone()).collect();
|
||||
cats.sort();
|
||||
|
||||
@@ -238,10 +238,15 @@ fn status_text(st: &DocState, date: NaiveDate, today: NaiveDate) -> String {
|
||||
pub fn show_list(ui: &mut Ui, b: &Books, bills: bool, shell: &mut Shell<'_>) {
|
||||
let p = pal(ui.ctx());
|
||||
page(ui, "invoices", |ui| {
|
||||
widgets::page_header(
|
||||
widgets::page_header_ask(
|
||||
ui,
|
||||
"Invoices & Bills",
|
||||
"What customers owe the company and what it owes vendors, each figure read from the ledger, tied to its account. The bookkeeper issues, records and voids them.",
|
||||
if bills {
|
||||
"enter a new bill"
|
||||
} else {
|
||||
"create a new invoice"
|
||||
},
|
||||
);
|
||||
let mut side = bills;
|
||||
if widgets::segmented(
|
||||
|
||||
@@ -72,6 +72,9 @@ pub fn show(ui: &mut Ui, b: &Books, route: &Route, shell: &mut Shell<'_>) {
|
||||
Route::Documents => documents::show(ui, b, None, shell),
|
||||
Route::Document(id) => documents::show(ui, b, Some(*id), shell),
|
||||
Route::Company => company::show(ui, b, shell),
|
||||
// Drawn by the company's view, which holds the page's state
|
||||
// (connect.rs).
|
||||
Route::Connect => {}
|
||||
Route::Journal => journal::show(ui, b, None, shell),
|
||||
Route::JournalEvent(seq) => journal::show(ui, b, Some(*seq), shell),
|
||||
}
|
||||
|
||||
@@ -330,10 +330,11 @@ pub(crate) fn chip(ui: &mut Ui, text: &str, on: bool) -> bool {
|
||||
pub fn show_list(ui: &mut Ui, b: &Books, shell: &mut Shell<'_>) {
|
||||
let p = pal(ui.ctx());
|
||||
page(ui, "parties", |ui| {
|
||||
widgets::page_header(
|
||||
widgets::page_header_ask(
|
||||
ui,
|
||||
"Parties",
|
||||
"Everyone the company deals with — vendors, contractors, customers, platforms, agencies — and what the company paid each and received from each. Click one for everything the books hold about them.",
|
||||
"add a customer or vendor",
|
||||
);
|
||||
if b.ledger.parties().next().is_none() {
|
||||
widgets::card(ui, |ui| {
|
||||
|
||||
@@ -122,7 +122,7 @@ pub fn show_list(ui: &mut Ui, b: &Books, shell: &mut Shell<'_>) {
|
||||
let p = pal(ui.ctx());
|
||||
page(ui, "projects", |ui| {
|
||||
let all = listed(b);
|
||||
widgets::page_header(ui, "Projects", &summary(&all));
|
||||
widgets::page_header_ask(ui, "Projects", &summary(&all), "add a project");
|
||||
if all.is_empty() {
|
||||
widgets::card(ui, |ui| {
|
||||
widgets::empty(
|
||||
|
||||
@@ -64,13 +64,14 @@ fn list(ui: &mut Ui, b: &Books, selected: Option<u64>, shell: &mut Shell<'_>) {
|
||||
let p = pal(ui.ctx());
|
||||
page(ui, "transactions", |ui| {
|
||||
let total = b.entries.len();
|
||||
widgets::page_header(
|
||||
widgets::page_header_ask(
|
||||
ui,
|
||||
"Transactions",
|
||||
&format!(
|
||||
"{} recorded, newest first. Click one to see its lines, its receipt, and its history.",
|
||||
fmt::count(total, "entry", "entries")
|
||||
),
|
||||
"record a new transaction",
|
||||
);
|
||||
let st = &mut shell.state.transactions;
|
||||
let narrow = ui.available_width() < 720.0;
|
||||
|
||||
Reference in new issue
Block a user