Skip to content

Commit 9eb1c61

Browse files
authored
feat: tap recognizer with full test infrastructure (#1)
* feat: tap recognizer with full test infrastructure and tooling Core: PointerTracker, BaseRecognizer, Manager, Arbitrator Recognizer: TapRecognizer with convenience API, state machine, threshold/interval Testing: 144 unit tests (vitest), 54 E2E tests (Playwright x3 browsers), Stryker mutation testing at 94.35% Tooling: ESLint strict, Prettier, husky pre-commit, size-limit, GitHub Actions CI, dependabot Docs: VitePress site with Gruvbox theme, interactive demos, API reference, guides * fix: pointer capture, module-level constants, duplicate pointer guard - Manager calls setPointerCapture on pointerdown so recognizers receive move/up/cancel even when the pointer leaves the element bounds - TapRecognizer defaults moved from instance fields to module-level const - PointerTracker.onPointerDown guards against duplicate pointer IDs * fix: docs accuracy and gitignore tmp/ - getting-started.md: RECOGNIZED → Recognized (matches enum value) - tap.md: Failed→Idle reset is deferred to pointerup/cancel, not automatic - .gitignore: add tmp/ * chore: add CODEOWNERS requiring @akoreh approval
1 parent 532cef0 commit 9eb1c61

72 files changed

Lines changed: 13228 additions & 1888 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @akoreh
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Bug Report
3+
about: Something isn't working as expected
4+
labels: bug
5+
---
6+
7+
## Description
8+
9+
A clear description of the bug.
10+
11+
## Steps to Reproduce
12+
13+
1.
14+
2.
15+
3.
16+
17+
## Expected Behavior
18+
19+
What should happen.
20+
21+
## Actual Behavior
22+
23+
What happens instead.
24+
25+
## Environment
26+
27+
- **Browser:** (e.g., Chrome 130, Safari 18)
28+
- **Device:** (e.g., desktop, iPhone 16, Android touch)
29+
- **fngr version:**
30+
- **OS:**
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Feature Request
3+
about: Suggest a new gesture, option, or improvement
4+
labels: enhancement
5+
---
6+
7+
## Description
8+
9+
What you'd like to see added or changed.
10+
11+
## Use Case
12+
13+
Why this would be useful — what problem does it solve?
14+
15+
## Proposed API (optional)
16+
17+
How you imagine the API would look:
18+
19+
```ts
20+
// example usage
21+
```

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
groups:
8+
eslint:
9+
patterns: ["eslint*", "@eslint/*", "typescript-eslint"]
10+
testing:
11+
patterns: ["vitest", "@playwright/*", "@stryker-mutator/*"]
12+
build:
13+
patterns: ["tsup", "typescript", "vite", "vitepress"]

.github/pull_request_template.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## What
2+
3+
Brief description of the change.
4+
5+
## Why
6+
7+
Motivation — what problem does this solve?
8+
9+
## Checklist
10+
11+
- [ ] Tests added/updated
12+
- [ ] `npm run lint` passes
13+
- [ ] `npm run format:check` passes
14+
- [ ] `npm run build` succeeds
15+
- [ ] `npm run size` within budget

.github/workflows/ci.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: 22
17+
cache: npm
18+
- run: npm ci
19+
- run: npm run format:check
20+
- run: npm run lint
21+
22+
typecheck:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: actions/setup-node@v4
27+
with:
28+
node-version: 22
29+
cache: npm
30+
- run: npm ci
31+
- run: npx tsc --noEmit
32+
33+
test:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
- uses: actions/setup-node@v4
38+
with:
39+
node-version: 22
40+
cache: npm
41+
- run: npm ci
42+
- run: npm run test
43+
44+
build:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v4
48+
- uses: actions/setup-node@v4
49+
with:
50+
node-version: 22
51+
cache: npm
52+
- run: npm ci
53+
- run: npm run build
54+
- run: npm run size
55+
56+
e2e:
57+
runs-on: ubuntu-latest
58+
steps:
59+
- uses: actions/checkout@v4
60+
- uses: actions/setup-node@v4
61+
with:
62+
node-version: 22
63+
cache: npm
64+
- run: npm ci
65+
- run: npx playwright install --with-deps
66+
- run: npm run test:e2e

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
docs/
22
node_modules/
33
dist/
4+
CLAUDE.md
5+
.DS_Store
6+
test-results/
7+
playwright-report/
8+
.superpowers/
9+
docs-site/.vitepress/dist/
10+
docs-site/.vitepress/cache/
11+
reports/
12+
.stryker-tmp/
13+
tmp/

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx lint-staged

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
dist/
2+
node_modules/
3+
docs-site/.vitepress/dist/
4+
docs-site/.vitepress/cache/
5+
package-lock.json

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all",
4+
"printWidth": 100,
5+
"tabWidth": 2
6+
}

0 commit comments

Comments
 (0)