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

fix: reduce flicker when loading credential images #233

Closed
wants to merge 1 commit into from

Conversation

maiertech
Copy link
Member

@maiertech maiertech commented May 17, 2024

Description of change

The previous handling of images loaded the fallback images immediately. The revised approach awaits a promise that returns the asset URL. The fallback image is shown only when no asset URL could be resolved.

If the asset URL can be resolved, the image is still rendered with a slight delay.

I tried an alternative approach to compute the asset URL in a SvelteKit page load function. But this did not work. Not clear why, but calling Tauri APIs crashes the load function.

The perceived flickering should be less because the fallback does not get rendered by default. But it is possible that you will perceive the delay when the image loads. This is unfortunately a limitation of client-side loading.

ScreenFlow

Links to any relevant issues

Fixes issue #182.

How the change has been tested

Screen record the app while clicking on badges in the Ferris profile. Then use the scrubber to scrub through the recorded images after clicking a badge. You should not see the fallback image loaded. However you will see no image loaded before that image gets loaded.

Definition of Done checklist

Add an x to the boxes that are relevant to your changes.

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@maiertech maiertech changed the title Await img src properly fix: reduce flicker when loading credential images May 17, 2024
@maiertech maiertech marked this pull request as ready for review May 17, 2024 08:46
@maiertech maiertech requested review from daniel-mader, Norlock and nanderstabel and removed request for Norlock May 17, 2024 08:46
@maiertech maiertech self-assigned this May 17, 2024
@maiertech
Copy link
Member Author

I am switching this one back to draft because the fix needs to be tested on a real device first. Subject to getting tauri ios dev up and running on my machine.

@maiertech maiertech marked this pull request as draft May 24, 2024 15:15
@maiertech
Copy link
Member Author

The background image effect seems to be the culprit for the perceived flicker.

@maiertech
Copy link
Member Author

On hold until #284 is done.

@maiertech maiertech added the Blocked An issue that is blocked by another issue or another blocker. label Jul 15, 2024
@maiertech
Copy link
Member Author

Obsolete with /credential route redesign in #366.

@maiertech maiertech closed this Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocked An issue that is blocked by another issue or another blocker.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants