From 62122d5f41eb27e8686de64bb2804263bd19deb7 Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Mon, 8 Sep 2025 10:16:11 +0800 Subject: [PATCH] docs: Update contributing for UI guides. (#1215) --- CONTRIBUTING.md | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dbb72028..66fcf63c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,10 +1,24 @@ -## Contributing Guide +# Contributing Guide 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. +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. + +## AI Assistance + +> 🤖 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. + +## Code Style + +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. ## Development and Testing @@ -25,3 +39,18 @@ There is also available some split examples, run `cargo run --example` to see th ```bash cargo run --example table ``` + +## UI Guides + +GPUI 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: + +- [Apple Human Interface Guidelines](https://developer.apple.com/design/human-interface-guidelines/) +- [Microsoft Fluent Design System](https://learn.microsoft.com/en-us/windows/apps/design/) +- [shadcn/ui](https://ui.shadcn.com/) + +### Rules + +- Use `default` mouse cursor not `pointer` for buttons, unless it's a link button, we are building desktop apps, not web apps. +- Use `md` size for most cases and as the default.