Contributions are welcome, if you find some bugs or have some ideas, please open an issue or submit a pull request.
Please ensure that you are using clean code, following the coding style and code organization in existing code, and make sure all the tests pass.
Please submit one PR that does one thing, this is important, and helps us to review your code more easily and push to merge fast.
🤖 When you submit PR, please point out which parts are generated by AI, if any.
All code generated by AI must be reviewed and tested by humans, and should follow the same coding style and code organization as existing code.
The AI generated code without refactoring will be rejected.
Before you start to write code, please read the existing code to follow the same coding style and code organization.
- Inspired by existing code or refer to macOS/Windows controls API design to name your functions, properties, structs etc.
The script folder contains some useful scripts to help you set up the development environment.
To install the system dependencies, run the following script:
./script/bootstrapFor Windows, you can run the following command in PowerShell:
.\script\install-window.ps1There are a lot of UI test cases in the crates/story folder, if you change the existing features you can run the tests to make sure they are working.
Use cargo run to run the complete story examples to display them all in a gallery of GPUI components.
cargo runThere is also available some split examples, run cargo run --example to see the available examples.
cargo run --example tableGPUI Component is inspired by macOS and Windows controls, combined with shadcn/ui design for a modern experience.
So please refer to the following UI guides when you design or change the UI components:
- Use
defaultmouse cursor notpointerfor buttons, unless it's a link button, we are building desktop apps, not web apps. - Use
mdsize for most cases and as the default.
When you change the rendering code, please profile the performance to make sure the FPS is still good.
You can use MTL_HUD_ENABLED=1 environment variable to enable the Metal HUD to see the FPS and other performance metrics.
MTL_HUD_ENABLED=1 cargo runNOTE: Only available on macOS with Metal backend, and the FPS is up limited your monitor refresh rate, usually 60 or 120.
You can use Samply to profile the performance of the application to get more detailed information.
samply record cargo runUse samply record command to start rust development, and do some operations in the app that you want to profile, then stop the terminal with ctrl-c, then samply will open the browser to show the profile results.
When we are ready to release a new version, please follow the steps below:
./script/bump-version.sh x.y.z-
Run
cargo set-versionto set the new version for all crates.cargo set-version x.y.z
-
Git Commit the changes with message
Bump vx.y.z. -
Create a new git tag with the version
vx.y.zand pushmainbranch and the tag to remote.git tag vx.y.z git push origin vx.y.z
-
Then GitHub Actions will automatically publish the crates to crates.io and create a new release in GitHub.