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

Add a configuration window on the UI #2

Open
haruspeks opened this issue Jul 30, 2024 · 5 comments
Open

Add a configuration window on the UI #2

haruspeks opened this issue Jul 30, 2024 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@haruspeks
Copy link
Collaborator

The configuration module already supports read and write from sessionStorage and localStorage. A dialog modal could be added on the frontend to let users configure Avoc directly on the UI instead of relying solely on the configuration.js file.

@haruspeks haruspeks added the enhancement New feature or request label Jul 30, 2024
@haruspeks haruspeks self-assigned this Jul 30, 2024
@roberrrt-s
Copy link

roberrrt-s commented Jul 31, 2024

https://caniuse.com/?search=dialog

Will impact the browser versions, but probably the best option. Let me know if you're okay with it and I'll shoot in a PR

@haruspeks
Copy link
Collaborator Author

Dialogs have been implemented already for the weather and shortcuts modal, so no problem in using them.

If you want to have a go at it, be my guest!

Although the architecture should be fairly straightforward, I'll just leave a couple of notes:

  1. dialog open/close toggle is handled by Alpine using the x-ref directive leveraging Pico's modal component: $refs.nameoftheModal.addAttribute('open') and $refs.nameoftheModal.removeAttribute('open')
  2. the Configuration class already reads both session/local storage and the configuration.js, so it should only be a matter of adding a set method, and then expose the object to Alpine by adding a store on the alpine:init listener
  3. self.configuration.language is just a ISO 639 alpha-2 string at the moment, I will prepare a PR to add a static list of supported languages
  4. as per self.configuration.screens, handling the compatibility between provider and type might be a bit of a brainy exercise; I'm open to any idea on how to handle that

@haruspeks
Copy link
Collaborator Author

New method that exposes supported languages has been added, see PR#3

@GalenReich
Copy link
Collaborator

Late to the party, but want to definitely +1 this issue.

Some suggestions on the different layers of configuration. There could be a top level configuration of number of screens and their respective types. Then each screen could be populated with a drop-down allowing users to switch between supported types for which an API key exists.

If you are still interested @roberrrt-s, I can formally assign you!

@roberrrt-s
Copy link

Late to the party, but want to definitely +1 this issue.

Some suggestions on the different layers of configuration. There could be a top level configuration of number of screens and their respective types. Then each screen could be populated with a drop-down allowing users to switch between supported types for which an API key exists.

If you are still interested @roberrrt-s, I can formally assign you!

Sounds like a plan, I'll schedule some work to do in a week (10th of Sept) since I'm covered in deadlines until then.

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

No branches or pull requests

3 participants