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

Pass preferences to BrowserWindows via command line arguments #1131

Merged
merged 4 commits into from
Jan 28, 2025

Conversation

araujoarthur0
Copy link
Collaborator

Context / Background

The 3 browser windows we create from main start by doing a reverse call back into main to ask for the user preferences.
The idea of this PR is to pass the preferences as a stringfied JSON via the command line arguments of the Browser Windows. They can be retrieved on the renderer preload scripts from window.process.argv. That should speed up creation of windows and allows us to remove the ipcRenderer dependency function to get user preferences from the renderer.

What change is being introduced by this PR?

  • Passing in JSON preferences via args to browser windows. Picking up on renderer and using on $() functions
  • Creating a renderer-api.mjs file with reusable API functions between the 3 windows. Renamed the exposed APIs to have matching names per API.
  • Updated tests to match the new settings.
  • Removed ipcRenderer dependency inside preferences.mjs and some Promise methods.

How will this be tested?

App is working fine, tests are passing.

Copy link
Collaborator

@tupaschoal tupaschoal left a comment

Choose a reason for hiding this comment

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

Something is off, when testing, my workday waiver manager never gets the black theme applied (the same doesn't happen for the preferences).
image

@araujoarthur0
Copy link
Collaborator Author

Something is off, when testing, my workday waiver manager never gets the black theme applied (the same doesn't happen for the preferences). image

Weird, for me it's appearing dark. Do you see any errors in the dev tools console?

Copy link
Collaborator

@tupaschoal tupaschoal left a comment

Choose a reason for hiding this comment

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

Can't seem to reproduce anymore, go figure >.>

@araujoarthur0 araujoarthur0 merged commit f058e89 into TTLApp:main Jan 28, 2025
3 checks passed
@araujoarthur0 araujoarthur0 deleted the start-windows-args branch January 28, 2025 23:09
tupaschoal added a commit to tupaschoal/time-to-leave that referenced this pull request Feb 2, 2025
tupaschoal added a commit that referenced this pull request Feb 2, 2025
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.

2 participants