Skip to content

Consolidate “dialog requested” events #1861

@jotaen4tinypilot

Description

@jotaen4tinypilot

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>.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions