WIP: user_settings app #34

Closed
tasiaiso wants to merge 10 commits from tasiaiso/tildefriends:user_settings into main
Contributor

Closes #10.

Changelog

  • A new app has been added, user_settings.
    • The user can select a theme from a list of preinstalled themes (in the future, users could import their own themes, but this is a problem for future me).
    • The user can manage their SSB identities (add, import, export, delete). This replaces the identity app.
    • The user can change their password and delete their account (this is not currently implemented).
  • The identity app has been removed.
  • The tildefriends.css stylesheet is now globally available at /static/tildefriends-v1.css

New RPC methods (to implement on the backend):

  • getThemes(): string[]

Returns a list of the available themes as an array of strings; ['solarized', 'gruvbox', 'light'].

  • getTheme(): string

Returns the user's selected theme.

  • setTheme(theme: string): void

Sets the user's preferred theme.

I just need a column in the database that stores a string. When an account is created, it should be filled with a default value (solarized). That also involves to migrate the old database to the new format.

To do

  • Implement the RPC methods (needs help from @cory)
  • The ability to change a user's password
  • The ability to delete an account
  • Improve the layout a bit
  • Remove the ability to change a user's password in auth.html
Closes #10. ## Changelog - A new app has been added, `user_settings`. - The user can select a theme from a list of preinstalled themes (in the future, users could import their own themes, but this is a problem for future me). - The user can manage their SSB identities (add, import, export, delete). This replaces the `identity` app. - The user can change their password and delete their account (this is not currently implemented). - The `identity` app has been removed. - The tildefriends.css stylesheet is now globally available at `/static/tildefriends-v1.css` New RPC methods (to implement on the backend): - `getThemes(): string[]` Returns a list of the available themes as an array of strings; `['solarized', 'gruvbox', 'light']`. - `getTheme(): string` Returns the user's selected theme. - `setTheme(theme: string): void` Sets the user's preferred theme. I just need a column in the database that stores a string. When an account is created, it should be filled with a default value (solarized). That also involves to migrate the old database to the new format. ## To do - Implement the RPC methods (needs help from @cory) - The ability to change a user's password - The ability to delete an account - Improve the layout a bit - Remove the ability to change a user's password in auth.html
tasiaiso added 2 commits 2024-02-23 04:52:45 -05:00
tasiaiso added 1 commit 2024-03-20 06:52:01 -04:00
tasiaiso added 1 commit 2024-03-21 14:25:55 -04:00
tasiaiso added 1 commit 2024-03-21 14:28:55 -04:00
tasiaiso added 2 commits 2024-03-21 14:33:26 -04:00
tasiaiso added 1 commit 2024-03-21 15:11:04 -04:00
tasiaiso requested review from cory 2024-03-21 15:42:59 -04:00
tasiaiso added 1 commit 2024-03-21 15:45:13 -04:00
tasiaiso added 1 commit 2024-03-21 17:30:04 -04:00
Author
Contributor

What do you think of this @cory ?

What do you think of this @cory ?
Owner

What do you think of this

I'm totally in for gathering managing identities and settings in one place. And making them not look like junk as I have.

I'm very hesitant about the coupling this introduces. I would honestly rather have every app have its own copy of the CSS it needs rather than expecting more static files be provided by Tilde Friends. Ideally the only contract would be that apps can find a theme name in some place in the database. I think that'd be my_shared_database('preferences') or similar, should be doable already without any core changes.

This isn't just a critique of this change, but it's on my mind to get better at this in general. To many bespoke functions are exposed to apps already. Need to strive to be more like an operating system where rather than get_theme_name(), you get open()/read()/close() and can build settings files yourself. That's a fundamental part of how I ever see building an app today that still works a few years down the road.

I'm also seriously considering advocating we stick with w3.css themes (https://www.w3schools.com/w3css/w3css_color_themes.asp). I don't have any particular affinity with w3schools, but I didn't have a terrible experience integrating it, it seems good enough, and it feels the right level of opinionated for me for now. I think it offers simplicity over growing our own.

That's not a complete picture of anything, but that's where my head is. I'm definitely willing to do some legwork once we're aligned.

> What do you think of this I'm totally in for gathering managing identities and settings in one place. And making them not look like junk as I have. I'm very hesitant about the coupling this introduces. I would honestly rather have every app have its own copy of the CSS it needs rather than expecting more static files be provided by Tilde Friends. Ideally the only contract would be that apps can find a theme name in some place in the database. I think that'd be `my_shared_database('preferences')` or similar, should be doable already without any core changes. This isn't just a critique of this change, but it's on my mind to get better at this in general. To many bespoke functions are exposed to apps already. Need to strive to be more like an operating system where rather than `get_theme_name()`, you get `open()/read()/close()` and can build settings files yourself. That's a fundamental part of how I ever see building an app today that still works a few years down the road. I'm also seriously considering advocating we stick with w3.css themes (https://www.w3schools.com/w3css/w3css_color_themes.asp). I don't have any particular affinity with w3schools, but I didn't have a terrible experience integrating it, it seems _good enough_, and it feels the right level of opinionated for me for now. I think it offers simplicity over growing our own. That's not a complete picture of anything, but that's where my head is. I'm definitely willing to do some legwork once we're aligned.
Author
Contributor

Is there a way to have shared or per-app databases already ? Is this a thing we'd want to look at implementing ?

Is there a way to have shared or per-app databases already ? Is this a thing we'd want to look at implementing ?
Owner

@tasiaiso See shared_database() and my_shared_database(). They give you somewhat namespaced key/value storage in the properties table.

I kicked around the idea of giving SQLite databases or something like a private filesystem, but everything I've wanted in practice so far has leaned toward using SSB for actual storage and key/value as a cache.

@tasiaiso See shared_database() and my_shared_database(). They give you somewhat namespaced key/value storage in the properties table. I kicked around the idea of giving SQLite databases or something like a private filesystem, but everything I've wanted in practice so far has leaned toward using SSB for actual storage and key/value as a cache.
Author
Contributor

I'm going to close this. I want to figure out a way to integrate this well into Tilde Friends. I'll make a new issue/PR later.

I'm going to close this. I want to figure out a way to integrate this well into Tilde Friends. I'll make a new issue/PR later.
tasiaiso closed this pull request 2024-05-30 05:39:41 -04:00

Pull request closed

Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 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: cory/tildefriends#34
No description provided.