Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -29,6 +39,8 @@ body:
attributes:
label: Laptop / touchpad model
placeholder: "ASUS Vivobook 16"
validations:
required: true
- type: textarea
id: config
attributes:
Expand Down
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -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.
29 changes: 29 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!--
Title: one plain-language changelog line, such as
"Read every finger on touchpads that report several per HID report".
See CONTRIBUTING.md for the full guide.
-->

**What changed**


**Why**


**How I verified it**
<!-- The build you tested and your setup: laptop and touchpad model, Windows version. -->


**Performance**
<!-- Before and after numbers for anything on the gesture path or while idle, or "Not affected" and why. -->


**Not tested**
<!-- What a reviewer should look at, such as other touchpads, Windows 10 or other screens. -->


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.
12 changes: 12 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -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: ["*"]
44 changes: 35 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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<details>`n<summary>Pull requests</summary>`n`n$pulls`n`n</details>`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
14 changes: 9 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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).
90 changes: 90 additions & 0 deletions MAINTAINING.md
Original file line number Diff line number Diff line change
@@ -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.
4 changes: 2 additions & 2 deletions app/src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
});
}
Expand Down
Loading