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

Chore/user config handling and performance fixes #2856

Open
wants to merge 36 commits into
base: feat/make-classification-and-criticality-optional
Choose a base branch
from

Conversation

Hellgartner
Copy link
Contributor

Summary of changes

Exchange the current setup for using electron settings in the frontend with

  • Make sure all of the configuration are always set, this reduces the need for defaults
  • Do not use the variables section but create a dedicated redux store for user config
  • Sync this store directly at frontend startup -- before any rendering happens
  • Register one central handler which forwards any user settings changes to the store
  • Using user settings is then only a normal use on the store
  • Note that writing user settings from the frontend still requires and IPC call to the backend.

Context and reason for change

The current setup for the user configuration does not scale to the higher number of uses.
Using useUserSetting leads to a lot of

useIpcRenderer(
    AllowedFrontendChannels.UserSettingsChanged, ...

handlers being registered. This has a few unpleasant consequences:

  • On any change of any user setting all these handlers fire.
  • All these handlers cause a write to the redux store and thus re-renders.
  • Hooks for these variables are used in the App.tsx causing re-renders of the entire app on change

This makes even handling small files hard to work with and makes the app crash on larger, more realistic, files.

How can the changes be tested

Full regression test

Note: Please review the guidelines for contributing to this repository.

@Hellgartner Hellgartner linked an issue Mar 14, 2025 that may be closed by this pull request
@Hellgartner Hellgartner force-pushed the chore/user-config-handling-and-performance-fixes branch from 0a59632 to 0f3855f Compare March 19, 2025 08:00
tests showed: electron-settings do not reliably update if multiple updates are pending at the same time

Signed-off-by: Dominikus Hellgartner <[email protected]>
Signed-off-by: Dominikus Hellgartner <[email protected]>
Signed-off-by: Dominikus Hellgartner <[email protected]>
@Hellgartner Hellgartner marked this pull request as ready for review March 19, 2025 12:40
@mstykow mstykow self-assigned this Mar 19, 2025
Note: Now the old signal for fetching a single backend information should be unused

Signed-off-by: Dominikus Hellgartner <[email protected]>
only allow one channel to get the full user-settings information from the backend

Signed-off-by: Dominikus Hellgartner <[email protected]>
… chore/user-config-handling-and-performance-fixes

 Conflicts:
	src/ElectronBackend/main/main.ts
	src/ElectronBackend/main/menu/viewMenu.ts
	src/shared/shared-types.ts
in order to avoid clashes with react naming where a provider
has a fixed meaning

Signed-off-by: Dominikus Hellgartner <[email protected]>
only allow one channel to get the full user-settings information from the backend

Signed-off-by: Dominikus Hellgartner <[email protected]>
Fixed bug:
* User selects one of the switchable columns for ordering
* User switches that column off
* User clicks on Name
Without the fix, the sorting direction for names would not change as expected

Signed-off-by: Dominikus Hellgartner <[email protected]>
Signed-off-by: Dominikus Hellgartner <[email protected]>
instead of multiple selectors

Signed-off-by: Dominikus Hellgartner <[email protected]>
@Hellgartner Hellgartner requested a review from mstykow March 24, 2025 16:05
Hellgartner and others added 4 commits March 25, 2025 07:26
…s-table

feat: respect settings for showing also in overview table
Signed-off-by: Dominikus Hellgartner <[email protected]>
… chore/user-config-handling-and-performance-fixes
Copy link
Member

@mstykow mstykow left a comment

Choose a reason for hiding this comment

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

This diff now mixes in changes for classification and criticality that in previous versions were not present. This makes it harder to do a review and I don't think any of this is intended.

Copy link
Member

@mstykow mstykow left a comment

Choose a reason for hiding this comment

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

I think we're almost good to go now.

@Hellgartner Hellgartner requested a review from mstykow March 25, 2025 12:44
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.

Make display of classification and criticality optional
2 participants