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

Try: Writing Flow: Clickable text canvas to focus closest tabbable #5493

Closed
wants to merge 3 commits into from

Conversation

aduth
Copy link
Member

@aduth aduth commented Mar 8, 2018

Note: Work-in progress. While the basic behaviors work fairly well, it's not expected to be flawless and at this point serves more for demonstration.

This pull request seeks to experiment with an idea for more easily navigating into tabbable fields by clicking on the canvas surrounding the list of blocks. This is inspired by behaviors from typical Word processors like Google Docs, where clicking anywhere on the edge of the document will place the caret at the most relevant piece of text.

The effect is a bit hard to describe without trying it for yourself, but I've attempted to demonstrate in the GIF below:

clickable

Note that...

  • To start writing, I click anywhere below the title. The behavior is such that if the last block is not a paragraph block, one will be added (including when there are no blocks).
  • Again I add another paragraph after the image block by clicking arbitrary below it on the page.
  • After adding some text to the paragraph block, I start clicking below the text.
    • Despite not clicking on the paragraph block itself, the caret moves to the corresponding X position of the text within.
    • As I start clicking up the side gutters of the canvas, the block at the corresponding Y position becomes selected

Remaining tasks:

  • Probably don't need the hover effect for the default block appender, since the user no longer needs to click explicitly within it
  • Restore behavior where arrow down within paragraph block creates a new paragraph block below
  • X coordinate aligning of caret doesn't work for textareas (i.e. post title). I think this should be possible to support.
  • Lots of implementation details: click behaviors too aggressive, inline code comments, corrected function names (early implementation was specific to blocks, not tabbables)

@aduth aduth added the [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... label Mar 8, 2018
@aduth aduth requested a review from a team March 8, 2018 13:52
@jasmussen
Copy link
Contributor

I really, really like the thinking around this.

I'm aware that this is a work in progress, so you're probably already aware of this — it's now hard to deselect a block once selected, because it keeps selecting the same block.

@aduth
Copy link
Member Author

aduth commented Mar 10, 2018

Superseded by #5541

@aduth aduth closed this Mar 10, 2018
@aduth aduth deleted the try/text-canvas branch March 10, 2018 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Writing Flow Block selection, navigation, splitting, merging, deletion...
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants