Two Workdoc Feature Requests: Tie into native undo and include nested blocks in focusedBlocks

I’m working on a workdoc app that changes text. Currently, there are two things that would better align with user expectations and improve efficiency:

1) Tie updateDocBlock and the similar mutation into workdoc’s native undo functionality.

Right now, when updating a document block with updateDocBlock or the mutation, it’s not possible to undo changes with the “undo” button.

For instance, if I have a button that changes all text to uppercase and the user clicks it, they are not able to undo any changes. The undo button will not revert changes made with updateDocBlock - this is something a user would expect since there is an “undo” button.

2) Include nested blocks in focusedBlocks (or something…)

Assuming a 2-column layout structure that looks something like:

"normal text 1"
"layout"
    "cell"
        "normal text 3"
        "normal text 4"
"normal text 2"

If you select these blocks with the mouse, you only get “normal text 1” and “normal text 2” in the focusedBlocks object. You can actually see this if you:

  1. Create a line of text
  2. Create a 2 column layout and add text to each
  3. Create another line of text
  4. Select all the text

The UI reports that 2 items are selected, which is probably not what a user would expect.

Codewise, it looks like it makes things pretty inefficient:

If a user wants to do something with highlighted text that spans layout columns, my code needs to grab all the document blocks for the document and filter them based on the cell parent id. (There doesn’t appear to be a way to query for an individual block or group of document blocks, either). This is probably super slow for large docs.

Happy to take suggestions or add more to this if anything is confusing!

Hello there @tylerb,

If you would be able to please open one request per topic here so that our team is in the loop and other users can vote for the requests, that would be fantastic!

Cheers,
Matias

:+1: No problem

Thank you for that @tylerb !!