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
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: SumirSeth
10 changes: 4 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
*.exe
# Research scratch: downloaded Microsoft PDBs and screenshots of the user's desktop
trackpad/research/scratch-*/

/target/
*.log
*.exe

# Local prototype leftovers (removed from the repo; see history before ef4e728)
trackpad/
# Local research and prototype files, kept out of the repository
/trackpad/
128 changes: 99 additions & 29 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,117 @@
# Contributing to Touch

Thanks for helping! Touch is a small project, so the process is light.
Thanks for helping. Bug reports, fixes, gesture ideas and features are all welcome.

## Reporting bugs
Every change on `main` should be easy to trace: what changed, why, who owns it, how it was checked and which release
shipped it. The rules below serve that. They apply to everyone, the maintainer included.

Open an [issue](https://github.com/SumirSeth/touch/issues/new/choose) with:
## Building, not just coding

- your Windows version (`winver`) and laptop / touchpad model
- 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
> Building something has never been about writing code. When I say I built it, it means I have put effort, thought
> and intention behind every single thing, and got Claude to write the code because it writes better code than almost
> all humans do.
>
> — Sumir Seth, maintainer

Touchpads report fingers differently from one model to another, so the hardware details matter.
Touch is built in that spirit. A good change starts with a reason: a bug you hit, a gesture that felt wrong, an idea
you thought through. The code serves that intention.

## Suggesting gestures or actions
## AI agents

Open a feature request and describe the motion and what it should do. Gestures must not get in the way of normal
pointing, scrolling and clicking. Proposals that explain how a gesture is told apart from ordinary use are the
easiest to accept.
AI agents are welcome. Use them as code writers, tinkerers and partners for ideas. Much of Touch is written this way.

## Pull requests
**You own what you submit.** The person who opens a pull request or makes a commit owns that change, whoever or
whatever typed it. Be ready to explain it, defend it and fix it.

- **Understand every line.** If you can't explain why a line is there, it isn't ready.
- **Verify it.** Test a build with your change on a real touchpad, and write tests where they fit.
- **Think it through.** Touchpads differ, so consider other sizes and reporting modes, Windows' own 3- and 4-finger
gestures, and normal pointing, scrolling and clicking, which must never get worse.

Changes made end to end by an agent with no verifiable check, no real testing and no deliberate thought behind them
are closed.

## Before you start

- **Bugs:** search the issues first. If it's new, open a bug report with your Windows version, your laptop and
touchpad model, and the steps to reproduce it.
- **Features:** open a feature request first, and agree on the idea before you write code. Touch aims to be a small,
fast gesture tool. A new gesture has to be told apart from ordinary pointing, scrolling and clicking, so explain how.

## Branches

- Fork the repository and branch from `main`. Everyone works on branches; nobody pushes to `main`.
- Name the branch after the change: `fix/…`, `feat/…`, `docs/…` or `perf/…`.
- Keep it short-lived and rebased on `main`. Rebase rather than merging `main` into it.

## Commits

- **Summary line:** imperative, plain language, about 50 to 72 characters, written for users. "Read every finger on
touchpads that report several at once", not "fix bug" or "update platform.rs".
- **Body:** why the change is needed and anything surprising about it. The diff already shows what changed.
- **One logical change per commit.** Squash fixups such as "fix typo" or "address review" before the pull request is
merged.
- **Honest authorship.** The author is the person who owns the change. Credit an AI that helped with a
`Co-Authored-By:` line.

## Testing your change

1. Quit the installed Touch from the tray. Only one copy runs at a time, and a second launch only opens the first
one's settings.
2. Run your build with `cargo run -p touch`, or `cargo run -p touch --release`. Debug builds keep a console for logs.
To watch the engine alone, run `cargo run -p gestures_engine --example run`. It uses your saved bindings and **does
send keys**.
3. Try the change on your touchpad, including the edge cases above. Check that pointing, scrolling and clicking still
feel the same.
4. Gesture recognisers in `crates/engine/src/gestures.rs` are pure: frames in, events out. Add tests in
`crates/engine/tests/` that feed synthetic frames for new or changed gestures.
5. Run the checks CI runs:

1. Fork, create a branch, and keep the change focused.
2. Make sure these pass (CI runs the same):
```powershell
cargo fmt --check
cargo clippy --workspace -- -D warnings
cargo test --workspace
cargo clippy --workspace --locked -- -D warnings
cargo test --workspace --locked
```
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. 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).
## Performance

Touch runs all day on the input path, so a change must not make it slower or heavier. For anything in the engine, the
tray agent or startup, compare `main` with your branch on the same machine:

- **Idle:** with the settings window closed, `touch.exe` should use no CPU and about 13 MB of memory. Check with Task
Manager or `Get-Process touch | Select-Object CPU, WorkingSet64` over a minute.
- **During gestures:** no allocation or blocking work per touchpad report. Actions run on the worker thread, not the
input thread.
- **Settings window:** it should open quickly, and the agent must stay unaffected while it's open.

A regression needs a reason worth its cost; look for another way first.

## Pull requests

Every change reaches `main` through a pull request. The template asks for the following:

- **One change** per pull request.
- **A title that reads as a changelog line**, in plain language. Release notes list pull requests by title.
- **What changed, why, and how you verified it.** Name the build you tested and your setup: laptop and touchpad model,
and Windows version. Include before and after numbers for anything that could affect speed or memory.
- **What you didn't test**, so the reviewer knows where to look.
- **The issue it fixes**, as `Fixes #123`.
- **A changelog entry** under `Unreleased` in [CHANGELOG.md](CHANGELOG.md) for anything users notice. End it with the
pull request, your username and the issue it fixes, such as `(#34, by @you, fixes #33)`. The pull request number
exists only once it's open, so add it in a follow-up commit. Internal changes get the `skip-changelog` label
instead.
- **Screenshots** in light and dark themes for changes to the settings window.

A pull request merges once CI passes and a build with the change has been tested on a real touchpad. See
[MAINTAINING.md](MAINTAINING.md) for how pull requests are reviewed and released. Design notes are in
[`docs/app-spec.md`](docs/app-spec.md); keep it in sync when you change the engine API or the config format.

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.
## Writing style

## Releases
Write code comments, docs, commit messages and UI text in plain, active language. Use short sentences. Name what the
user sees and does. For example, write "The row lights up when you perform the gesture", not "Trigger events
propagate a highlight state".

How pull requests are reviewed and how releases are cut is in [MAINTAINING.md](MAINTAINING.md).
## License

By contributing you agree that your work is licensed under the [MIT License](LICENSE).
By contributing, you agree that your contributions are licensed under the [MIT License](LICENSE).
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ exclude = ["app/vendor/gpui"]
version = "0.1.0"
edition = "2021"
license = "MIT"
authors = ["Sumir Seth"]
repository = "https://github.com/SumirSeth/touch"
homepage = "https://github.com/SumirSeth/touch"

[profile.release]
opt-level = 3
Expand Down
Loading
Loading