workspace: Add background image setting with offline-resilient loading

Adds a workspace background image that renders behind all UI, configured
via a new `background` settings section (path, fit, opacity).

The image is loaded asynchronously with a 2-second timeout and is never
read on the render path, so an unreachable source (e.g. a dead network
mount) cannot block or freeze the workspace. The first successful read is
cached under the data directory (written once, never rewritten), and when
the source is unavailable the cached image is served from that cache, so
the background keeps working offline.
This commit is contained in:
yenru0 committed 2026-09-02 19:12:22 +09:00
1 parent 49f5fe7750
commit 4c94072003
8 files changed
+580 -1

No files matched your search

+10
View File
@@ -597,6 +597,16 @@
// Any unrecognized input device will fall back to system default.
"experimental.input_audio_device": null,
},
// Background image settings
"background": {
// The path to the image displayed behind the workspace UI.
// `~` and environment variables are expanded. `null` disables the background image.
"path": null,
// How the image is fitted into the workspace bounds: "cover", "fill" or "contain".
"fit": "cover",
// The opacity of the background image, between 0.0 (fully transparent) and 1.0 (fully opaque).
"opacity": 0.6,
},
// Scrollbar related settings
"scrollbar": {
// When to show the scrollbar in the editor.