Budibase / budibase

Low code platform for building business apps and workflows in minutes. Supports PostgreSQL, MySQL, MariaDB, MSSQL, MongoDB, Rest API, Docker, K8s, and more 🚀
https://budibase.com
Other
22.79k stars 1.58k forks source link

Remove lightest and dark themes and add core types and utils for themes #14858

Closed aptkingston closed 1 month ago

aptkingston commented 1 month ago

Description

This PR removes the lightest and dark theme options.

I've also cleaned up and improved our management of themes in the codebase, adding a proper enum and type for metadata, moving utils into shared-core and using them across the board.

We previously stored themes different in the builder and client app (sometimes prefixed with spectrum-- and sometimes not) and the code was littered with magic strings. We now also have proper constants for the available and default themes for apps and the builder.

In terms of backwards compatibility:

qa-wolf[bot] commented 1 month ago

QA Wolf here! As you write new code it's important that your test coverage is keeping up. Click here to request test coverage for this PR!

aptkingston commented 1 month ago

Just sign-off on the few changes in packages/server, haven't reviewed the majority of stuff but don't want you getting stuck on CODEOWNER approval. 🙂

Cheers Sam. Added a few basic sanity tests for the shared-core utils there too.

aptkingston commented 1 month ago

LGTM

Just wondering if there's actually any need to have logic to perform the fallbacks etc. Can we just remove the option to select it as a theme, and keep it around behind the scenes for apps/builders that currently use it?

I would have, but it presents a few problems:

I've tried to alleviate the pain of that by moving to the closest match though, so lightest will become light, and dark will become darkest. So it's not as if there should be huge visual differences at least.

If you think it's too much to force migrate them at all though then we can shelve this for now. Doesn't need to go in.