sam 9006a082b0
Build Mumble Web 2 / linux_build (push) Successful in 1m24s
Build Mumble Web 2 / windows_build (push) Successful in 2m36s
Build Mumble Web 2 / android_build (push) Successful in 5m57s
Build android container / android-release-builder-container-build (push) Successful in -4s
Build Mumble Web 2 release builder containers / windows-release-builder-container-build (push) Successful in 16s
Refactor the imp/gui bondary to use real traits (#18)
# Summary

Introduces a trait-based platform abstraction layer that makes the boundary
between platform-specific and shared code explicit and compile-time verified.

The TLDR version of this new trait stuff works:

1. Define a `PlatformInterface` trait.
2. Each platform defines a zero-sized struct implementing the trait (ex `WebPlatform`).
3. Create an ifdef'd type alias on those structs:

```rust
#[cfg(feature = "web")]
pub type Platform = web::WebPlatform;

#[cfg(all(feature = "desktop"))]
pub type Platform = desktop::DesktopPlatform;

#[cfg(all(feature = "mobile", not(feature = "web")))]
pub type Platform = mobile::MobilePlatform;
```

5. Add a compile time assertion that `Platform` implements `PlatformInterface`.

#  Motivation

Previously, platform code used a mix of pub use re-exports and #[cfg] blocks
that made it difficult to understand what each platform must implement. The
new trait-based approach provides:

- Clear documentation of the platform contract
- Compile-time verification that all platforms implement required
  functionality
- Ability to cargo check without feature flags (via stub platform)

# Changes

New traits in imp/mod.rs:
  - PlatformInterface - logging, permissions, network, config, storage. Overall this the trait that platforms must satify to compile.
  - AudioSystemInterface - audio system initialization and recording
  - AudioPlayerInterface - opus audio playback

 Type aliases:
  - Platform, AudioSystem, AudioPlayer resolve to the correct types based on
  feature flags

Call site updates:
  - Changed from imp::function() to Platform::function() syntax
  - Removed ImpRead/ImpWrite helper traits in favor of direct bounds

# Testing

Manual testing reveals that Web and Desktop still work, I (Liam) have not tested the mobile version beyond compilation.

Co-authored-by: Liam Warfield <liam.warfield@gmail.com>
Reviewed-on: #18
Co-authored-by: Sam Sartor <me@samsartor.com>
Co-committed-by: Sam Sartor <me@samsartor.com>
2026-02-18 04:53:41 +00:00
2025-12-05 07:00:38 +00:00
2026-01-19 19:17:23 -07:00
2026-01-19 22:07:06 +00:00
2025-04-06 18:08:09 -06:00
2025-12-04 22:21:37 -07:00

GUI Development

Running Desktop

  1. cargo install dioxus-cli --version 0.7.1
  2. dx run -p mumble-web2-gui --platform desktop --release

Running Web (development)

  1. cargo install dioxus-cli --version 0.7.1
  2. dx serve -p mumble-web2-gui --platform web
  3. cd docker && docker compose up
  4. connect to https://localhost:64444
  5. fill in the proxy url as https://127.0.0.1:4433/proxy (this should autofill)

Running Web (with proxy only)

  1. cargo install dioxus-cli --version 0.7.1
  2. dx build -p mumble-web2-gui --platform web --release
  3. cp config.toml.example config.toml
  4. cargo run -p mumble-web2-proxy in the background
  5. connect to localhost:8080
S
Description
No description provided
Readme 987 KiB
Languages
Rust 87.7%
SCSS 5.4%
JavaScript 3.1%
Dockerfile 3%
Shell 0.8%