Emoji selector update #2162

Closed
hj wants to merge 0 commits from gitlab-mr-iid-895 into develop
Owner

successor to #2006

closes #101

successor to #2006 closes #101
Author
Owner

when there's only 1 suggestion up/down would not work at all, not even default actions (go one line above/below), so i changed it to only work when there's more than 1 since changing selection with 1 doesn't make any sense anyway.

when there's only 1 suggestion up/down would not work at all, not even default actions (go one line above/below), so i changed it to only work when there's more than 1 since changing selection with 1 doesn't make any sense anyway.
Author
Owner
```suggestion:-0+0 ```
Author
Owner

Current observations/bugs

  • Image context menu doesn't work on status emojis due to pointer-events: none, gonna fix it with another invisible image in
  • Emoji zoom in picker is somewhat weird on mobile, gonna fix it with better touch handling?
Current observations/bugs * Image context menu doesn't work on status emojis due to `pointer-events: none`, gonna fix it with another invisible image in <span> * Emoji zoom in picker is somewhat weird on mobile, gonna fix it with better touch handling?
Owner

log

log
Owner

indent looks wrong on some of the closing >

indent looks wrong on some of the closing >
Owner

This seems completely fine

This seems completely fine
Owner

emoji picker itself looks and works nice, tried on your instance both in firefox and chromium desktop and firefox mobile. I would however axe the hover to zoom, it's distracting (especially in the picker) on desktop when I tried it and doesn't quite work properly on mobile at all. Interesting idea but doesn't work well in practice imo.

emoji picker itself looks and works nice, tried on your instance both in firefox and chromium desktop and firefox mobile. I would however axe the hover to zoom, it's distracting (especially in the picker) on desktop when I tried it and doesn't quite work properly on mobile at all. Interesting idea but doesn't work well in practice imo.
Owner

I would consider renaming these bool props in a way that implies bool, like add a verb to it

I would consider renaming these bool props in a way that implies bool, like add a verb to it
Author
Owner

Sure. At very least I'll move it to a separate MR. I have an idea how to make it more usable in picker and in posts.

Sure. At very least I'll move it to a separate MR. I have an idea how to make it more usable in picker and in posts.
Author
Owner
```suggestion:-0+0 ```
Author
Owner
            >
```suggestion:-0+0 > ```
Owner

wait what

wait what
Author
Owner

I'm gonna make a separate "Checkbox" component some time later. This is a workaround to make unique IDs for now

Basically, the situation is:

We have the checkbox that looks like this

<input type="checkbox" id="spamMode"/>
<label for="spamMode">Spam mode!</label>

but then we have multiple new post forms like

<!-- main form -->
<input type="checkbox" id="spamMode"/>
<label for="spamMode">Spam mode!</label>

<!-- reply form -->
<input type="checkbox" id="spamMode"/>
<label for="spamMode">Spam mode!</label>

ruh-oh! we have two inputs with same id!! this breaks checkboxes since you need to click on label to toggle them. And how it works in browser that click goes to first, or last, or whatever id it finds, the behavior is not defined since ids are supposed to be unique:

<!-- main form -->
<input type="checkbox" id="spamMode"/> <!-- event arrives here -->
<label for="spamMode">Spam mode!</label>

<!-- reply form -->
<input type="checkbox" id="spamMode"/>
<label for="spamMode">Spam mode!</label> <!-- user clicks here -->

Ideally we should have a Checkbox component that will generate random ids for us since they are not as important nowadays, i'll try to do that soon after. For now i just add a random number to the id and for attributes like so:

<!-- main form -->
<input type="checkbox" id="spamMode-233312"/>
<label for="spamMode-233312">Spam mode!</label>

<!-- reply form -->
<input type="checkbox" id="spamMode-312415"/>
<label for="spamMode-312415">Spam mode!</label>
I'm gonna make a separate "Checkbox" component some time later. This is a workaround to make unique IDs for now Basically, the situation is: We have the checkbox that looks like this ```html <input type="checkbox" id="spamMode"/> <label for="spamMode">Spam mode!</label> ``` but then we have multiple new post forms like ```html <!-- main form --> <input type="checkbox" id="spamMode"/> <label for="spamMode">Spam mode!</label> <!-- reply form --> <input type="checkbox" id="spamMode"/> <label for="spamMode">Spam mode!</label> ``` ruh-oh! we have two inputs with same id!! this **breaks** checkboxes since you need to click on label to toggle them. And how it works in browser that click goes to first, or last, or whatever id it finds, the behavior is not defined since `id`s are supposed to be unique: ```html <!-- main form --> <input type="checkbox" id="spamMode"/> <!-- event arrives here --> <label for="spamMode">Spam mode!</label> <!-- reply form --> <input type="checkbox" id="spamMode"/> <label for="spamMode">Spam mode!</label> <!-- user clicks here --> ``` Ideally we should have a `Checkbox` component that will generate random ids for us since they are not as important nowadays, i'll try to do that soon after. For now i just add a random number to the id and for attributes like so: ```html <!-- main form --> <input type="checkbox" id="spamMode-233312"/> <label for="spamMode-233312">Spam mode!</label> <!-- reply form --> <input type="checkbox" id="spamMode-312415"/> <label for="spamMode-312415">Spam mode!</label> ```
Author
Owner

Also closing the picker is kinda hard, should probably close it on keyboard input in text field + maybe a cross icon or something

Also closing the picker is kinda hard, should probably close it on keyboard input in text field + maybe a cross icon or something
Author
Owner

axed

axed
Author
Owner

for now just updated hotkey logic to hide picker on input (also sneaky suggestions update)

for now just updated hotkey logic to hide picker on input (also sneaky suggestions update)
Author
Owner

renamed

renamed
Owner

Left in by mistake?

Left in by mistake?
Owner

I don't think it should insert the spaces ever, no emoji keyboard I've used does that. I only see it as quirky unexpected behavior that varies on context

I don't think it should insert the spaces ever, no emoji keyboard I've used does that. I only see it as quirky unexpected behavior that varies on context
Owner

keepOpen?

keepOpen?
Owner

maybe we should have a super simple global serial id counter instead of random? basically just a service that you ask for an id and it just increments it by one every time someone uses it. I know it's very unlikely but there's still the chance of getting the same id twice with random for some very fun bugs

maybe we should have a super simple global serial id counter instead of random? basically just a service that you ask for an id and it just increments it by one every time someone uses it. I know it's very unlikely but there's still the chance of getting the same id twice with random for some very fun bugs
Author
Owner

i think so, yeah, or use UUID instead, but I plan to do that in a Checkbox component, in a separate MR since this one is bloated enough already.

Random should work enough, I think we already have same problem with "mark as sensitive" checkbox too anyway.

i think so, yeah, or use UUID instead, but I plan to do that in a Checkbox component, in a separate MR since this one is bloated enough already. Random should work enough, I think we already have same problem with "mark as sensitive" checkbox too anyway.
Author
Owner

Tusky inserts custom emoji as :shortcode: , with space at the end.

MastoFE (mastosoc) somehow has exact same behavior as I did (smart spaces before and after), i swear on me mum i didn't copy them on purpose.

Tusky inserts custom emoji as `:shortcode: `, with space at the end. MastoFE (mastosoc) somehow has exact same behavior as I did (smart spaces before and after), i swear on me mum i didn't copy them on purpose.
Author
Owner

i could separate "keep open" and "don't pad with spaces"...

i could separate "keep open" and "don't pad with spaces"...
Owner

Works kinda dodgy on mobile with the osk appearing and disappearing, but I don't know how much can be done about that, it's still functional.

I'd reduce the height a tiny bit so that the initial bottom row gets covered a bit more by the gradient

Works kinda dodgy on mobile with the osk appearing and disappearing, but I don't know how much can be done about that, it's still functional. I'd reduce the height a tiny bit so that the initial bottom row gets covered a bit more by the gradient
Author
Owner
```suggestion:-0+0 ```
Owner

lgtm!

lgtm!

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pleroma/pleroma-fe!2162
No description provided.