feat(app): the Windows program opens no console window; the window is named Wanderbooks (P15 C1)
The installed program is one executable that is the window, the books server's child and the assistants' bridge. Built for the Windows GUI subsystem, a Start Menu launch shows no console; console.rs gives a command run in a terminal its words back and never replaces a pipe an assistant handed the bridge. The two console programs the window starts (the agent's own list, the system's opener) get CREATE_NO_WINDOW. The window title is the product name; the storage id and the Linux app id stay lowercase so nothing already kept moves. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
a44744253d
commit
3b02e70794
9 files changed
+134
-15
No files matched your search
@@ -214,7 +214,7 @@ const WARN_AGE: std::time::Duration = std::time::Duration::from_secs(60);
|
||||
const FIRST_CONNECT_KEY: &str = "first_connect_done";
|
||||
|
||||
/// What a window is called when no company is in front.
|
||||
const TITLE: &str = "wanderbooks";
|
||||
const TITLE: &str = "Wanderbooks";
|
||||
|
||||
impl App {
|
||||
/// The live app over one company's books directory.
|
||||
|
||||
@@ -141,10 +141,17 @@ pub fn open(path: &Path) {
|
||||
#[cfg(target_os = "macos")]
|
||||
let cmd = std::process::Command::new("open").arg(path).spawn();
|
||||
#[cfg(target_os = "windows")]
|
||||
let cmd = std::process::Command::new("cmd")
|
||||
.args(["/C", "start", ""])
|
||||
.arg(path)
|
||||
.spawn();
|
||||
let cmd = {
|
||||
// The window has no console (WB-pkg-2): a console program it
|
||||
// starts would open one for a moment, so it is told not to
|
||||
// (CREATE_NO_WINDOW).
|
||||
use std::os::windows::process::CommandExt;
|
||||
std::process::Command::new("cmd")
|
||||
.args(["/C", "start", ""])
|
||||
.arg(path)
|
||||
.creation_flags(0x0800_0000)
|
||||
.spawn()
|
||||
};
|
||||
#[cfg(not(any(target_os = "macos", target_os = "windows")))]
|
||||
let cmd = std::process::Command::new("xdg-open").arg(path).spawn();
|
||||
let _ = cmd;
|
||||
|
||||
@@ -140,7 +140,7 @@ pub fn run(
|
||||
};
|
||||
let options = eframe::NativeOptions {
|
||||
viewport: egui::ViewportBuilder::default()
|
||||
.with_title("wanderbooks")
|
||||
.with_title("Wanderbooks")
|
||||
.with_app_id("wanderbooks")
|
||||
.with_inner_size([1440.0, 920.0])
|
||||
// Small on purpose: tiling window managers hand out small slots
|
||||
|
||||
@@ -336,7 +336,7 @@ fn each_tab_shows_its_own_company_and_figures() {
|
||||
loaded(&mut h);
|
||||
assert_eq!(titles(&h), ["Alpha Co", "Beta Co"]);
|
||||
assert_eq!(h.state().active(), Some(0));
|
||||
assert_eq!(h.state().window_title(), "Alpha Co · wanderbooks");
|
||||
assert_eq!(h.state().window_title(), "Alpha Co · Wanderbooks");
|
||||
|
||||
// Alpha: cash 10,000.00 less 1,234.56 rent is 8,765.44.
|
||||
assert!(shows(&h, "8,765.44"), "alpha's cash: {:?}", texts(&h));
|
||||
@@ -354,7 +354,7 @@ fn each_tab_shows_its_own_company_and_figures() {
|
||||
// Beta: cash 25,000.00 less 777.77 is 24,222.23.
|
||||
show_tab(&mut h, "Beta Co");
|
||||
assert_eq!(h.state().active(), Some(1));
|
||||
assert_eq!(h.state().window_title(), "Beta Co · wanderbooks");
|
||||
assert_eq!(h.state().window_title(), "Beta Co · Wanderbooks");
|
||||
assert!(
|
||||
matches!(h.state().route(), Route::Overview),
|
||||
"a tab opens on its overview, not on the page the other was on"
|
||||
@@ -768,7 +768,7 @@ fn start_up_restores_the_open_tabs_their_order_and_the_one_in_front() {
|
||||
assert_eq!(titles(&h), ["Gamma Co", "Alpha Co", "Beta Co"]);
|
||||
assert_eq!(h.state().active(), Some(1), "the same one in front");
|
||||
assert!(h.state().views().iter().all(|v| v.error().is_none()));
|
||||
assert_eq!(h.state().window_title(), "Alpha Co · wanderbooks");
|
||||
assert_eq!(h.state().window_title(), "Alpha Co · Wanderbooks");
|
||||
|
||||
// No record: the data root's first, alone.
|
||||
let h2 = start_with_prefs(&w, &[]);
|
||||
@@ -894,15 +894,15 @@ fn closing_the_front_tab_shows_a_neighbour_and_the_last_leaves_an_empty_window()
|
||||
show_tab(&mut h, "Beta Co");
|
||||
close_tab(&mut h, "Beta Co");
|
||||
assert_eq!(titles(&h), ["Alpha Co", "Gamma Co"]);
|
||||
assert_eq!(h.state().window_title(), "Gamma Co · wanderbooks");
|
||||
assert_eq!(h.state().window_title(), "Gamma Co · Wanderbooks");
|
||||
// A tab behind the front one closing leaves the front one in front.
|
||||
close_tab(&mut h, "Alpha Co");
|
||||
assert_eq!(titles(&h), ["Gamma Co"]);
|
||||
assert_eq!(h.state().window_title(), "Gamma Co · wanderbooks");
|
||||
assert_eq!(h.state().window_title(), "Gamma Co · Wanderbooks");
|
||||
// The last one.
|
||||
close_tab(&mut h, "Gamma Co");
|
||||
assert!(h.state().views().is_empty());
|
||||
assert_eq!(h.state().window_title(), "wanderbooks");
|
||||
assert_eq!(h.state().window_title(), "Wanderbooks");
|
||||
assert!(shows(&h, "No company is open"), "{:?}", texts(&h));
|
||||
assert!(
|
||||
shows(&h, "Open a company with the + at the top of the window."),
|
||||
@@ -1737,7 +1737,7 @@ fn the_status_card_shows_the_company_in_front_and_follows_the_tab() {
|
||||
"alpha's hue left the card"
|
||||
);
|
||||
// The window's title still names the company.
|
||||
assert_eq!(h.state().window_title(), "Beta Co · wanderbooks");
|
||||
assert_eq!(h.state().window_title(), "Beta Co · Wanderbooks");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user