twenty
twenty copied to clipboard
Fix focus and escape in activity editor
Scope & Context
In activity editor.
Current behavior
If we don't have the focus on a line in the activity editor, we have to hover precisely above the line we want to edit, and if it's a new one, over the last line.
This is not very user friendly.
Also we cannot escape focus or close the activity editor with shortcuts.
Expected behavior
We'd like to focus on the last empty line if we click anywhere below the last line, in the activity editor body :
If there's no last empty line, create a new empty line in the last position
We also want to listen for keyboard events, and if the user types something, put the focus in the last empty line and write in what the user typed.
That way we can add new text easily.
We also want to use escape to :
- Exit the focus on the activity editor body
- Then close the right drawer if there's no focus on the activity editor body or on the fields in the header.
Technical input
- Use our hooks : useListenClickOutside, useScopedHotkeys
- Pay attention to how scoped hotkeys are used and respect the flow of setting the right hotkey scope (it should already be handled for those use cases)
Hi @lucasbordeau can I work on this?
@Muralidhar22 Sure
@Muralidhar22 any progress on this? Thanks a lot!
Hi @FelixMalfait haven't started on this one, you can expect PR by this week, does that work?
Yes perfect thanks @Muralidhar22!