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

Feature request: Auto dark mode #167

Closed
si458 opened this issue Aug 31, 2020 · 8 comments · Fixed by #187
Closed

Feature request: Auto dark mode #167

si458 opened this issue Aug 31, 2020 · 8 comments · Fixed by #187
Labels
enhancement New feature or request

Comments

@si458
Copy link
Contributor

si458 commented Aug 31, 2020

It would be amazing if the app detected if the mobile device was running in dark mode or not and activate it accordingly

I have found a plug-in which might help with the detection automatically in capacitor

https://www.npmjs.com/package/capacitor-dark-mode

@ricoberger
Copy link
Member

Hi, automatic dark mode detection is done via

darkMode: window.matchMedia('(prefers-color-scheme: dark)').matches,
. This wouldn't apply when the app was installed before this automatic detection was available, because the value is already saved https://github.com/kubenav/kubenav/blob/master/src/utils/storage.ts#L131.

So if you reinstall the app, the app should start in dark mode when it is set as the systems default.

@si458
Copy link
Contributor Author

si458 commented Aug 31, 2020

Hi,

ok so ive removed the app, and then reinstalled it via testflight (2.2.2), and indeed it does work
BUT ONLY ON THE APP START UP, so a feature request maybe for while the app is running?

if you load the app up in say light mode, go into the phones settings and change to dark mode, then go back into the app,
its still stuck on light mode until you terminate the app and reopen it for it to show in dark mode,

and its the same visa-versa

@ricoberger
Copy link
Member

ricoberger commented Aug 31, 2020

Sure we can keep this as feature request.

With the current logic this would be difficult to implement. As a first quick idea: We can replace the IonToggle component in the settings with an IonSelect component. The possible values should be sth. like System, Dark and Light. This also requires a new settings value to not conflict with existing installations (maybe settings.theme).

@ricoberger ricoberger added the enhancement New feature or request label Aug 31, 2020
@si458
Copy link
Contributor Author

si458 commented Aug 31, 2020

in theory the plugin i mentioned above shows it can detect the system change
so you could do an on event IFdark mode THEN flip switch on ELSEflip switch off

i would really love to help! but i just dont understand react or ionic, they are far to complicated :(

give me standalone html+js+css any day of the week

@ricoberger
Copy link
Member

Hi @si458, automatic theme changing (when the system theme is changed) is now supported. You can try out this feature with the following build: https://github.com/kubenav/kubenav/actions/runs/258083315

@si458
Copy link
Contributor Author

si458 commented Sep 16, 2020

Hi @ricoberger
Brilliant thank you!
Any chance of doing a new TestFlight release?
I don't really use the dark mode on laptop, only my iPhone/iPad

@ricoberger
Copy link
Member

I want to submit a new TestFlight version by the end of the week. First I want to take a look at #178, wich I also want to include in the next beta version 🤞

@si458
Copy link
Contributor Author

si458 commented Sep 17, 2020

Hi @ricoberger
brilliant, seems to work on mac no problem! cant wait for mobile version now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants