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 Electron Build #1926

Merged
merged 7 commits into from
Nov 20, 2023
Merged

Fix Electron Build #1926

merged 7 commits into from
Nov 20, 2023

Conversation

Shazib
Copy link
Contributor

@Shazib Shazib commented Nov 18, 2023

Some of the theme switching stuff has broken electron, at least on Windows builds.

This resolves that issue.

Dark mode still works in the netlify preview, and I haven't changed anything at all front-end wise, so I'm not sure why the visual regression tests have failed.

@trafico-bot trafico-bot bot added the 🚧 WIP label Nov 18, 2023
Copy link

netlify bot commented Nov 18, 2023

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit f9fb564
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/655a6d33bf2c4800082c8625
😎 Deploy Preview https://deploy-preview-1926.demo.actualbudget.org/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

github-actions bot commented Nov 18, 2023

Bundle Stats — desktop-client

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
16 2.97 MB → 2.97 MB (-5 B) -0.00%
Changeset
File Δ Size
src/browser-preload.browser.js 📈 +97 B (+2.10%) 4.52 kB → 4.61 kB
src/global-events.js 📉 -111 B (-2.10%) 5.15 kB → 5.05 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

Asset File Size % Changed
static/js/main.js 1.16 MB → 1.16 MB (-5 B) -0.00%

Unchanged

Asset File Size % Changed
static/js/665.chunk.js 824.28 kB 0%
static/media/Inter-italic.var.woff2 239.29 kB 0%
static/media/Inter-roman.var.woff2 221.86 kB 0%
static/js/444.chunk.js 156.11 kB 0%
static/js/231.chunk.js 117.37 kB 0%
static/js/wide-components.chunk.js 117.06 kB 0%
static/js/reports.chunk.js 74.37 kB 0%
static/js/narrow-components.chunk.js 52.67 kB 0%
static/js/301.chunk.js 13.31 kB 0%
static/js/473.chunk.js 13 kB 0%
static/js/resize-observer-polyfill.chunk.js 8.88 kB 0%
static/css/main.css 7.41 kB 0%
asset-manifest.json 2.07 kB 0%
index.html 1.66 kB 0%
static/media/browser-server.js 903 B 0%

Copy link
Contributor

github-actions bot commented Nov 18, 2023

Bundle Stats — loot-core

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
2 2.22 MB 0%

Changeset

No files were changed

View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
kcab.worker.js 1.23 MB 0%
xfo.xfo.kcab.worker.js 1014.46 kB 0%

@Shazib Shazib changed the title [WIP] Fix Electron Build? Fix Electron Build Nov 18, 2023
@Shazib Shazib changed the title Fix Electron Build [WIP] Fix Electron Build Nov 18, 2023
@Shazib Shazib changed the title [WIP] Fix Electron Build Fix Electron Build Nov 18, 2023
@Shazib Shazib mentioned this pull request Nov 18, 2023
22 tasks
@MatissJanis
Copy link
Member

Try updating your changes with latest master. That might fix the VRT job.

@MatissJanis
Copy link
Member

Looks like it didn't help. There must be some sort of change that affects them from this PR.

@Shazib Shazib changed the title Fix Electron Build [WIP] Fix Electron Build Nov 19, 2023
@MikesGlitch
Copy link
Contributor

MikesGlitch commented Nov 19, 2023

If you look at the test: "budget-Budget-renders-the-summary-information-available-funds-overspent-budgeted-and-for-next-month-chromium"

You can see it expects dark theme but gets light theme. Maybe if you fix that issue the others will be fixed?

the theme switch happens in playwright.config.js. It's to do with the window.Actual.setTheme("dark") not working anymore

@Shazib
Copy link
Contributor Author

Shazib commented Nov 19, 2023

If you look at the test: "budget-Budget-renders-the-summary-information-available-funds-overspent-budgeted-and-for-next-month-chromium"

You can see it expects dark theme but gets light theme. Maybe if you fix that issue the others will be fixed?

the theme switch happens in playwright.config.js. It's to do with the window.Actual.setTheme("dark") not working anymore

Thanks for the info, i'll dig into it a bit.

The loading of the theme seems to happen fine in the netlify preview, i've compared it to other older PR's and it seems to be in a similar time.

Do you know if the tests run against the netlify instance?

@MikesGlitch
Copy link
Contributor

MikesGlitch commented Nov 19, 2023

") not working anymore

Thanks for the info, i'll dig into it a bit.

If you click the demo link and run this in the console

window.Actual.setTheme("dark") 

It should toggle it to dark. Or "light" will put it to light. That's broken the web demo - I'm assuming cause you removed it from the globals file.

I think the initialisation might be fine, but the VRT tests toggle it from light to dark with that setTheme call to check against the screenshots.

@Shazib
Copy link
Contributor Author

Shazib commented Nov 19, 2023

It should toggle it to dark. Or "light" will put it to light. That's broken the web demo - I'm assuming cause you removed it from the globals file.

I think the initialisation might be fine, but the VRT tests toggle it from light to dark with that setTheme call to check against the screenshots.

Interesting, thanks! That gives me a thread to follow. I was going off the fact that the toggle button in the corner still works in the web version.
I didn't remove setTheme entirely though, i just moved it to the preload file.

Anyway digging into it now, thanks for the guidance!

@Shazib Shazib changed the title [WIP] Fix Electron Build Fix Electron Build Nov 19, 2023
@Shazib
Copy link
Contributor Author

Shazib commented Nov 19, 2023

@MikesGlitch Thanks, Fixed!

Copy link
Member

@MatissJanis MatissJanis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Shazib ! <3

@MatissJanis MatissJanis merged commit e6e184c into actualbudget:master Nov 20, 2023
17 checks passed
@trafico-bot trafico-bot bot added ✨ Merged Pull Request has been merged successfully and removed ✨ Merged Pull Request has been merged successfully labels Nov 20, 2023
@MatissJanis
Copy link
Member

And also thanks @MikesGlitch for the assist!

FlorianLang06 pushed a commit to FlorianLang06/actual that referenced this pull request Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants