-
Notifications
You must be signed in to change notification settings - Fork 865
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
proof of concept: close Web UI window instead of hiding #1929
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that nothing changes for OS that does not have a menubar functionality: closing the window keeps the daemon running in the background, just like it was before.
I am supportive for this change, however there is a regression on the Status screen:
The bandwidth graph it no longer gets populated when the window does not exist, so the user does not have correct bandwidth utility usage (it gets "paused" until window is opened again).
To solve this, ipfs-desktop would have to keep polling the API and storing stats, and when a window is created inject them into historical data ipfs-webui uses for plotting the graph.
Not sure how feasible this is, thoughts?
You're right indeed.
I think it is possible to do. I will take a look later today! |
@lidel I also want to add here that I don't think I can fix the E2E tests easily: Spectron runs through the active windows so that means we cannot control the app if there's no active windows. In addition, Spectron is being deprecated. The most sensible alternative seems to be Playwright however I wonder if it'd suffer from the same issue since Electron apps were not built to be... menu bar apps. Do you think I should go ahead with collecting with metrics in the background? If we follow that route, we need to see what to do with the tests. |
I am afraid we don't have bandwidth for tackling those in parallel – i dont want you to invest time into feature which cant ship due to lack of tests. We should solve spectron problem (tracked in #1902) and when we have e2e test situation resolved, get back to this PR and figure out how we can make this change while keeping confidence provided by currently existing e2e tests (refactor them etc). |
If the attempt for this PR is to speed up the application, we can probably disregard it. There are multiple changes in flight that would make this change unnecessary, or at least cumbersome to do in parallel with.
|
@SgtPooki the main concern, mentioned in #1893, is actually the resources that the rendered process consumes in background. This PR would actually make the app slightly slower, as the Web UI Window would need to be completely rebuilt every time we open it. Right now, we just hide the window when the user closes, instead of actually closing it. |
refactor
closing this since there is a large rebase required and we don't have the bandwidth to focus on this right now |
This is a proof of concept for #1893. In this PR, the Web UI window is only created on demand, i.e., when we launch some URL on the Web UI or if the user explicitly set
openWebUIAtLaunch
totrue
. When the window is closed, it is actually closed and not hidden.Electron runs 4 processes: Electron, Electron Helper, Electron Helper (GPU) and Electron Helper (Renderer). Only the renderer process is killed by the window closing. The GPU process is still on.
Problems with this approach:
@lidel what do you think?