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:
- Create a line of text
- Create a 2 column layout and add text to each
- Create another line of text
- 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!