-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Writing Flow: Trailing placeholder attempt2 #4425
Conversation
37ab94e
to
2ee822c
Compare
I really really really love this so. Thanks so much for working on this. It feels like such an improvement, and it feels so intuitive in practice. @mtias made a good point in the past thread, that we still might want to show the inserter in the context of where your caret is. That is, it's not a trailing inserter that's always there, but it's the inline inserter just shown to the left of the placeholder where the movers are. As soon as you start typing, it is replaced by the movers. Essentially what's mocked up here. It's okay for this behavior to apply to the very first placeholder too. What do you think? |
@jasmussen The trickiest part is "As soon as you start typing, it is replaced by the movers" This basically means this inserter should be added in the "paragraph" block itself or have a way to know if the paragraph block is empty (which has been advocated against several times by @aduth) |
Understood. Can we "cheat"? Can we have an invisible trailing inserter sitting on top of the movers, as part of the block framework itself? And then do some sort of show/hide based on whether the paragraph is empty or not? @mtias any thoughts? |
@jasmussen That was my idea but we need the |
This would indadvertedly fix #3793 🙂 |
2ee822c
to
47f5b07
Compare
@jasmussen Added an inserter (actually moved the sibling inserter) next to the last block. Thoughts? |
Really appreciate that you keep working on this. Here's a GIF of the latest behavior: I appreciate this, but it doesn't fix the issue of the inserter showing only when the placeholder is empty, i.e. it doesn't work when between two paragraphs if you make a linebreak. How do we know when to show the inserter? The However this latest effort does surface another point — we have the sibling inserter. Maybe this is sufficient? What if there is no inserter added in this PR, like the previous version, and if you need to insert at the end you have to use the sibling inserter for it? I've also been mocking up ways to always show the inserter to the left, but so far I'm not feeling it: |
I think getting this PR merged in is an important stepping stone in order to make general improvements to the insertion flow. I think there is a solution awaiting us, that means always showing the plus next to a block, whether empty or not. This solution, once we find a good design, will also make the sibling inserter moot. As such, it makes sense to move forward with this PR with the minimal amount of work, done, and then do further improvements separately. The last commit you pushed added the inserter on the side, instead of the movers, on the last block. I think if we can move it so it isn't vertically centered on long blocks (i.e sits where the movers sit) and don't have the fade in/out effect, then I think this is good to go. |
What exactly do you propose here? Always showing it when the block is selected even in typing mode? or just removing the animation? It's not clear with the comment :) |
Great point. The inserter on the left assumes that it's attached to the literal "trailing placeholder", which wouldn't work both since there isn't one and also since as soon asn you clicked in it it would disappear. I'm going to check out this branch tomorrow and do a little experiment. |
In #4539, I basically forked this branch from an earlier version and tried an experiment. Please give it a spin. |
Tested a bit, a few considerations: 1 2 A stronger focus style and making the caret appear as default in all editable fields maybe could help? 3 4 As you know, all UI controls must be labeled with some meaningful text. 5 |
Seems focus goes to the external wrapper, not on the actual editable element. |
Arg yes that one :D |
Given the version 3 of this has been mered, I think we can close this one. Thanks again Riad. |
closes #3078
This PR replaces the trailing inserter with an empty placeholder at the end of the editor.
The differences with the original (reverted) implementation are: