Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GN-4587: custom gap-cursor plugin #1027

Merged
merged 6 commits into from
Nov 14, 2023
Merged

Conversation

elpoelma
Copy link
Contributor

@elpoelma elpoelma commented Nov 13, 2023

Overview

This PR introduces a custom gap-cursor plugin containing several fixes compared to the original version:

  • The click handler has been replaced by a mousedown handler in order to intercept a click event earlier
  • The types of the GapCursor class have been fixed
  • Addition of a fix when resolving the position returned by view.posAtCoords.
connected issues and PRs:

Solves the gap-cursor part of GN-4587

How to test/reproduce

  • Open-up the dummy app
  • Insert a node with the isolating attribute (like a table) at the start of the document
  • Notice that both in firefox and chromium-based browsers, it is now possible to click before/after the table in order to display a gap-cursor

Challenges/uncertainties

  • This PR introduce an additional function resolvePosition which resolves the position returned by view.posAtCoords. Ideally, this function is not necessary, as it tries to circumvent the issue with wrong positions returned by view.posAtCoords.
  • The fixes included in this PR should normally work in both firefox and chromium-based browsers.

Checks PR readiness

  • UI: works on smaller screen sizes
  • UI: feedback for any loading/error states
  • Check cancel/go-back flows
  • Check database state correct when deleting/updating (especially regarding relationships)
  • changelog
  • npm lint
  • no new deprecations

@elpoelma elpoelma added the enhancement New feature or request label Nov 13, 2023
@abeforgit abeforgit enabled auto-merge November 14, 2023 12:38
@abeforgit abeforgit merged commit 23ee6ec into master Nov 14, 2023
@abeforgit abeforgit deleted the feature/custom-gap-cursor branch November 14, 2023 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants