Skip to content

Robrix: a multi-platform Matrix chat client written in Rust, using the Makepad UI toolkit and the Robius app dev framework

License

Notifications You must be signed in to change notification settings

project-robius/robrix

Repository files navigation

Robrix: a Rust Matrix client built atop Robius

Robrix Matrix Chat Project Robius Matrix Chat

Robrix is a Matrix chat client written in Rust to demonstrate the functionality of Project Robius, a framework for multi-platform application development in Rust. Robrix is written using the Makepad UI toolkit.

▶️ Click here to see the Robrix project tracker!

Note

⚠️ Robrix is a work-in-progress that doesn't yet support all Matrix chat features.

Check out our most recent talks and presentations for more info:

The following table shows which host systems can currently be used to build Robrix for which target platforms.

Host OS Target Platform Builds? Runs?
macOS macOS
macOS Android
macOS iOS
Linux Linux
Linux Android
Windows Windows
Windows Android

Known issues

  • Drag-n-drop on Linux isn't implemented by Makepad, so you cannot drag room tabs around yet. (see: makepad/makepad#650)
  • There is currently no way to explicitly log out of Robrix. You can run robrix --login-screen to show the login screen upon app startup, or delete the app data directory.
  • Matrix-specific links (https://matrix.to/...) aren't fully handled in-app yet.
  • Ignoring/unignoring a user clears all timelines (see: matrix-org/matrix-rust-sdk#1703); the timeline will be re-filled gradually via back pagination, but the viewport position is not maintained.
  • Currently, accessing system geolocation on Android may not succeed due to failing to prompt the user for permission. Please enable the location permission in the App Info settings page for Robrix, and then it should work as expected.

Building & Running Robrix on Desktop

  1. First, install Rust.

  2. If you're building on Linux or WSL on Windows, install the required dependencies. Otherwise, proceed to step 3.

    • openssl, clang/libclang, binfmt, Xcursor/X11, asound/pulse.

    On a Debian-like Linux distro (e.g., Ubuntu), run the following:

    sudo apt-get update
    sudo apt-get install libssl-dev libsqlite3-dev pkg-config binfmt-support libxcursor-dev libx11-dev libasound2-dev libpulse-dev
  3. Then, build and run Robrix (--release is optional):

    cargo run --release

    Optionally, you can provide a username and password on the command line for fast auto-login. Note that you only have to specify this once; after one successful login, Robrix will automatically re-login the most recent user without having to specify the user ID or password.

    cargo run --release -- 'USERNAME' 'PASSWORD' ['HOMESERVER_URL']
    • Note that if you enter your password on the command line, you should wrap it in single quotes (not double quotes) in order to prevent your shell from treating certain symbols as globs/regex patterns.
    • The HOMESERVER_URL argument is optional and uses the matrix.org homeserver by default.
    • The Matrix homeserver must support native Sliding Sync, the same requirement as Element X.

Building & Running Robrix on Mobile: Android, iOS, iPadOS

  1. Install the cargo-makepad build tool:
    cargo install --force --git https://github.com/makepad/makepad.git --branch rik cargo-makepad

Android

  1. Use cargo-makepad to install the Android toolchain, with the full NDK:

    cargo makepad android install-toolchain --full-ndk
  2. Build and run Robrix using cargo-makepad:

    cargo makepad android run -p robrix --release
    • You'll need to connect a physical Android device with developer options enabled, or start up an emulator using Android Studio.
      • API version 33 or higher is required, which is Android 13 and up.

iOS / iPadOS

  1. Use cargo-makepad to install the iOS toolchain:

    rustup toolchain install nightly
    cargo makepad apple ios install-toolchain
  2. Perform the following one-time setup steps:

    1. If running on a real iOS device, enable your iPhone's Developer Mode: Settings → Privacy & Security → Developer Mode → turn on Developer Mode and reboot.
    2. Ensure your Apple Developer account is properly set up on your Mac.
    3. Create an empty "dummy" project in Xcode:
      • File → New → Project to create a new "App"
      • Set the Product Name as robrix. (used in the --org argument later)
      • Set the Organization Identifier to a value of your choice, e.g., rs.robius. (used in the --app argument later)
      • For Project Signing & Capabilities, select the proper Apple Developer team account.
    4. In Xcode, Build/Run this project once to install and run the app on the simulator (or device).
    5. Once the simulator or device has the empty "dummy" app installed and running properly, then you're ready to build the actual Robrix application below.

Running on an iOS simulator

  1. If you're using an iOS simulator, do the following:
    cargo makepad apple ios \
      --org=rs.robius \
      --app=robrix \
      run-sim -p robrix --release

Running on a real iOS device

  1. Run the following command to show all provisioning profiles, signing identities, and device identifiers on your Mac.

    cargo makepad apple list
    • You must select which values you need to use for each of the 3 above items.
    • If you get an error from the above command, then please ensure you performed the full iOS setup instructions above, and that you have a valid Apple Developer account with certificates installed on your Mac.
  2. Run the following command, filling in the unique starting characters chosen above.

    cargo makepad apple ios \
      --profile=<unique-starting-hex-string> \
      --cert=<UNIQUE_STARTING_HEX_STRING> \
      --device=<UNIQUE-STARTING-HEX-STRING> \
      --org=rs.robius \
      --app=robrix \
      run-device -p robrix –release

Feature status tracker

These are generally sorted in order of priority. If you're interested in helping out with anything here, please reach out via a GitHub issue or on our Robius matrix channel.

Basic room views and fundamental actions

  • View list of joined rooms
  • View timeline of events in a single room
  • Fetch and display room avatars
  • Fetch user profiles (displayable names)
  • Cache user profiles and avatars
  • Cache fetched media on a per-room basis
  • Fetch and display user profile avatars
  • Backwards pagination to view a room's older history
  • Dynamic backwards pagination based on scroll position/movement: #109
  • Loading animation while waiting for pagination request: #109
  • Stable vertical position of events during timeline update
  • Display simple plaintext messages
  • Display image messages (PNG, JPEG)
  • HTML (rich text) formatting for message bodies
  • Display reactions (annotations)
  • Handle opening links on click
  • Linkify plaintext hyperlinks
  • Show reply previews above messages: #82
  • Send standalone messages
  • Interactive reaction button, send reactions: #115
  • Show reply button, send reply: #83
  • E2EE device verification, decrypt message content: #116
  • Display multimedia (audio/video/gif) message events: #120
  • Re-spawn timeline as focused on an old event after a full timeline clear: #103

Auxiliary features, login, registration, settings

  • Persistence of app session to disk: #112
  • Username/password login screen: #113
  • SSO, other 3rd-party auth providers login screen: #114
  • Side panel showing detailed user profile info (click on their Avatar)
  • Ignore and unignore users (see known issues)
  • Display read receipts besides messages: #162
  • Mention users within a room (or the whole @room): #452
  • Collapsible/expandable view of contiguous "small" events: #118
  • User settings screen
  • Dedicated view of spaces
  • Dedicated view of direct messages (DMs): #139
  • Link previews beneath messages: #81
  • Keyword filters for the list of all rooms: #123
  • Search messages within a room: #122
  • Room browser, search for public rooms
  • Join room, invite to room, knock on room
  • Administrative abilities: ban, kick, etc
  • Room creation/settings/info screen
  • Room members pane
  • Save/restore events in rooms to/from the event cache upon app shutdown/start: #164

Packaging Robrix for Distribution on Desktop Platforms

Tip

We already have pre-built releases of Robrix available for download.

  1. Install cargo-packager:
rustup update stable  ## Rust version 1.79 or higher is required
cargo +stable install --force --locked cargo-packager

For posterity, these instructions have been tested on cargo-packager version 0.10.1, which requires Rust v1.79.

  1. Install the robius-packaging-commands crate with the makepad feature enabled:
cargo install --locked --git https://github.com/project-robius/robius-packaging-commands.git
  1. Then run the packaging command, which must build in release mode:
cargo packager --release ## --verbose is optional

Platform-specific considerations

Note that due to platform restrictions, you can currently only build:

  • Linux packages on a Linux OS machine
  • Windows installer executables on a Windows OS machine
  • macOS disk images / app bundles on a macOS machine
  • iOS apps on a macOS machine.
  • Android, on a machine with any OS!

There are some additional considerations when packaging Robrix for macOS:

Important

You will see a .dmg window pop up — please leave it alone, it will auto-close once the packaging procedure has completed.

Tip

If you receive the following error:

ERROR cargo_packager::cli: Error running create-dmg script: File exists (os error 17)

then open Finder and unmount any Robrix-related disk images, then try the above cargo packager command again.

Tip

If you receive an error like so:

Creating disk image...
hdiutil: create failed - Operation not permitted
could not access /Volumes/Robrix/Robrix.app - Operation not permitted

then you need to grant "App Management" permissions to the app in which you ran the cargo packager command, e.g., Terminal, Visual Studio Code, etc. To do this, open System PreferencesPrivacy & SecurityApp Management, and then click the toggle switch next to the relevant app to enable that permission. Then, try the above cargo packager command again.

After the command completes, you should see both the Robrix.app and the .dmg in the dist/ directory. You can immediately double-click the Robrix.app bundle to run it, or you can double-click the .dmg file to

Note that the .dmg is what should be distributed for installation on other machines, not the .app.

If you'd like to modify the .dmg background, here is the Google Drawings file used to generate the MacOS .dmg background image.

Credits

X logo: https://www.vecteezy.com/png/42148611-new-twitter-x-logo-twitter-icon-x-social-media-icon (shobumiah)