feat(gui): one tab per open company, each a window on that company alone (D-78)
The viewer was a window on one company: App mixed what is one company's (loader, books, page, filters, receipts, dock, menus) with what is the app's (the color scheme). Two companies in two tabs need those apart, or a filter set in one tab shows in the other. - company.rs: CompanyView owns everything per company, including its own loader, its own handle to the Owner (the process-wide set_owner stays the program's default, each view takes a handle when made and a test can give a view another), its own dock and so its agent process. - app.rs: App holds the per-app state, the views and which is in front. A view not in front still reads its loader every frame and takes the agent's books.show for its own page, so showing it later is current at once and the loader's channel never piles up Books behind it. - Every egui id a view makes is scoped by the view's own id (push_id around the view; the owner dialogs' and the palette's modals, the pages' split widths, the sidebar's footer memo and links memo take it too; the projects' figure cache is keyed by the books). Otherwise egui's memory (a scrolled sidebar) carries from one tab into the next. - data.rs: dropping a Loader wakes its thread at once and the thread stops, so a closed tab lets go of its watcher and its viewer presence now and not at the thread's next look (up to 3 s); Loader::watch tells a test the thread has ended. - tabs.rs: the tab bar. One tab per company (the books' name, else their id), the front one marked by a heavier name, an accent bar and "selected" to assistive technology, not colour alone; a close control on each (middle click too); "+" lists the data root's companies not open; overflow scrolls with a step control at each end. It runs beside the sidebar, not above it: above it the owner's 1479x519 window makes the sidebar's links scroll (sidenav.rs), with a bar of 36, 28 or 24 points alike, so the sidebar keeps the window's whole height. - lib.rs/app.rs: a company named on the command line is the only tab; otherwise the companies open at the last close come back, in order, with the same one in front and each one's page and report period; a company that is gone is skipped, none left opens the data root's first. The old per-app keys keep their names; open_companies, active_company and company.<id>.* are new. The window's title names the company in front. - scheme_menu.rs: the scheme button and its state moved out of App as they are (one scheme for the window). A new tab's dock opens closed with the front tab's agent chosen, so opening a company never starts an agent nobody asked for. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
526c27233e
commit
48cf9e3a03
11 files changed
+3362
-1893
No files matched your search
@@ -466,6 +466,15 @@ impl Default for Dock {
|
||||
}
|
||||
|
||||
impl Dock {
|
||||
/// A closed dock with `agent` chosen: another company's tab opening
|
||||
/// beside one whose dock is in use.
|
||||
pub fn closed_with(agent: Agent) -> Dock {
|
||||
Dock {
|
||||
agent,
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
/// The dock as kept: the `agent` key and the `open` flag.
|
||||
pub fn restored(get: impl Fn(&str) -> Option<String>) -> Dock {
|
||||
Dock {
|
||||
|
||||
Reference in new issue
Block a user