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

Remove flickering on page loads, reduce flashbangs, fix settings and popup themes applying correctly #1088

Merged
merged 8 commits into from
Jun 19, 2024

Conversation

Kuuuube
Copy link
Member

@Kuuuube Kuuuube commented Jun 19, 2024

No description provided.

@Kuuuube Kuuuube added kind/enhancement The issue or PR is a new feature or request area/ui-ux The issue or PR is related to UI/UX/Design labels Jun 19, 2024
@Kuuuube Kuuuube requested a review from a team as a code owner June 19, 2024 02:39
Copy link

github-actions bot commented Jun 19, 2024

✔️ No visual differences introduced by this PR.

View Playwright Report (note: open the "playwright-report" artifact)

@Kuuuube
Copy link
Member Author

Kuuuube commented Jun 19, 2024

Since the commit history here is a bit messy heres a rundown of what this does:

  • On every page except the popup, the body is hidden until the theme is applied. This removes flickering while it is being loaded. (the popup has a similar function built in already and making it load longer for this would probably be undesirable)
  • Sets the background of the popup preview to transparent while preserving its ability to theme the same as the rest of the page when auto mode is selected. Due to the popup preview being a separate webpage the only way to remove the flickering entirely (besides making the entire settings page take way longer to load) is to set the background transparent. However, due to how site theme is detected this breaks the auto option for body theme. I've added a special case in display for it to detect whether it is running in a popup preview and if so it will override the site theme.
  • Making every page hidden until js runs increases perceived load times so I've changed rendering themes to be the very first thing that is applied or as high up as possible.
  • Themes for the settings page are pulled on page load using the options. But when changing the theme setting on the settings page it still uses the dropdown to workaround firefox bugs.

Hiding until loaded also opens us up to later adding a proper loading message to the actions popup. Currently when it is opened after Yomitan has crashed before it has restarted or before the browser starts the extension it just appears to be broken. With this pr the action popup contents are hidden while loading so it's a bit more obvious that Yomitan isnt just bugged and something hasn't loaded but ideally it would actually say this.

@Kuuuube Kuuuube added this pull request to the merge queue Jun 19, 2024
Merged via the queue into yomidevs:master with commit d9521c5 Jun 19, 2024
10 of 11 checks passed
@Kuuuube Kuuuube deleted the fix-flashbang branch June 19, 2024 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ui-ux The issue or PR is related to UI/UX/Design kind/enhancement The issue or PR is a new feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants