Skip to content

Commit 7b1bc23

Browse files
synleclaude
andcommitted
feat!: vendor display-dj-cli, drop HTTP sidecar (v7.0.0)
BREAKING CHANGE: collapses the bundled display-dj-server HTTP sidecar into in-process Rust calls. The platform code (DDC/CI, gamma, WMI, DisplayServices, dark mode, volume, wallpaper, slideshow) is now vendored under src-tauri/src/core/ and Tauri commands invoke it directly via spawn_blocking. There is no separate process to manage, no port discovery, no HTTP, no externalBin, no bundled binaries, no runtime dependency on display-dj-cli releases. Architecture - core/{mod,macos,windows,linux,theme,volume,wallpaper,display}.rs vendored from display-dj-cli main.rs + platform files (~1100 LOC). core::PlatformImpl is a cfg-gated alias to the right platform type. - src/{display,dark_mode,volume,wallpaper}.rs are now thin Tauri-cmd wrappers; CPU-bound calls wrapped in spawn_blocking to keep async signatures (macOS tray pitfall). - tray.rs::execute_command dispatches everything in-process; build_command_url is now cfg(test)-only and always returns None. - AppState lost sidecar_child. lib.rs lost SERVER_PORT, server_port, kill_stale_sidecars, find_available_port, wait_for_server, fetch_debug_on_startup, the sidecar spawn block, and the RunEvent::Exit child.kill block. fetch_initial_tray_state now reads core::theme/volume directly. Removed - tauri-plugin-shell (Cargo.toml + capabilities/default.json) - src-tauri/binaries/ (6 prebuilt server binaries) - externalBin in tauri.conf.json - displayDjCliVersion in package.json - build.rs sidecar download fallback (now just tauri_build::build() + the existing expose_app_version helper) Added Cargo deps - ddc 0.2 (top-level) - ddc-macos 0.2, libc 0.2 (macOS) - ddc-winapi 0.2, winapi 0.3 (Windows); Win32_Devices_Display feature on the existing windows crate Tests - cargo test --lib: 229 passed - npm test: 70 passed - frontend build: clean Docs - CLAUDE.md, README.md, CONTRIBUTING.md rewritten to describe the in-process model. New "Vendored platform core" section in CONTRIBUTING.md replaces the old sidecar setup steps. Net diff: +623 / -1739 across 25 files. Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
1 parent be8b253 commit 7b1bc23

33 files changed

Lines changed: 3134 additions & 1741 deletions

CLAUDE.md

Lines changed: 69 additions & 71 deletions
Large diffs are not rendered by default.

CONTRIBUTING.md

Lines changed: 107 additions & 168 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ A cross-platform desktop system tray app for controlling monitor brightness, con
5050
- **Settings panel** -- tabbed UI (General + Tiling) with auto-save. Configure brightness, contrast, monitors, night mode, snap zones, exposé grid size, layout strategy, and launch at login
5151
- **About / Update check** -- "About Display DJ" in the tray menu shows current version, latest GitHub release, engine, platform, build date, and homepage. Green "Up to date" or orange "Update available" badge with download link. macOS section includes quarantine fix and Accessibility settings commands
5252
- **System tray app** -- lives in your menu bar / system tray with no dock or taskbar clutter
53-
- **Single-instance** -- only one copy of Display DJ runs at a time. If you accidentally launch it twice (e.g. autostart racing a manual launch), the duplicate exits silently so you never end up with multiple tray icons or competing sidecars
5453

5554
## Download & Install
5655

@@ -329,9 +328,9 @@ This recursively clears the quarantine flag so macOS allows the app to run. You
329328

330329
## Tech Stack
331330

332-
[Tauri v2](https://v2.tauri.app/) (Rust) + React 19 + TypeScript + Vite 6 + [display-dj CLI](https://github.com/synle/display-dj-cli)
331+
[Tauri v2](https://v2.tauri.app/) (Rust) + React 19 + TypeScript + Vite 6.
333332

334-
Display and dark mode operations are handled by the bundled [display-dj CLI](https://github.com/synle/display-dj-cli) sidecar -- no external tools need to be installed on macOS or Windows.
333+
All platform code (DDC/CI, gamma, WMI, DisplayServices, dark mode, volume, wallpaper) lives in-process inside the Rust backend under `src-tauri/src/core/`. There is no external sidecar or helper binary -- macOS and Windows need no extra tools installed; Linux needs the system packages listed in the install section above.
335334

336335
## Contributing
337336

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"name": "display-dj",
33
"version": "0.0.0",
44
"description": "Cross-platform desktop app for monitor brightness, contrast, and dark mode control",
5-
"displayDjCliVersion": "v2.2.2",
65
"scripts": {
76
"dev": "vite",
87
"build": "tsc && vite build",

src-tauri/Cargo.lock

Lines changed: 94 additions & 66 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ serde_json = "1"
1717
tauri = { version = "2", features = ["tray-icon"] }
1818
tauri-plugin-autostart = "2"
1919
tauri-plugin-global-shortcut = "2"
20-
tauri-plugin-shell = "2"
2120
serde = { version = "1", features = ["derive"] }
2221
serde_json = "1"
2322
dirs = "6"
@@ -30,10 +29,13 @@ keepawake = "0.6"
3029
tauri-plugin-dialog = "2"
3130
md5 = "0.7"
3231
zip = "2"
32+
ddc = "0.2"
3333

3434
[target.'cfg(target_os = "macos")'.dependencies]
3535
objc = "0.2"
3636
block = "0.1"
37+
ddc-macos = "0.2"
38+
libc = "0.2"
3739

3840
[target.'cfg(target_os = "linux")'.dependencies]
3941
x11rb = { version = "0.13", features = ["randr"] }
@@ -46,7 +48,10 @@ windows = { version = "0.58", features = [
4648
"Win32_UI_HiDpi",
4749
"Win32_UI_WindowsAndMessaging",
4850
"Win32_System_Threading",
51+
"Win32_Devices_Display",
4952
] }
53+
ddc-winapi = "0.2"
54+
winapi = { version = "0.3", features = ["wingdi", "windef"] }
5055

5156
[profile.release]
5257
panic = "abort"
-806 KB
Binary file not shown.
-545 KB
Binary file not shown.
-954 KB
Binary file not shown.
-805 KB
Binary file not shown.

0 commit comments

Comments
 (0)