Research how settings for users can be saved #173

Closed
opened 2026-04-08 07:23:51 +00:00 by a24timsv · 11 comments
Collaborator

The user should be able to save, load and edit its dashboard, as mentioned in #87. In order for this to work something needs to be saved as a settings or config file (or something else).

Parent issue: #65

The user should be able to save, load and edit its dashboard, as mentioned in #87. In order for this to work something needs to be saved as a settings or config file (or something else). Parent issue: #65
Collaborator

This has been assigned to Alexander L, but he hasnt got permissions yet.

This has been assigned to Alexander L, but he hasnt got permissions yet.
Collaborator

idea of possible solution


Directory "config":

Collection of all possible settings the user can enable.

  • Palettes/ (dir with different styles such as purple,blue,green etc)
    • green.css
    • purple.css
  • Fonts? (Fonts for specific text "normal, mono, fancy, other languages etc..." )
  • Style (such as light/dark mode)
  • Globals? (General css, standard variables/properties.)

Settings (User conf obj.)

When the user changes the settings a "master" settings file should be generated (gets overwritten once created). This file should hold ONLY current settings to ensure the code knows that settings is in use.
ex:

  • userid: admin1
  • settings
    • theme: dark
    • palette: blue
    • fontSize: "large"
    • language: en

rough sketch:

## idea of possible solution - - - - ### Directory "config": Collection of all possible settings the user can enable. - Palettes/ (dir with different styles such as purple,blue,green etc) - green.css - purple.css - Fonts? (Fonts for specific text "normal, mono, fancy, other languages etc..." ) - Style (such as light/dark mode) - Globals? (General css, standard variables/properties.) ### Settings (User conf obj.) When the user changes the settings a "master" settings file should be generated (gets overwritten once created). This file should hold **ONLY** current settings to ensure the code knows that settings is in use. ex: - userid: admin1 - settings - theme: dark - palette: blue - fontSize: "large" - language: en rough sketch:
Author
Collaborator

I'm guessing then that the config file would be saved on a server (our server) so that the settings are saved regardless of device?

I'm guessing then that the config file would be saved on a server (our server) so that the settings are saved regardless of device?
Collaborator

Yes, perhaps it could be saved on our server in a file like "user_123.json" and on login it fetches that specific users settings file..

Yes, perhaps it could be saved on our server in a file like "user_123.json" and on login it fetches that specific users settings file..
Collaborator

The model is quite hard to interpret, could we perhaps make it a little less rough?

The model is quite hard to interpret, could we perhaps make it a little less rough?
e24aleli added reference #173-Save-User-Settings 2026-04-09 12:52:06 +00:00
Collaborator

Visualization of my thought process how user settings can be saved with postgresql to ensure that the settings persists regardless of device.

When the user changes the appearance they have to name their custom layout preset which gets saved in the database. There should always be a default layout incase the user is new or they dont want to change anything. When fetching the layout the program should look for "preset" that the user has selected in their settings. The config directory should contain every option and also store the UUID to make it possible to fetch that users specific preset. The JSON or the "master config" should only contain the selected options. This file is the preset that gets applied to the interface.

This is how i believe the user settings can be saved.


Furthermore, to make the settings apply on startup perhaps we can implement some cache that stores what preset a user last had enabled.

Draw.io link:
https://drive.google.com/file/d/1xln_3-kEF8bilJRZD2FJS6nRwMfbmPyT/view?usp=sharing


Another way of showing the flow is my quickshell i worked on a while ago which has an identical structure (except that its locally saved)
https://github.com/Liligirthlord/numbshell/tree/main/quickshell/Config

Visualization of my thought process how user settings can be saved with postgresql to ensure that the settings persists regardless of device. When the user changes the appearance they have to name their custom layout preset which gets saved in the database. There should always be a default layout incase the user is new or they dont want to change anything. When fetching the layout the program should look for "preset" that the user has selected in their settings. The config directory should contain every option and also store the UUID to make it possible to fetch that users specific preset. The JSON or the "master config" should only contain the selected options. This file is the preset that gets applied to the interface. This is how i believe the user settings can be saved. - - - Furthermore, to make the settings apply on startup perhaps we can implement some cache that stores what preset a user last had enabled. **Draw.io link:** https://drive.google.com/file/d/1xln_3-kEF8bilJRZD2FJS6nRwMfbmPyT/view?usp=sharing - - - Another way of showing the flow is my quickshell i worked on a while ago which has an identical structure (except that its locally saved) https://github.com/Liligirthlord/numbshell/tree/main/quickshell/Config
Collaborator

a24vinla has been assigned as reviewer.

a24vinla has been assigned as reviewer.
Collaborator

Model looks really good!

I have some questions regarding the config directory. Is it a separate database or a directory on a local server? Since the saved data will be minimal, is there a major upside to storing the actual layout data separately? My idea was to store it all in the same DB, with layouts being their own tables.

Model looks really good! I have some questions regarding the config directory. Is it a separate database or a directory on a local server? Since the saved data will be minimal, is there a major upside to storing the actual layout data separately? My idea was to store it all in the same DB, with layouts being their own tables.
Collaborator

Obviously user information would be stored separately, with some type of UID being used to reference users once logged in.

Obviously user information would be stored separately, with some type of UID being used to reference users once logged in.
Collaborator

This was the one thing I was unsure about. When I made the model I was thinking of a directory on a local server I just didn't know how to draw it clearly. But I dont know how it work out in practice.

As for the question regarding the layout storing, yes that was my idea too to store the config directory with its sub directories on the same db my apologies for confusion in the model.

This was the one thing I was unsure about. When I made the model I was thinking of a directory on a local server I just didn't know how to draw it clearly. But I dont know how it work out in practice. As for the question regarding the layout storing, yes that was my idea too to store the config directory with its sub directories on the same db my apologies for confusion in the model.
Collaborator

This issue has been researched. I close this issue.

This issue has been researched. I close this issue.
Sign in to join this conversation.
No milestone
No project
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Andras/BoundlessFlowCampus2K#173
No description provided.