bos-settings: first-pass --screenshot CLI mode for automated capture

First bread-ecosystem app on the Tauri/webview stack rather than raw
GTK4 — proves the isolated-headless-Sway capture pipeline works against
a plain (non-layer-shell) tao/wry window with no gtk4-rs-specific signal
to hook. No connect_map here: since the window isn't owned by gtk4-rs
directly, this instead waits a fixed settle delay (2s — longer than the
native apps need, since a webview's first paint means a full page load
plus an async Tauri-command round-trip for real content, not just GTK
widget layout — confirmed by an initial 800ms attempt capturing the
sidebar correctly but the About panel's data still blank) on Tauri's own
async runtime, then captures the known-size canvas and exits.

Only one view ("default", the initial landing section) is wired up.
Capturing a specific sidebar section would mean routing the Svelte
frontend to a URL/hash on window creation — real, separate frontend
work, deferred past this first pass.

bread-screenshots is pulled from bread-ecosystem's dev branch, unlike
this repo's existing bread-theme/bread-utils deps which point at main —
it doesn't exist on main yet.
This commit is contained in:
Breadway 2026-07-29 16:47:47 +08:00
parent 3d36ebc568
commit fe4a455cef
4 changed files with 136 additions and 2 deletions

24
src/Cargo.lock generated
View file

@ -290,8 +290,10 @@ dependencies = [
name = "bos-settings"
version = "0.8.0"
dependencies = [
"anyhow",
"bread-screenshots",
"bread-theme",
"bread-utils",
"bread-utils 0.3.1 (git+https://github.com/Breadway/bread-ecosystem?branch=main)",
"notify",
"regex",
"serde",
@ -304,6 +306,16 @@ dependencies = [
"toml_edit 0.22.27",
]
[[package]]
name = "bread-screenshots"
version = "0.3.1"
source = "git+https://git.breadway.dev/Breadway/bread-ecosystem?branch=dev#c93f4cf4d0ea1d49e639a1b5b4507e5a2497f52d"
dependencies = [
"anyhow",
"bread-utils 0.3.1 (git+https://git.breadway.dev/Breadway/bread-ecosystem?branch=dev)",
"tracing",
]
[[package]]
name = "bread-theme"
version = "0.3.1"
@ -314,6 +326,16 @@ dependencies = [
"serde_json",
]
[[package]]
name = "bread-utils"
version = "0.3.1"
source = "git+https://git.breadway.dev/Breadway/bread-ecosystem?branch=dev#c93f4cf4d0ea1d49e639a1b5b4507e5a2497f52d"
dependencies = [
"dirs 5.0.1",
"serde",
"serde_json",
]
[[package]]
name = "bread-utils"
version = "0.3.1"