Skip to content

feat(typing): adaptive key geometry - learns where you tap (opt-in)#107

Open
SHAWNERZZ wants to merge 1 commit into
AsafMah:devfrom
SHAWNERZZ:pr/adaptive-typing
Open

feat(typing): adaptive key geometry - learns where you tap (opt-in)#107
SHAWNERZZ wants to merge 1 commit into
AsafMah:devfrom
SHAWNERZZ:pr/adaptive-typing

Conversation

@SHAWNERZZ

Copy link
Copy Markdown

What this adds

Opt-in (off by default) adaptive key geometry: the keyboard learns where you actually land on each key and shifts its invisible hit-targets to match, so consistently off-center taps still register as the key you meant. Two independently-toggleable parts that share one strength slider:

  • Learned behavior — your personal per-key landing pattern, built from both taps and swipe endpoints.
  • Next-character prediction — leans tap recognition toward the letters likely to come next given the current word / suggestions.

A stats screen shows a heat-map of your learned model; an optional debug overlay visualizes the targets on the live keyboard.

Safety / non-invasiveness

  • Off by default, content-free (only aggregate touch geometry — no characters or words are stored), incognito-gated, kept on-device in the existing leantype.db.
  • The learned shift is capped (≤25% of the key, measured on the hit-box basis) so a clearly-on-key press can never flip to a neighbor; it ramps in with sample count; and a neighbor can only win a genuinely near-boundary tap (it must contain the touch, or be no farther than the pressed key).
  • Reset is reliable — "forget my model" serializes with pending writes, so a queued sample can't resurrect deleted data.
  • Lookups are O(1) from an in-memory cache; no DB work on the input hot path.

Recency window

A selectable time-decay "forget window" (1–12 months, default 3): learned geometry fades by a wall-clock half-life, so the model tracks recent typing rather than an unbounded all-time average. No schema change (reuses the existing updatedAt). The decay and cap math are unit-tested.

Notes

  • Settings live under a grouped Adaptive typing section, shown only when enabled.
  • Targets dev per CONTRIBUTING. Compiles standalone on dev; TouchModelManagerTest passes.

…cency window

Opt-in (off by default), content-free, incognito-gated. The keyboard learns each
user per-key landing offsets and biases tap resolution and gesture sweet-spots
toward where they actually type. Two independently-toggleable halves that share a
strength slider: learned per-key geometry, and a next-key context prior from the
suggestion strip. A stats screen shows a heat-map of the learned model.

Safety: the bias is capped (a clear on-key press can never flip to a neighbor),
ramps in with sample count, and is gated so a neighbor can only win a near-boundary
tap. Reset is reliable (delete serialized with writes). A selectable time-decay
forget window (1-12 months, default 3) fades stale geometry so the model tracks
recent typing - no schema change (reuses updatedAt). Unit-tested decay/cap math.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant