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

Show most used instead of recently used emoji by default #96

Open
tsujigiri opened this issue Apr 1, 2020 · 11 comments
Open

Show most used instead of recently used emoji by default #96

tsujigiri opened this issue Apr 1, 2020 · 11 comments

Comments

@tsujigiri
Copy link

IMHO, it would be more useful to see the most used emoji by default instead of the recently used ones. It could also be a combination of both.

@maoschanz
Copy link
Owner

while you're right, i've no idea how to do...

@tsujigiri
Copy link
Author

The simplest solution that comes to mind is just keeping an object instead of the ´recently-used´ array, with the label as key and the count as value. The number space is limited, of course, but it will probably be large enough? 🤷‍♂️

@maoschanz
Copy link
Owner

yes and i don't know how to do associative array with gsettings, and keeping 2 simple arrays in parallel feels hacky

i'll search how to do after i'll finally finish updating the emojis to unicode 12

@tsujigiri
Copy link
Author

If there is no such thing, serializing it into a string would probably work, too, I guess.

Do you know a good getting started guide for Gnome extension development?

@maoschanz
Copy link
Owner

there is a series of blog posts on this topic somewhere on the gnome subreddit

but gsettings isn't specific to GS extensions, the entire GIO libs are common to most GNOME-related projects: iirc defining advanced data structures storable in dconf is what GVariant is for, i've just never used it that way yet

@maxjf1
Copy link

maxjf1 commented Nov 11, 2020

IDK exactly how the recent used is stored, but if it is an array of strings of emoji IDs, it can be changed to an tuple, something like this:

mostUsed = [
  ["emojia", 23],
  ["emojib", 21],
  ["emojic", 10]
]

to display the emoji, you will extract it on your display function const [emoji] = mostUsed[i]

then, when you use an emoji, you currently remove it and put it on the begining of the array. What would you do is just remove it, put it in the array, then run a sort function mostUsed = mostUsed.sort(e => e[1])

if gnome only allows you to store an string, you can always JSON.stringify it.

If you tell me where in the project the recentEmojis are stored, and displayed, i can try to do a PR

@maoschanz
Copy link
Owner

If your plan is really to store JSON as a string in the dconf database, i'll not accept the PR sorry

@maxjf1
Copy link

maxjf1 commented Nov 13, 2020

If your plan is really to store JSON as a string in the dconf database, i'll not accept the PR sorry

again, as i said:

IDK exactly how the recent used is stored, but if it is an array of strings of emoji IDs, it can be changed to an tuple, something like this:

After this:

If you tell me where in the project the recentEmojis are stored, and displayed, i can try to do a PR

I can try to learn and understand how it's done, and try to do an PR 😃

@AlexWayfer
Copy link

If your plan is really to store JSON as a string in the dconf database, i'll not accept the PR sorry

again, as i said:

IDK exactly how the recent used is stored, but if it is an array of strings of emoji IDs, it can be changed to an tuple, something like this:

After this:

If you tell me where in the project the recentEmojis are stored, and displayed, i can try to do a PR

I can try to learn and understand how it's done, and try to do an PR

If you're actually ready to make a PR, you should check and investigate the code by yourself. It takes less than 2 minutes for me to find this code: https://github.com/maoschanz/emoji-selector-for-gnome/blob/68086f6/emoji-selector%40maestroschan.fr/extension.js#L95-L101

Obviously, this is the place which we should change for this issue.

@maxjf1
Copy link

maxjf1 commented Nov 17, 2020

If you're actually ready to make a PR, you should check and investigate the code by yourself. It takes less than 2 minutes for me to find this code: https://github.com/maoschanz/emoji-selector-for-gnome/blob/68086f6/emoji-selector%40maestroschan.fr/extension.js#L95-L101

Obviously, this is the place which we should change for this issue.

I'm noticing a little toxicity here, it's sad to see this on the linux comunity 😞

@AlexWayfer
Copy link

I'm noticing a little toxicity here, it's sad to see this on the linux comunity

Sadly that you've noticed such things there. I'm just trying to direct you and anyone else to the correct actions and places, for this case and for future ones. With the best wishes.

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

4 participants