tiny-pilot / tiny-pilot/tinypilot

Consolidate “dialog requested” events

Open
#1,861 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
3.5k
Forks
291
PR merge metrics
No merged PRs in 30d

Description

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 https://github.com/tiny-pilot/tinypilot/pull/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>.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read app/static/js/events.js and the dialog-triggering section of app/static/js/app.js first, then inspect the menu-bar references and the wifi-dialog example. Consolidate the dialog request events around the shared event and update external menu-bar injections; done means dialog requests use the common event path without the individual event ids or menu-bar dependency.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, javascript
Domain
frontend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.