Skip to content

Stylus editing 448 - #518

Merged
mudabs merged 7 commits into
oss-slu:mainfrom
Subomiadekunle:stylus-editing-448
Nov 18, 2026
Merged

mudabs merged 7 commits into
oss-slu:mainfrom
Subomiadekunle:stylus-editing-448

Conversation

@Subomiadekunle

@Subomiadekunle Subomiadekunle commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Closes #448.

Builds on the merged pointer and touch editing work from #446 and #447.

Thank you @Subomiadekunle for the stylus editing work.

Included Changes

  • Supports pen selection, movement, resizing, cropping, and drawing.
  • Rejects palm input while another pointer is editing.
  • Prevents pen and touch long-press context menus.
  • Preserves mouse right-click behavior.
  • Ignores pen eraser and barrel-button input.
  • Uses a 2px drag threshold for pen input.
  • Preserves the 8px touch threshold.
  • Supports responsive handle sizing, overlapping objects, and hybrid devices.
  • Adds automated coverage for mouse, touch, pen, context-menu, and multi-pointer behavior.

Validation

  • npm run lint
  • git diff --check
  • npm test -- --runInBand

No physical stylus was available, so pen behavior was validated through automated pointer-event tests.

Review Status

Changes requested before approval:

  • Suppress rejected-pointer compatibility clicks even when the click event has no pointerId.
  • Confirm the next legitimate click still selects normally.
  • Remove expired ignoredPointers entries so rejected-pointer state cannot accumulate.
  • Keep pointerup and pointercancel cleanup isolated per pointer.

After these updates, rerun the validation commands and request another review.

@mudabs mudabs left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you @Subomiadekunle for the stylus editing updates. The added coverage for pointer, touch, and pen interactions is helpful, and the automated tests are passing. Please address the following items:

  • Update the branch with current main
    • Keep the already merged pointer-event changes from PR #516.
    • Preserve the touch changes from PR #517 and the stylus-specific changes from this PR.
  • Correct the CSS block structure in templates/style.css
    • .scene-canvas is opened around lines 2966 and 2969.
    • The first block is not closed before the second one begins.
    • The extra closing brace near line 3007 causes the touch selectors and @media block to be scoped incorrectly.
    • Combine the declarations into one .scene-canvas block and remove the extra brace.
    • This is important because the touch-action, selected-element, handle, and stylus interaction rules may not apply to the intended elements.
  • Remove trailing whitespace in templates/js/scenes.js
    • Clean up the whitespace around line 2368 so git diff --check passes.
  • Run the validation again
    • npm run lint
    • git diff --check
    • npm test -- --runInBand
      After updating the branch and correcting these issues, the PR should be ready for another review. Thank you for the thoughtful coverage of the different input types.

@Subomiadekunle Subomiadekunle mentioned this pull request Nov 3, 2026
@Subomiadekunle

Copy link
Copy Markdown
Collaborator Author

Thanks @mudabs, addressed:

Rebased onto the updated #517 branch, which is rebased on current main. The #446 commit is dropped, and the diff still includes the #447 commit until #517 merges.
The .scene-canvas CSS fix comes from #517: one closed block, with the touch rules and @media at the top level.
Removed the trailing whitespace in templates/js/scenes.js.

Lint, git diff --check upstream/main...HEAD, and npm test -- --runInBand all pass (22 suites, 874 passed, 5 skipped).

@mudabs mudabs left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Changes requested. Please address the detailed review items in the PR description, then request another review.

- Remember the pointer type for contextmenu only while a press is held, so
  keyboard-opened context menus are no longer suppressed after touch/pen input.
- Ignore the click from a secondary pointer whose press was rejected, even
  when it arrives after the primary pen drag ends.
- Carry forward the PR 517 touch fixes: responsive touch-target scale,
  touch-action for objects overlapping the selection, any-pointer: coarse.
- Add regression tests.
Dispatch the pen drag's own click first so the later touch click is not
swallowed by the drag's click suppression.

@mudabs mudabs left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Changes requested. Please address the detailed rereview items in the PR description, then request another review.

# Conflicts:
#	templates/tests/sceneAnnotationEditor.test.js
…s-slu#448)

- Keep held pointers in a Map keyed by pointerId so a rejected palm can't
  overwrite or clear a held pen; pointerless context menus are blocked only
  while a touch or pen is actually down.
- Track rejected pointers per pointerId with a release flag and a short
  window instead of a global pending count; pointercancel, the next accepted
  press, or an unrelated click can't leave a stale suppression behind.
- Add regression tests.

@mudabs mudabs left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Changes requested. Please address the detailed final rereview items in the PR description, then request another review.

@mudabs
mudabs force-pushed the stylus-editing-448 branch from 602651f to 342a990 Compare November 18, 2026 05:07
…tate (oss-slu#448)

- Cancel the browser's compatibility mouse events when a pointer is rejected.
- Match a rejected pointer's click that carries no pointerId by where it
  lands, within a one-second window, and use it up after one click.
- Give each rejected pointer its own cleanup timer after release, and drop
  it on pointercancel, on its click, or at the next accepted press, so the
  map can't grow or leave suppression behind.
- Add regression tests.
@sonarqubecloud

Copy link
Copy Markdown

@mudabs mudabs left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Verified:

  • 22 test suites passed
  • 889 tests passed, 5 skipped
  • ESLint passed
  • git diff --check passed
  • CI, SBOM, and SonarCloud passed
  • GitHub reports the branch as mergeable
  • Pointerless click suppression and cleanup fixes are included

@mudabs
mudabs merged commit 7ae6138 into oss-slu:main Nov 18, 2026
3 checks passed
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.

[Small Rock] Support Stylus Editing

2 participants