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: Adding back enter key extension with mentions #3499

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

Palanikannan1437
Copy link
Collaborator

@Palanikannan1437 Palanikannan1437 commented Jan 29, 2024

Description

Added back the enter key extension at #2530, but this time working with Mentions

  1. Comment Editor's Features
    The enter key is now remapped to submit the comment, while the 'shift-enter' key is mapped to the default enter key behavior. The edge cases for the various data structures/scenarios present in the comment editor have been handled as follows:

    1. Code Blocks: When the cursor is inside a code block, "Shift-Enter" inserts a newline character at the current cursor position, creating a new line within the code block.
    2. List Items: When the cursor is inside a list item, "Shift-Enter" will split the list item at the current cursor position, creating a new list item below the current one.
      End of Blocks: When the cursor is at the end of a block, "Shift-Enter" creates a new paragraph below the current block.
    3. Empty Blocks: When the cursor is inside an empty block that can be lifted, pressing "Shift-Enter" will lift the block out of its parent node.
    4. General Case: In all other cases, pressing "Shift-Enter" will split the block at the current cursor position, creating a new block below the current one.

    Here's a sleek demo video showcasing these changes (note I'm using Shift + Enter here as Enter key defaults to Submitting the comment itself)

Export-1698477557840.mp4
  1. Fixed mentions to play along with Comment editor's enter extension
    The enter extension works properly now with mentions as we're keeping track of whether the mentions menu is open or not via a custom storage object in the extension and then using that modify the enter key extensions's behaviour.
Screen.Recording.2024-01-31.at.6.27.22.PM.mov

@Palanikannan1437 Palanikannan1437 self-assigned this Jan 29, 2024
@Palanikannan1437 Palanikannan1437 marked this pull request as ready for review January 31, 2024 12:34
@sriramveeraghanta sriramveeraghanta merged commit 70172f8 into develop Jan 31, 2024
6 of 8 checks passed
@sriramveeraghanta sriramveeraghanta deleted the fix/enter-key-extension branch January 31, 2024 12:36
@Palanikannan1437 Palanikannan1437 added this to the v0.15-dev milestone Jan 31, 2024
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.

2 participants