Cache-aware icon loading #33

Open
opened 4 months ago by fynngodau · 4 comments
Owner

Unfortunately, GlideVectorToYou – the library we are using to download icons – does not allow us to tell it to work exclusively offline. For this reason,

  • no file icons are displayed in offline mode, even if they may be available and
  • a loading indicator is shown and then hidden for the brief moment that it takes to load the icon from the cache.

Since fixing #28, this has become even more of a problem because

  • icons should not appear too suddenly but also, at the same time,
  • icons should not fade in if they didn't take any time to load (it makes for a bad scrolling experience otherwise).

We need to investigate alternatives or implement this ourselves – then we could ask the cache if it has a certain file before downloading (if online) and before showing a loading indicator.

Unfortunately, GlideVectorToYou – the library we are using to download icons – does not allow us to tell it to work exclusively offline. For this reason, * no file icons are displayed in offline mode, even if they may be available and * a loading indicator is shown and then hidden for the brief moment that it takes to load the icon from the cache. Since fixing #28, this has become even more of a problem because * icons should not appear too suddenly but also, at the same time, * icons should not fade in if they didn't take any time to load (it makes for a bad scrolling experience otherwise). We need to investigate alternatives or implement this ourselves – then we could ask the cache if it has a certain file before downloading (if online) and before showing a loading indicator.

I do not really understand why we need to download the icons online. Are they downloaded from the moodle server? Because we could simply have an icon for every file type stored offline...

I do not really understand why we need to download the icons online. Are they downloaded from the moodle server? Because we could simply have an icon for every file type stored offline...
Poster
Owner

They are, if no icon is available locally, because we do not have file icons for every possible file type. It is the same code that also loads icons for modules for which we do not have an icon. There are many plugins that add custom modules, and some moodle instances may have privately developed plugins as well, those all need the downloaded icon to work.

They are, if no icon is available locally, because we do not have file icons for every possible file type. It is the same code that also loads icons for modules for which we do not have an icon. There are many plugins that add custom modules, and some moodle instances may have privately developed plugins as well, those all need the downloaded icon to work.

And the icons are all downloaded from the moodle server or from other sources from the internet?

And the icons are all downloaded from the moodle server or from other sources from the internet?
Poster
Owner

They are downloaded from the location that your moodle server tells us. On an unmodified moodle installation, this would always point to your own moodle instance.

(If it were to specify another location, we would also download from there, much like your web browser would also download images from third-party servers if they are embedded by the document that you are loading.)

They are downloaded from the location that your moodle server tells us. On an unmodified moodle installation, this would always point to your own moodle instance. (If it were to specify another location, we would also download from there, much like your web browser would also download images from third-party servers if they are embedded by the document that you are loading.)
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: fynngodau/dawdle#33
Loading…
There is no content yet.