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

Add paste key #945

Merged
merged 12 commits into from
Jul 6, 2024
Merged

Add paste key #945

merged 12 commits into from
Jul 6, 2024

Conversation

devycarol
Copy link
Contributor

This patch adds a toolbar paste key, which can be used in regular layouts. Long-clicking the toolbar key opens the clipboard history if enabled, otherwise just pastes normally. Having it as a separate key helps make what the clipboard key does more clear, and allows for easy one-tap pasting without disabling clipboard history

I've put it in all the default toolbar layouts, replacing "select all" in the main toolbar and "one handed mode" in the clipboard one. I've also reorganized them, aiming for a more coherent design pattern, but I can revert any of those things if you wish.

Many lines in ToolbarUtils.kt have been reorganized to help me navigate it moving forward.


Progress on #357

@Helium314
Copy link
Owner

I still need a little time to decide whether I'm ok with the changed defaults. Otherwise it looks good.

@devycarol
Copy link
Contributor Author

devycarol commented Jul 5, 2024

Happy to revert any of those, already unpinned paste from the default now that we have clipboard suggestions.

On that matter, I've also changed that suggestion icon from 'clipboard' to 'paste'. I'd really like to see that association of "paste icon = paste action centric, clipboard icon = clipboard history centric," but let me know if you want me to revert that.

@devycarol
Copy link
Contributor Author

devycarol commented Jul 5, 2024

I'll go ahead and explain what I've tried to do with the default toolbars. Goals: be as similar to the previous default as possible, add in 'paste' since it's of about equal importance to 'copy', and improve a little on organization. For specifics,

Clipboard toolbar:

  • Replace one-handed, since it's not related to pasting/editing text.
  • Move clear-clipboard far left, since it's the most drastic action and should not be easy to accidentally hit—currently it's right next to the often-repeated right arrow, but I don't feel comfortable touching that key at all if it's right next to "clear history."
  • Scoot 'undo' over right of the arrow keys, and then arrange undo/cut/copy/paste in the traditional "ZXCV" ordering from qwerty.
  • No further changes to the right.

Main toolbar:

  • Replace select-all. That key juxtaposed with select-word is visually noisy and ambiguous for those who don't look in the settings. Also, even with 'undo' available, it's somewhat volatile when bumped accidentally. You can still select all by long-clicking select-word, which is a more clear intention.
  • Move 'settings' far left, it's the most drastic as it opens a whole new activity (triggering onStop for the app you're typing in, etc.) We then have 'voice' which opens a separate IME, and 'clipboard' which opens a separate layout.
  • Put 'paste' to the right of 'copy', avoid further changes.

In the future, it might be a good idea to prevent sister keys like left/right and undo/redo from getting swapped by RTL.

and use android string for cut (not sure why it wasn't the case already)
@Helium314
Copy link
Owner

In the future, it might be a good idea to prevent sister keys like left/right and undo/redo from getting swapped by RTL.

RTL handling is something that could be improved in general. Currently iirc things depend on the main keyboard language, so arrows and swiping may use the wrong direction depending on whether there is actual RTL text or not (e.g. only numbers). When you mix LTR and RTL things can get even worse, but I'm not sure how much complexity I want to add on this.

@Helium314 Helium314 merged commit 0bd76de into Helium314:main Jul 6, 2024
1 check passed
@devycarol devycarol deleted the paste-key branch July 6, 2024 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants