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

Consolidate “dialog requested” events #1861

Open
jotaen4tinypilot opened this issue Dec 9, 2024 · 0 comments
Open

Consolidate “dialog requested” events #1861

jotaen4tinypilot opened this issue Dec 9, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@jotaen4tinypilot
Copy link
Contributor

jotaen4tinypilot commented Dec 9, 2024

We currently have a significant number of events that trigger opening a dialog – e.g. shutdown-dialog-requested, update-dialog-requested, etc. We also currently register these events at <menu-bar> level, not at document level.

The downsides of this are that it’s hard to keep track of all these individual event ids (which we must ensure are globally unique), and that we cannot trivially trigger a dialog from anywhere outside the <menu-bar> (e.g., from another dialog). See discussion at #1860.

So we could consolidate all those ...-dialog-requested events into a single DialogRequestedEvent that would live in events.js. That way, we reduce the overall number of event ids that we have to manage, and we can simplify our event handler registration code.

When we do this, we should also refactor any places outside of app.js where we reference the <menu-bar> to inject events directly – such as in the <wifi-dialog>.

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

1 participant