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

Make undo action update blockSelection #12133

Closed
wants to merge 3 commits into from
Closed

Conversation

oandregal
Copy link
Member

@oandregal oandregal commented Nov 20, 2018

This PR makes the blockSelection reducer history aware.

Fixes #12002
Alternative to #12052

@oandregal oandregal changed the title Fix/undo selected block Make undo action update blockSelection Nov 20, 2018
@oandregal oandregal requested review from youknowriad, gziolo and a team November 20, 2018 21:42
@oandregal oandregal self-assigned this Nov 20, 2018
@oandregal oandregal added [Type] Bug An existing feature does not function as intended [Status] In Progress Tracking issues with work in progress labels Nov 20, 2018
*
* @return {Object} Updated state.
*/
export const blockSelection = withHistory()( rawBlockSelection );
Copy link
Member

Choose a reason for hiding this comment

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

I don't get why this isn't part of the same history reducer as blocks.

Copy link
Member Author

Choose a reason for hiding this comment

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

You mean part of core/editor.editor reducer? As I was thinking through this PR I was starting to feel that would be the only approach that makes sense long-term - it is the only that keeps editor state and block selection in sync.

Copy link
Member Author

Choose a reason for hiding this comment

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

Also against this PR: I worry that adding history to the blockSelection makes the state grow bigger than desired. And that we can have multiple consecutive entries for the same block (for ex: click a block adds an entry, then select a range within the block adds another entry, then click within the block adds another entry) is problematic.

@ellatrix ellatrix requested review from aduth and a team November 20, 2018 22:24
@oandregal oandregal closed this Nov 21, 2018
@oandregal oandregal deleted the fix/undo-selected-block branch November 21, 2018 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants