Shubh: I think so too, this virtualized thing is starting to be just too much trouble.
2022-06-27 17844, 2022
monkey
If possible, we can take a page from the musicbrainz dropdown and show first the 20 or so often-used languages (frequency = 2) and then below the 400-ish less used languages (frequency = 1).
2022-06-27 17844, 2022
monkey
Added to that, since we have the option to do it, I would keep the dropdown searchable (with an language search endpoint) to give users access to the 7000+ remaining languages with frequency = 0
2022-06-27 17847, 2022
monkey
So to be clear: I propose we load the 425 languages with frequency >= 1, showing the 21 more common languages separately in the same dropdown like so: https://usercontent.irccloud-cdn.com/file/xY2Wfs5…
2022-06-27 17805, 2022
monkey
The rest can be accessed with an async search endpoint
2022-06-27 17822, 2022
Shubh
i think we don't even need a end point for this, we can just asynchronously load languages on client using promises
2022-06-27 17845, 2022
monkey
load from where?
2022-06-27 17829, 2022
Shubh
load from client itself since we will have access to all languages we can just filter languages on the fly
2022-06-27 17837, 2022
monkey
I guess we can try that. On the one hand we still load all the languages which takes some space it the props, but on the other hand there's no need for a new endpoint and it will work faster
2022-06-27 17859, 2022
Shubh
if you like i can quicky made a PR for this or add it existing refactor PR
2022-06-27 17804, 2022
CatQuest
please tell me when dne so i can test it
2022-06-27 17809, 2022
CatQuest
:D
2022-06-27 17819, 2022
monkey
New PR please Shubh :)
2022-06-27 17846, 2022
CatQuest
:O thunderstorm here today ⛈
2022-06-27 17837, 2022
Shubh
monkey: can we have current unified form on test.bb?
2022-06-27 17828, 2022
monkey
Shubh: Sure I can deploy it, but do we not need to merge #847 and rebase first?
2022-06-27 17806, 2022
Shubh
yep indeed
2022-06-27 17853, 2022
monkey
Shubh: I've got the language select up on test, which works great. I'll merge it now and move on to the multi-entity POST route PR next.
2022-06-27 17853, 2022
monkey
One thing I wanted to note: we appear to still have a similar slowdown issue when selecting a language/clearing the dropdown (scrolling and searching work very fast, nice job :) ).
2022-06-27 17853, 2022
monkey
Not a huge issue but profiling confirms it is adding documents to the js-search index.
2022-06-27 17853, 2022
monkey
You had done some work to memoize the component, but I think we must be missing something if the documents are reindexed on state change.
2022-06-27 17842, 2022
monkey
Not going to block this PR, but if you're up for it, perhaps something you could resolve later on
Now this is turning into a train of thought :steam_locomotive: :D
2022-06-27 17813, 2022
monkey
Should the `areEqual` method here only check the `options` prop rather than all the props? Because if the selected value changed the props won't be equal, which in turn means no memoization…
2022-06-27 17830, 2022
monkey
But we do want the component to re-render when the language state changes, since we display the selected option in the dropdown. Not sure memoization will solve our issue for this case
2022-06-27 17833, 2022
monkey
P.S: just updated #850 and going to deploy it now to test.BB
just a heads up: if I am offline (catquest) tomorrow (because the thundestorm is huge tonight and my connection company is shit on usual days anyway) you can talk to KassOtsimine instead