Skip to content

Harden mouse input routing contracts with deterministic coverage#69

Merged
RtlZeroMemory merged 8 commits into
mainfrom
mouse-input-hardening
Feb 18, 2026
Merged

Harden mouse input routing contracts with deterministic coverage#69
RtlZeroMemory merged 8 commits into
mainfrom
mouse-input-hardening

Conversation

@RtlZeroMemory

Copy link
Copy Markdown
Owner

Summary

  • audited mouse click, wheel, drag, and mixed input routing paths across router, focus, split pane, keybinding, and hit-testing integrations
  • fixed a mixed-input bug where active keybinding chords were not cleared on mouse click (mouseKind down/up)
  • added deterministic mouse hardening suites:
    • packages/core/src/runtime/__tests__/mouse.click.test.ts (23 tests)
    • packages/core/src/runtime/__tests__/mouse.scroll.test.ts (13 tests)
    • packages/core/src/runtime/__tests__/mouse.drag.test.ts (16 tests)
    • packages/core/src/runtime/__tests__/mouse.mixed.test.ts (14 tests)
  • added app-level regression coverage for chord reset on click in packages/core/src/keybindings/__tests__/keybinding.conflicts.test.ts
  • documented mouse invariants and mixed input behavior in:
    • docs/guide/mouse-support.md
    • docs/guide/input-and-focus.md

Why

This hardening pass pins existing mouse contracts (no feature expansion) and closes routing/test gaps so regressions in click activation, scroll clamping/routing, split-pane drag constraints, hit-testing precedence, and mouse+keyboard interaction are caught deterministically.

Validation

  • npm run build
  • npm run typecheck
  • npm run lint
  • node scripts/run-tests.mjs

All commands pass locally.

  • Full test suite: 2254 passed, 0 failed.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1197ed9331

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/core/src/app/createApp.ts Outdated
if (keybindingsEnabled) {
if (
ev.kind === "mouse" &&
(ev.mouseKind === 3 || ev.mouseKind === 4) &&

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reset pending chord only on mouse-down

Including mouseKind === 4 here can cancel a chord that started after the click began: if a user presses and holds mouse, types the first key of a multi-key binding, then releases mouse, this branch clears pendingKeys on mouse-up and the next key no longer matches. The fix for stale pre-click chords only needs to clear on down (or otherwise distinguish up events that belong to a click that happened before the chord started).

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in cb49e31.

Changes:

  • Reset pending chord state only on mouseKind === 3 (mouse-down) in createApp.
  • Added regression test mouse up does not clear chord started after mouse down in packages/core/src/keybindings/__tests__/keybinding.conflicts.test.ts.

Validation:

  • npm -w @rezi-ui/core run build
  • node --test --test-concurrency=1 packages/core/dist/keybindings/__tests__/keybinding.conflicts.test.js
  • npm run lint

All pass.

@RtlZeroMemory
RtlZeroMemory merged commit 5a83d15 into main Feb 18, 2026
16 of 17 checks passed
@RtlZeroMemory
RtlZeroMemory deleted the mouse-input-hardening branch February 19, 2026 17:45
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