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

✨ Allow pages to override theme #752

Merged
merged 1 commit into from
Jun 23, 2022

Conversation

marekful
Copy link
Contributor

@marekful marekful commented Jun 22, 2022

marekful Medium marekful /FEATURE/page-theme-override → Lissy93/dashy Commits: 1 | Files Changed: 2 | Additions: 16 Label Unchecked Tasks

Category:

One of: Feature

Overview

This is probably the simplest way to achieve a page theme override feature and, as such, is not very scalable. A page theme can only be defined in its yaml file e.g.

appConfig:
  theme: page-theme
pageInfo:
...

and Dashy is not able to handle the overrides (other than apply the theme).

A better solution would be to introduce pageConfig as a top level element in the schema which is always ignored for the main conf.yml , and overrides certain attributes in appConfig for pages (e.g. statusCheckInterval and widgetsAlwaysUseProxy would make sense in addition to theme).

Weighing the overall benefits versus the size of the change needed to appropriately realise that ^^, however, I'd consider this solution sufficient for the time being. What do you think?

Also, I didn't test this with history routing mode.

Screenshot (if applicable)

Screen.Recording.2022-06-22.at.19.17.03.mov

Code Quality Checklist (Please complete)

  • All changes are backwards compatible
  • All lint checks and tests are passing
  • There are no (new) build warnings or errors
  • (If a new config option is added) Attribute is outlined in the schema and documented
  • (If a new dependency is added) Package is essential, and has been checked out for security or performance
  • Bumps version, if new feature added

@marekful marekful requested a review from Lissy93 as a code owner June 22, 2022 19:11
@viezly
Copy link

viezly bot commented Jun 22, 2022

Changes preview:

Legend:

👀 Review pull request on Viezly

@netlify
Copy link

netlify bot commented Jun 22, 2022

Deploy Preview for dashy-dev ready!

Name Link
🔨 Latest commit 2933df2
🔍 Latest deploy log https://app.netlify.com/sites/dashy-dev/deploys/62b36948c49dcc000802e695
😎 Deploy Preview https://deploy-preview-752--dashy-dev.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Owner

@Lissy93 Lissy93 left a comment

Choose a reason for hiding this comment

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

Looks good 👍

I definitely need to do a huge refactor to wthe whole data store and config schema. It was okay when the app was much smaller, but now it's gotten quite confusing as the app has grown. So nice work deciphering it!

You're idea of having a pageConfig is a good one. I would need to make sure that some attributes (like auth) cannot be overridden by sub-pages, but that should be pretty straightforward.

@Lissy93 Lissy93 merged commit 90163dd into Lissy93:master Jun 23, 2022
@marekful
Copy link
Contributor Author

It was okay when the app was much smaller, but now it's gotten quite confusing as the app has grown.

Been there :) Dashy is 🥇

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.

2 participants