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

fix: Check code mark presence instead of any mark in canInsertSuggestion #791

Merged
merged 1 commit into from
May 13, 2024

Conversation

rfgamaral
Copy link
Member

Overview

This PR addresses an issue in the canInsertSuggestion function where it was incorrectly checking for the presence of any mark in the node before the selection, rather than specifically checking for a code mark. The fix ensures that the function now verifies the existence of a code mark before determining if a suggestion can be inserted.

References

PR Checklist

Test plan

  • Open the preview Storybook deployed to Netlify
  • Open the Rich-text → Default story
  • Type **bold** (yes, that's a space character at the end)
  • Type @
    • Observe that the mention suggestions popover is triggered
  • Pick any user from the suggestions popopver
    • Observe that the user was correctly mentioned
  • Clear all the editor content
  • Open an inline code mark with ` and type some text afterwards ending with a space
    • This is similar to the bold example above, but you don't terminate the inline code
  • Type @
    • Observe that the mention suggestions popover is NOT triggered
  • Terminate the inline code mark with another ` and end with a space
  • Type @
    • Observe that the mention suggestions popover is now triggered

@rfgamaral rfgamaral added the 👀 Show PR Used for PRs that need a review, but can be merged when CI is green. label May 13, 2024
@rfgamaral rfgamaral requested a review from a team May 13, 2024 17:07
@rfgamaral rfgamaral self-assigned this May 13, 2024
@rfgamaral rfgamaral requested review from scottlovegrove and removed request for a team May 13, 2024 17:07
Copy link

netlify bot commented May 13, 2024

Deploy Preview for doist-typist ready!

Name Link
🔨 Latest commit 718bc7f
🔍 Latest deploy log https://app.netlify.com/sites/doist-typist/deploys/664248c3226b33000807d4eb
😎 Deploy Preview https://deploy-preview-791--doist-typist.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@rfgamaral rfgamaral enabled auto-merge (squash) May 13, 2024 17:07
@rfgamaral rfgamaral merged commit 2f70959 into main May 13, 2024
9 checks passed
@rfgamaral rfgamaral deleted the ricardo/suggestion-code-mark-validation branch May 13, 2024 17:08
doistbot added a commit that referenced this pull request May 13, 2024
## [6.0.3](v6.0.2...v6.0.3) (2024-05-13)

### Bug Fixes

* Check `code` mark presence instead of any mark in `canInsertSuggestion` ([#791](#791)) ([2f70959](2f70959))
@doistbot
Copy link
Member

🎉 This PR is included in version 6.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@doistbot doistbot added the released Pull requests that have been released to production label May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Pull requests that have been released to production 👀 Show PR Used for PRs that need a review, but can be merged when CI is green.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants