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

Typing/Enter/Backspace should insert a paragraph if the magic block button was active #6694

Closed
oleq opened this issue Apr 28, 2020 · 2 comments · Fixed by #7387
Closed

Typing/Enter/Backspace should insert a paragraph if the magic block button was active #6694

oleq opened this issue Apr 28, 2020 · 2 comments · Fixed by #7387
Assignees
Labels
domain:ui/ux This issue reports a problem related to UI or UX. package:widget squad:magic type:feature This issue reports a feature request (an idea for a new functionality or a missing option).

Comments

@oleq
Copy link
Member

oleq commented Apr 28, 2020

This should only happen when the block is already active, for instance, when a user activates it using the keyboard.

The paragraph would land in the model and be broadcasted to collaboration, track changes, etc.

P.S. Let's not forget about scrolling the viewport when the paragraph is inserted.


A piece of #407.

@oleq oleq added the domain:ui/ux This issue reports a problem related to UI or UX. label Apr 28, 2020
@oleq oleq added this to the iteration 32 milestone Apr 28, 2020
@Reinmar Reinmar added package:magic-block type:feature This issue reports a feature request (an idea for a new functionality or a missing option). labels May 1, 2020
@oleq oleq changed the title Typing/Enter/Backspace should replace the active magic block with a paragraph Typing/Enter/Backspace should insert a paragraph if the magic block button was active May 5, 2020
@Reinmar Reinmar removed this from the iteration 32 milestone May 6, 2020
@Reinmar Reinmar added this to the nice-to-have milestone May 11, 2020
@Reinmar
Copy link
Member

Reinmar commented May 12, 2020

Let's work on the typing at the end so if it turns out to be tricky, let's extract it to a separate ticket.

@Reinmar Reinmar modified the milestones: nice-to-have, iteration 32 May 13, 2020
@oleq oleq self-assigned this May 15, 2020
@Reinmar Reinmar modified the milestones: iteration 32, next, iteration 33 May 19, 2020
@oleq
Copy link
Member Author

oleq commented May 28, 2020

An idea: Consider bringing back the old Enter and Shift+Enter behavior. Even though we plan to use enter to navigate inside widgets, until we really implement this, we shouldn't change the existing behavior.

niegowski added a commit that referenced this issue Jun 10, 2020
Fix (engine): The model selection post-fixer should not set a new selection if the ranges before and after post-fixing are the same (see #6693).

Tests (image): Aligned image tests to the latest `WidgetTypeAround` plugin API (see #6693).

Other (paragraph): The `InsertParagraphCommand` should split ancestors of the `Position` to find a parent that allows `'paragraph'` (see #6693).

Tests (table): Aligned `Table` plugin tests to the latest `WidgetTypeAround` API. Code refactoring (see #6693).

Feature (theme-lark): Added styles for a "fake caret" brought by the `WidgetTypeAround` plugin (see #6693).

Feature (typing): Created a public `isNonTypingKeystroke()` helper (see #6693).

Feature (utils): Created `isArrowKeyCode()`, `getLocalizedArrowKeyCodeDirection()`, and `isForwardArrowKeyCode()` helpers (see #6693).

Feature (widget): Implemented keyboard support for inserting paragraphs around block widgets using a "fake horizontal caret" (`WidgetTypeAround`). Both "Insert new paragraph" buttons are now always displayed for all block widgets regardless of their location in the document. Closes #6693. Closes #6825. Closes #6694.

Also:

*   code refactoring in the `Widget` plugin,
*   aligned `Widget` tests to the new `WidgetTypeAround` keyboard behavior,
*   moved the `Enter` and `Shift+Enter` support from the `Widget` plugin to the `WidgetTypeAround` plugin.

MINOR BREAKING CHANGE (widget): Removed the `getWidgetTypeAroundPositions()` helper since the "Insert new paragraph" buttons are now visible regardless of the widget location in the document
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:ui/ux This issue reports a problem related to UI or UX. package:widget squad:magic type:feature This issue reports a feature request (an idea for a new functionality or a missing option).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants