Skip to content

chore: add "user_configs" db table#16564

Merged
aslilac merged 23 commits into
mainfrom
lilac/user-configs
Mar 5, 2025
Merged

chore: add "user_configs" db table#16564
aslilac merged 23 commits into
mainfrom
lilac/user-configs

Conversation

@aslilac
Copy link
Copy Markdown
Member

@aslilac aslilac commented Feb 13, 2025

  • Adds a "user_configs" table

  • Moves the data from the "users"."theme_preference" column to this new table as a bit of a proof of concept

The idea is that this table will enable future feature development to have a nice spot to put user specific settings, like storing the state of dismissed notification banners, or other UI personalizations that we may add in the future. It could even be used to remember values from partial form completions, or all manner of other things, (and in a place where they can later be invalidated by the backend, rather than put in localStorage)

@aslilac aslilac requested a review from Emyrk February 18, 2025 17:39
@aslilac aslilac marked this pull request as ready for review February 18, 2025 17:39
@github-actions github-actions Bot added the stale This issue is like stale bread. label Feb 26, 2025
@aslilac
Copy link
Copy Markdown
Member Author

aslilac commented Feb 27, 2025

pls don't close my pr github

@aslilac aslilac removed the stale This issue is like stale bread. label Feb 27, 2025
Comment thread coderd/audit.go
Comment thread coderd/database/dump.sql
Comment thread codersdk/users.go
@aslilac aslilac requested review from johnstcn and removed request for Emyrk March 5, 2025 00:33
Comment thread coderd/database/migrations/000297_user_configs.down.sql
@aslilac aslilac merged commit 9041646 into main Mar 5, 2025
@aslilac aslilac deleted the lilac/user-configs branch March 5, 2025 17:46
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 5, 2025
@ethanndickson
Copy link
Copy Markdown
Member

ethanndickson commented Mar 6, 2025

Since we're no longer sending the theme_preference in api/v2/users responses, should this be labelled as a breaking API change?
Context: coder/coder-desktop-macos#91

@johnstcn
Copy link
Copy Markdown
Member

johnstcn commented Mar 6, 2025

@ethanndickson would it suffice to re-add the field in the /api/v2/users response but mark it as deprecated?

EDIT: this was already done as part of this PR, the only other change was adding omitempty.

@ethanndickson
Copy link
Copy Markdown
Member

ethanndickson commented Mar 6, 2025

I think the change is fine honestly, but if it's breaking our own Coder integration (desktop), it's possible it could break someone else's.
..In saying that, I doubt people are actively consuming theme_preference. If it does break something, it's probably just because they expected the field to be present like I did on desktop.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants