| 1 | # Contributing to Rusty Teams |
| 2 | |
| 3 | Most of this code is written with AI agents, and that is welcome here. Just say which model did the work. |
| 4 | |
| 5 | ## Before you start |
| 6 | |
| 7 | | Step | What | |
| 8 | |---|---| |
| 9 | | 1 | Read [GUARDRAILS.md](GUARDRAILS.md): where the app must match Teams and where it may differ. It wins over any habit. | |
| 10 | | 2 | Check [ROADMAP.md](ROADMAP.md), mainly "Out of scope". Features listed there are not merged. | |
| 11 | | 3 | Search open pull requests and issues for the same topic. For anything larger than a fix, open an issue first and wait for a yes. | |
| 12 | | 4 | Read the notes under [docs/decisions/](docs/decisions/README.md) for the area you touch. | |
| 13 | |
| 14 | ## AI use |
| 15 | |
| 16 | | Rule | Detail | |
| 17 | |---|---| |
| 18 | | Name the model | Every pull request names the tool and model that wrote the change. It tells the reviewer how closely to look. "None" is a valid answer. | |
| 19 | | Report only what ran | Say what you tested and what you could not run. No "works" without a run. | |
| 20 | | Keep it short | A summary of a few sentences. Long generated descriptions get sent back. | |
| 21 | | No real data | Nothing from a real Teams account in code, tests, logs or screenshots: no names, chats, ids or tokens. Use `--demo`. | |
| 22 | |
| 23 | ## Pull requests |
| 24 | |
| 25 | - One topic per pull request. No unrelated refactors, no formatting of files you did not change. |
| 26 | - The template asks for three things: a summary, the AI model, and a screenshot for UI changes (taken with demo data). |
| 27 | - CI runs the tests on Linux and Windows for every pull request. |
| 28 | - Commit and PR title format: `type(scope): message`, with `type` one of `feat`, `fix`, `perf`, `refactor`, `docs`, `test`, `chore`, `ci`, `build`, a lowercase scope and no emoji. CI checks the PR title. |
| 29 | - The PR title becomes the squash commit and a line in the release notes (`feat` under New, `fix` under Fixes). Write it as a user would read it: `fix(chat): a sent image no longer blinks`, not `fix(chat): handle download race`. |
| 30 | - Rebase on `main` instead of merging it in. Answer actionable review comments or say that you will not. |
| 31 | |
| 32 | ## Build and test |
| 33 | |
| 34 | Build setup and all commands are in the [README](README.md#quick-start), the Windows cross build in [docs/build-windows.md](docs/build-windows.md). |
| 35 | |
| 36 | | Task | Command | |
| 37 | |---|---| |
| 38 | | Run with demo data | `cargo run -p app -- --demo` | |
| 39 | | Format | `cargo fmt` (not `--all`, it rewrites `vendor/`) | |
| 40 | | Tests of the changed module | `cargo test -p <crate> <module>` | |
| 41 | | Layout guard for UI changes | `cargo test -p app layout_guard` | |
| 42 | | Screenshot without a display | `cargo build -p app && scripts/headless-shot.sh shot.png` | |
| 43 | |
| 44 | ## Code |
| 45 | |
| 46 | - Small modules, full variable names (`request_id`, not `rid`). |
| 47 | - Comments only where the code cannot show the reason: ordering, timing, a workaround for outside behaviour. |
| 48 | - Every non-Graph endpoint sits behind its own named module. |
| 49 | |
| 50 | ## UI |
| 51 | |
| 52 | - Divider lines run to both panel edges. |
| 53 | - Paddings are aligned: bottom equals side. |
| 54 | - Soft surfaces, no hard 1 px outlines. |
| 55 | |
| 56 | ## Testing with a real account |
| 57 | |
| 58 | Use your own account or a test tenant and follow the table in [GUARDRAILS.md](GUARDRAILS.md#testing-with-a-real-account). Clean up afterwards. |