| Commit message (Collapse) | Author | Age |
|
|
|
| |
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
|
| |
Use explicit prop threading to pass the MainStore to components, which
makes the data dependencies more explicit and enables better
testability.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
|
|
|
| |
The top-level Suspense might trigger before the StoreProvider sets the
store, which causes an error to be thrown in the useStore hook.
We pass the store explicitly as a prop into the components that should
load before the Suspense, which gets rid of the error.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
| |
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We render the location bar and notification banners separately for each
service and keep track of the BrowserView size separately for each
service to reduce the tearing that appears when people switch services.
The tearing cannot be eliminated completely, because it comes from the
separation between the main and renderer processes. But we can at least
try and reduce the IPC round-tripping and layout calculations required
to accurately position the services.
This approach has an overhead compared to the single
BrowserViewPlaceholder approach, because the renderer process has to
layout the location bar and notification for all services, not only the
selected one. The number of IPC messages during windows resize is also
increased. To compensate, we increase the throttle interval for resize
IPC messages and let electron itself resize the BrowserView between IPC
updates. (We must still keep pumping IPC messages during window resize,
because, e.g., changes in notification banner size due to re-layouting
will still affect the required BrowserView size).
If further reduction of IPC traffic is needed, we could implement
batching for resize IPC messages and more intelligent throttling via a
token bucker mechanism.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
|
|
|
| |
Show certificates with an interface modeled after firefox's certificate
viewer so that they can be inspected before trusting.
The current implementation assumes that each certificate has a unique
fingerprint (collisions are astronomically unlikely).
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
| |
Show a more prominent warning for insecure connections with a button
to try connecting over HTTPS if possible.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The location bar should be visible on error page to let people see and
change the URL if needed.
Additionally, it must be visible on insecure connections to show people
that the connection if not secure.
In the future, the location bar should also be shown if the loaded
website is uncommon in the context of the current service, i.e., it is
not explcitly allowlisted by the recipe.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
| |
Make sure we do not overflow the viewport with the location bar or the
error page.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Display an error page when page loading fails.
Error messages should be tweaked for messaging applications (not
browsers), because people won't neccessarily expect browser errors in
a messenger.
We still need a component to property show a certificate that failed
validation so people can decide whether to trust it temporarily.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
It seems moving the emotion cache into a separate file makes vite less
likely to try to hot-reload @emotion/cache (which would fail due to
creating the default cache twice).
We still have some vite hot reload problems, possibly connecte to
loading versions of react components with a different number of hook
calls.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
| |
We need a sylis plugin for this according to
https://mui.com/material-ui/guides/right-to-left/#3-install-the-rtl-plugin
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
| |
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
|
|
|
| |
Make sure the RendererStore is in a state consistent with the MainStore
before attempting to initialize the application.
This avoids, e.g., race conditions when trying to load the default
locale spuriously before loading the actually selected locale.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Due to https://github.com/i18next/i18next/issues/1564 we still have to
implement our own language resolution, but we can rely on
resolvedLanguage to determine which language to pass through to the
renderer.
We will use the language detected by chromium as the system locale, so
there is no need to use os-locale for detection any more.
We use i18next in the main process do resolve the language, then set the
resolve (not requested!) language in the renderer process to avoid doing
resolution twice. This avoids the need in the renderer process to know
the list of supported languages.
We set the language and the writing direction in HTML in the renderer.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Load localization according to either the environment or the
configuration file from the list of supported locales.
Ideally, we would also set the chromium locale with --lang, but by the
time we have read the config file (to known which locale to set),
electron has already initialized the chromium resource bundle.
So the chromium localization will always be auto-detected by chromium.
Also makes startup hopefully a bit faster by doing more things
concurrently while the localization and the main window is being loaded.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
| |
This should make the application load a tiny bit faster by delaying
loading the UI in parallel with setting up stores and localization.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
|
|
| |
We need mui and mobx-react-like support before we can upgrade.
See https://github.com/mobxjs/mobx/issues/2526 for discussion about the
ramifications of concurrent rendering for mobx.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
|
|
| |
Add react-i18n to make us able to use i18next translations in the
renderer process just like we do in the main process.
Translations are hot-reloaded automatically.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
| |
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
|
| |
* Add renderer code for notification banners with buttons
* Handle new window open requests by denying them and displaying
a notification
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
| |
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
| |
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
| |
Service icons fade out on errors and an icon is displayed.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
| |
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We use the 'certificate-error' event of webContents to detect
certificate verification errors and display a message to manually trust
the certificate.
Certificates are trusted per profile and only until Sophie is restarted.
We still need to build the associated UI, the current one is just a
rough prototype for debugging.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
| |
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
| |
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since electron doesn't have an API to extract the current certificate,
except in the case of certificate errors, there's no point in making the
security warning / padlock icon clickable.
We instead display a plain icon and a warning message.
We will later display the certificate details in case of a validation
error (when we have access to the certificate) as part of an error
message.
Also makes the security labels more visible to people with protanopia
who use the dark mode of the UI.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds a "failed" state for services where the BrowserView and WebContents
should be left around to keep history and allow people to navigate back.
Access to the browser history otherwise doesn't seem possible
(see https://github.com/electron/electron/issues/26727
and https://github.com/electron/electron/issues/7186),
so destroying BrowserView and managing our own history is not possible.
Also keep https://github.com/electron/electron/issues/24113 in mind.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
|
|
|
| |
The buttons and the text field in the location bar shall now affect the
BrowserView of the loaded service.
Some error handling is still needed, e.g., when loading a web page fails
due to a DNS error.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allows customization of stores both in the renderer and in the main
process. Instead of exposing a basic model type from the shared module
(which was be overwritted with more specific props in the main package),
we expose factory function that can create specific model types in
both the renderer and the main process.
Using these package-specific customization to stores, the renderer
package can attach IPC calls directly to store objects, which the main
package can attach the handlers for IPC calls and other internal
actions.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
| |
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
|
|
|
| |
InputBase paddings are idiosyncratic if there is both a start and an end
adornment. To simplify the styles, we override the styling from InputBase
and compute our own paddings.
The animated color change when switching from a secure site to an
insecure one was distracting, so we disable color animations in the
location bar.
|
|
|
|
|
|
| |
Still needs adding event handlers to actually navigate the browser.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
|
|
| |
* Update the browser view size more quickly (negligible CPU usage
overhead)
* Style the body element by default instead of the html element for
better compatibility with website CSS.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
| |
|
|
|
|
|
|
|
| |
Sophie start off from the service that was selected when it was last
open.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
|
|
| |
Make sure that files have a default import with the same name as the
file whenever possible to reduce surprise.
Also shuffles around some file names for better legibility.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
| |
Makes sure that the renderer always sees a consistent state.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Now the runtime state lives inside the model (instead of being
associated to the static settings via a map), which simplifies state
management. Static settings are now located inside the runtime models,
so we must create tests to make sure that the settings are being
persisted correctly. The contents of the config file are now generated
as a view of store (instead of a snapshot), which adds flexibility.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
| |
Lets the main process see which service is currently selected.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
| |
Stores transient state for services shared between the main and renderer
processes.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
| |
Currently, they do nothing.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
| |
Non-integer coordinates make electron throw the error and the reaction
to synchronize the BrowserView position fail.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
| |
This would run as part of gitlab SAST (if it didn't time out).
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
| |
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
| |
eslint will also enforce prettier rules, so there is no need to call
prettier separately in CI.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
|
|
|
|
|
| |
See https://github.com/typescript-eslint/typescript-eslint/issues/3851
Also upgrades dependencies and simplifies eslint config (used during
debugging this issue to eliminate other possible sources of errors.)
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|
|
|
|
| |
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
|