yishn / tikzcd-editor

A simple visual editor for creating commutative diagrams.
https://tikzcd.yichuanshen.de/
MIT License
1.86k stars 100 forks source link

UX improvements #34

Closed varkor closed 5 years ago

varkor commented 5 years ago

This PR includes various usability improvements.

yishn commented 5 years ago

I'm in progress of rewriting the code popup and I've included some of your proposed changes except for:

Add keyboard shortcuts for undo/redo

Hijacking browser shortcuts like that will interfere with browser/system functionality, e.g. when focusing the code textarea and pressing Ctrl/Cmd+Z to undo your textarea changes you will involuntarily undo your diagram.

Use Alt rather than Ctrl for arrows

This may work for macOS, but for Windows/Linux pressing Alt will focus the main menu, stealing the focus from the website, so that won't do. So I changed it to the Shift key. Would that cause any problems on macOS?

varkor commented 5 years ago

Hijacking browser shortcuts like that will interfere with browser/system functionality, e.g. when focusing the code textarea and pressing Ctrl/Cmd+Z to undo your textarea changes you will involuntarily undo your diagram.

That's true. It might be most intuitive to only trigger these actions when document.activeElement instanceof HTMLInputElement does not hold.

So I changed it to the Shift key. Would that cause any problems on macOS?

Shift key should work just as well!

I'm in progress of rewriting the code popup and I've included some of your proposed changes

In that case, feel free to close this pull request if it is no longer relevant.