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

When composing post, emoji selector covers “toot!” button #4744

Open
lucaswerkmeister opened this issue Oct 29, 2024 · 2 comments
Open

Comments

@lucaswerkmeister
Copy link

Pitch

Sometimes I want to end my posts with a tongue-stuck-out emoticon (:P). When I do this, Tusky opens the emoji selector; and because the emoji selector covers the bottom bar, including the button to send the post, I usually end up accidentally selecting an emoji that I don’t want, which I then have to delete (and re-type the :P).

Would it be possible to make the selector not extend above the bottom bar?

Screenshot_20241029-204159

(This also affects other colon-and-letter emoticons, such as :D, but I mostly notice it with :P – depends on what you type more often, I suppose. Non-letter emoticons like :) are of course not affected.)

Motivation

Because it keeps annoying me, I guess. :)

@lucaswerkmeister
Copy link
Author

I suppose an alternative solution would be to only start showing the emoji selector after a colon and two letters – that’s what Mastodon web seems to do. (I never realized it before, but it sounds pretty reasonable to me. And might be easier to implement ^^)

@lucaswerkmeister
Copy link
Author

I suppose an alternative solution would be to only start showing the emoji selector after a colon and two letters – that’s what Mastodon web seems to do. (I never realized it before, but it sounds pretty reasonable to me. And might be easier to implement ^^)

Completely untested patch for this approach (based on 55467af):

diff --git a/app/src/main/java/com/keylesspalace/tusky/components/compose/ComposeViewModel.kt b/app/src/main/java/com/keylesspalace/tusky/components/compose/ComposeViewModel.kt
index d0befe8685..be5b3c046f 100644
--- a/app/src/main/java/com/keylesspalace/tusky/components/compose/ComposeViewModel.kt
+++ b/app/src/main/java/com/keylesspalace/tusky/components/compose/ComposeViewModel.kt
@@ -454,6 +454,9 @@ class ComposeViewModel @Inject constructor(
             ':' -> {
                 val emojiList = emoji.replayCache.firstOrNull() ?: return emptyList()
                 val incomplete = token.substring(1)
+                if (incomplete.length < 2) {
+                    return emptyList()
+                }
 
                 emojiList.filter { emoji ->
                     emoji.shortcode.contains(incomplete, ignoreCase = true)

Maybe some day I’ll be bothered enough by this to set up an Android test environment and try it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant