From bb3137b9bacbbb77ab5a6af73a01cb8b737a28d4 Mon Sep 17 00:00:00 2001 From: Sumir Seth Date: Mon, 30 Nov 2026 17:39:52 +0530 Subject: [PATCH] Set up maintenance: MAINTAINING.md, PR template, release notes from the changelog Adopts the process used for Wisp: a pull request template, labelled release notes, a required reproduction step in bug reports, and a release workflow that tests, publishes directly and takes its notes from CHANGELOG.md. Also fixes the clippy needless_range_loop error that fails CI on current stable Rust. Co-Authored-By: Claude Opus 5.5 --- .github/ISSUE_TEMPLATE/bug_report.yml | 12 ++++ .github/ISSUE_TEMPLATE/config.yml | 5 ++ .github/pull_request_template.md | 29 +++++++++ .github/release.yml | 12 ++++ .github/workflows/release.yml | 44 ++++++++++--- CONTRIBUTING.md | 14 +++-- MAINTAINING.md | 90 +++++++++++++++++++++++++++ app/src/ui.rs | 4 +- 8 files changed, 194 insertions(+), 16 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/pull_request_template.md create mode 100644 .github/release.yml create mode 100644 MAINTAINING.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 88257a4..257fef5 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -9,6 +9,16 @@ body: description: What you did, what you expected, and what happened instead. validations: required: true + - type: textarea + id: steps + attributes: + label: Steps to reproduce + placeholder: | + 1. Bind a 3-finger swipe up to Task view. + 2. Swipe up with three fingers. + 3. ... + validations: + required: true - type: input id: version attributes: @@ -29,6 +39,8 @@ body: attributes: label: Laptop / touchpad model placeholder: "ASUS Vivobook 16" + validations: + required: true - type: textarea id: config attributes: diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..03d9a3c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Questions and ideas + url: https://github.com/SumirSeth/touch/discussions + about: Ask how to set something up, or float an idea before filing it. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..c891a1f --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,29 @@ + + +**What changed** + + +**Why** + + +**How I verified it** + + + +**Performance** + + + +**Not tested** + + + +Fixes # + +- [ ] I understand every line of this change and tested a build of it on a real touchpad. +- [ ] `cargo fmt --check`, `cargo clippy --workspace -- -D warnings` and `cargo test --workspace` pass. +- [ ] CHANGELOG.md has an entry under `Unreleased`, or this has nothing users notice. diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..935efc8 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,12 @@ +# Groups the pull request list that the release workflow adds under the +# notes from CHANGELOG.md. +changelog: + exclude: + labels: [release, skip-changelog] + categories: + - title: New + labels: [enhancement] + - title: Fixes + labels: [bug] + - title: Under the hood + labels: ["*"] diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b0537d2..b0691ae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,16 +11,42 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 + - run: cargo test --workspace --locked - run: powershell -ExecutionPolicy Bypass -File app/scripts/package.ps1 + - name: Collect + shell: pwsh + run: | + New-Item -ItemType Directory dist | Out-Null + Get-ChildItem target/installers -Recurse -Include *.exe, *.msi | Copy-Item -Destination dist + Push-Location dist + Get-ChildItem | ForEach-Object { "$((Get-FileHash $_ -Algorithm SHA256).Hash.ToLower()) $($_.Name)" } | + Out-File -Encoding ascii SHA256SUMS.txt + Pop-Location - uses: actions/upload-artifact@v4 with: name: windows-installers - path: | - target/installers/**/*.exe - target/installers/**/*.msi - - uses: softprops/action-gh-release@v2 - with: - draft: true - files: | - target/installers/**/*.exe - target/installers/**/*.msi + path: dist/* + # The notes are the version's CHANGELOG.md section, then the pull requests GitHub lists for + # the release (.github/release.yml). + - name: Notes + env: + GH_TOKEN: ${{ github.token }} + shell: pwsh + run: | + $version = "${{ github.ref_name }}".TrimStart('v') + $section = [regex]::Match((Get-Content CHANGELOG.md -Raw), + "(?ms)^## \[?$([regex]::Escape($version))\]?[^\n]*\n(.*?)(?=^## |^\[|\z)").Groups[1].Value.Trim() + if (-not $section) { throw "CHANGELOG.md has no section for $version" } + $pulls = gh api "repos/${{ github.repository }}/releases/generate-notes" ` + -f tag_name="${{ github.ref_name }}" --jq .body + $pulls = $pulls -join "`n" + $download = '**Download `touch_' + $version + '_x64-setup.exe`** and run it. The `.msi` is for managed installs.' + "$download`n`n$section`n`n
`nPull requests`n`n$pulls`n`n
`n" | + Out-File -Encoding utf8 notes.md + - name: Publish + env: + GH_TOKEN: ${{ github.token }} + shell: pwsh + run: | + gh release create "${{ github.ref_name }}" (Get-ChildItem dist).FullName ` + --title "Touch ${{ github.ref_name }}" --notes-file notes.md --verify-tag diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index db5b7a3..928b5a5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,7 +7,7 @@ Thanks for helping! Touch is a small project, so the process is light. Open an [issue](https://github.com/SumirSeth/touch/issues/new/choose) with: - your Windows version (`winver`) and laptop / touchpad model -- what you did, what you expected and what happened +- what you did, what you expected and what happened, and the steps to make it happen again - your `%APPDATA%\Touch\config.json` if the bug involves a specific binding Touchpads report fingers differently from one model to another, so the hardware details matter. @@ -29,15 +29,19 @@ easiest to accept. ``` 3. Gesture recognisers in `crates/engine/src/gestures.rs` are pure (frames in, events out). Please add tests in `crates/engine/tests/` that feed synthetic frames for new or changed gestures. -4. Try the change on a real touchpad if you can, and say which one in the PR. -5. For UI changes, include a screenshot in light and dark themes. +4. Test a build of the change on a real touchpad and say which one in the PR. Fill in the pull request template: + what changed, why, how you verified it, and what you didn't test. +5. Add a line under `Unreleased` in [CHANGELOG.md](CHANGELOG.md) for anything users notice. +6. For UI changes, include a screenshot in light and dark themes. + +Pull requests are merged with rebase, so keep each commit message meaningful. Questions and ideas that aren't ready +to be an issue go in [Discussions](https://github.com/SumirSeth/touch/discussions). Design notes are in [`docs/app-spec.md`](docs/app-spec.md). The engine API in that document is what the app depends on. Keep the two in sync when you change either. ## Releases -Maintainers bump the version in the workspace `Cargo.toml`, update `CHANGELOG.md`, and push a `vX.Y.Z` tag. The -release workflow builds the installers into a draft GitHub release, which is published after a quick check. +How pull requests are reviewed and how releases are cut is in [MAINTAINING.md](MAINTAINING.md). By contributing you agree that your work is licensed under the [MIT License](LICENSE). diff --git a/MAINTAINING.md b/MAINTAINING.md new file mode 100644 index 0000000..a2e9fe2 --- /dev/null +++ b/MAINTAINING.md @@ -0,0 +1,90 @@ +# Maintaining Touch + +How Touch's pull requests, issues and releases are handled. Contributors follow [CONTRIBUTING.md](CONTRIBUTING.md); +this file covers what happens after. + +## Reviewing pull requests + +- **Read the diff before you approve CI** for a first-time contributor. GitHub holds their workflows until a + maintainer approves them. +- **CI must pass.** Nothing merges with a failing or missing check. +- **A build with the change must be tested on a real touchpad** before merging. The author's test counts if the pull + request names the build, the laptop and touchpad model, and the Windows version. Otherwise, test it yourself. + Touchpads report fingers differently from one model to another, so engine changes need a test on the maintainer's + touchpad too, to make sure nothing regressed there. +- **Check the template is filled in:** why, how it was verified, what wasn't tested, `Fixes #`, and a changelog + entry or the `skip-changelog` label. +- **Check the changelog entry's reference** before merging: the pull request number, `by @author` for contributors, + and `fixes #` for the issue, as in `(#1, by @someone, fixes #2)`. Add or correct it yourself if it's missing. +- **Ask for changes rather than making them.** Ask the author to rebase or fix things. For small fixes, you may push + your own commit to their branch, without rewriting theirs. + +## Merging + +- **Rebase and merge only**, so history stays linear and every commit message survives. +- Delete the branch after merging. +- Close the linked issue through `Fixes #` in the pull request. + +## Issues + +- Every bug needs steps to reproduce it, a Windows version and the laptop or touchpad model. Label it `needs-repro` + until it has them. +- Close every issue with a reason: fixed by a pull request, won't fix, or duplicate. +- Ideas outside Touch's scope stay open with `scope: undecided` until they are planned or declined. + +### Labels + +| Label | For | +| --- | --- | +| `bug` | Something broken | +| `enhancement` | A new feature or an improvement | +| `performance` | Speed, memory or CPU | +| `hardware` | Specific to some touchpads or laptops | +| `documentation` | Docs only | +| `needs-repro` | A bug without steps to reproduce it yet | +| `good first issue` | Small and well understood | +| `scope: undecided` | A good idea that may not belong in Touch | +| `release` | A version bump; left out of release notes | +| `skip-changelog` | Nothing users notice; left out of release notes | + +Release notes group pull requests by these labels ([`.github/release.yml`](.github/release.yml)). + +## Releases + +Touch uses [semantic versioning](https://semver.org). While the version is 0.x: + +- **Patch** (0.1.1) for fixes only. +- **Minor** (0.2.0) for new gestures, actions or changed behavior. +- **1.0** once the config format and behavior are stable. + +To release: + +1. Open a release pull request that renames the `Unreleased` section of [CHANGELOG.md](CHANGELOG.md) to the version + and date, adds a new empty `Unreleased` section, and bumps `version` in the workspace `Cargo.toml`. Label it + `release`. +2. Merge it once CI passes. +3. Tag the merged commit on `main` and push the tag: + + ```sh + git tag -a v0.2.0 -m "Touch v0.2.0" + git push origin v0.2.0 + ``` + +4. The release workflow tests, builds and publishes the release. Its notes are the version's changelog section, + followed by the pull requests. + +Never move or delete a published tag. If a release is broken, ship a patch release. + +## Repository settings + +Rulesets enforce these rules, and the maintainer may bypass them in an emergency: + +- **`main`:** changes only through pull requests, CI must pass, no force pushes, no deletion. +- **`v*` tags:** no updates and no deletion. + +Watch the repository (**Watch → All Activity**) so new issues and pull requests send notifications. + +## Housekeeping + +- Delete merged branches. +- Close stale pull requests after asking the author. diff --git a/app/src/ui.rs b/app/src/ui.rs index cfae056..dc3fc57 100644 --- a/app/src/ui.rs +++ b/app/src/ui.rs @@ -178,8 +178,8 @@ impl Settings { } => vec![increase, decrease], _ => vec![], }; - for i in 0..3 { - self.fields[i].update(cx, |s, cx| { + for (i, field) in self.fields.iter().enumerate() { + field.update(cx, |s, cx| { s.set_value(vals.get(i).cloned().unwrap_or_default(), w, cx) }); }