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

Custom Fields are semi broken since today #411

Open
mirai-ux opened this issue Apr 21, 2024 · 4 comments
Open

Custom Fields are semi broken since today #411

mirai-ux opened this issue Apr 21, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@mirai-ux
Copy link

Since the latest commit asbplayer custom fields seem to have been broken. My entire config got erased, and due to my own stupidity my backup was old enough that I had to change some of the custom fields. Well, for some reason now they automatically get sorted in an alphabetical order, so I could create fields: Target Word 1; Reading 1; Definition 1, all in this particular order, only for Reading to immediatly jump ahead of Target Word, and Definition ahead of them both.

@killergerbah
Copy link
Owner

Do you mind uploading a video of the problem? I can't seem to reproduce it and it would be helpful to know the exact steps you're taking.

@mirai-ux
Copy link
Author

mirai-ux commented Apr 22, 2024

2024-04-22.09-02-44.mp4

Every time i turn on the browser (using vivaldi because ff codec support is not great TM) the fields just get sorted alphabetically. I have to import my json file for it to work normally. Closing and reopening the app breaks it all over again. That and sometimes it just randomly does it in the middle of the session too.
I haven't installed any new extensions since setting everything up, nor have I played around with the browser's settings. Maybe a new Vivaldi update bricked something?

@killergerbah
Copy link
Owner

I would guess that it was a Vivaldi update (although even if that is the case, this is pretty baffling behavior). I did release some code a couple days ago, but no changes were made to the settings UI, at least none that would cause an issue like this. I'll still take a look to verify these claims and see if there are any workarounds.

@killergerbah killergerbah added the bug Something isn't working label Apr 22, 2024
@killergerbah
Copy link
Owner

killergerbah commented Apr 22, 2024

Okay, I believe I know why this issue might be happening. The custom Anki fields settings don't have any ordering data and so the order in which they appear in the settings UI or Anki dialog is entirely dependent on how the browser decides to sort the dictionary when retrieving it from storage. So this is not entirely a problem with the browser (it happens on Chrome too if you refresh the page) since the data model itself is flawed and doesn't preserve ordering. The only thing that confuses me is why it hasn't appeared until now.

I think a fix for this might be somewhat complicated and a little risky since I will need to migrate settings data to a new data model. So you may have to live with this for some time. The workaround I would suggest is to put numbers in front of the field names for your custom fields.

@killergerbah killergerbah self-assigned this May 9, 2024
@killergerbah killergerbah added this to the Extension v1.3.0 milestone May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants