-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Add new app panel #28214
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
base: dev
Are you sure you want to change the base?
Add new app panel #28214
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7b3873e to
60d00b8
Compare
60d00b8 to
42cb913
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on December 29
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| if (addon && addon !== oldAddon) { | ||
| this._loadingMessage = undefined; | ||
| this._fetchData(addon); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Toolbar state not reset when switching between addons
When switching between addons, the _hideToolbar and _iframeSubscribeUpdates state variables are not reset. If addon A subscribes with hideToolbar: true and the user then navigates to addon B which never subscribes, the toolbar remains hidden for addon B. These variables need to be reset in willUpdate when addon !== oldAddon, restoring them to their default values (false) before loading the new addon.
| }, 60000); | ||
|
|
||
| this._addon = addon; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Race condition when quickly switching between addons
When navigating between addons quickly, multiple concurrent _fetchData calls can race against each other. The code sets this._addon at line 298 without verifying that the fetched addonSlug still matches the current route. If a user navigates from addon A to addon B, but addon A's network request completes after addon B's, the UI will display addon A instead of the intended addon B. The function lacks either a mechanism to cancel stale requests or a check to verify the fetched addon matches the current _getAddonSlug() before updating state.
Breaking change
Proposed change
Currently the ingress logic still lives in the panel hosted by the supervisor. This PR makes it available inside Home Assistant without needing the
hassioJavaScript or iframe inside an iframe.As we're having an architecture discussion to rename add-ons to apps, I have named the panel app.
Also added the option to configure the add-on in the panel config, so backend can choose to register panels directly (debug UIs of Z-Wave, Matter, MQTT come to mind).
There is also an option for Home Assistant aware apps to subscribe to the narrow property, to allow hiding the toolbar on mobile, and provide their own interface. To do so, they can call the following functions from their embedded website:
And a test HTML I used for local testing:
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed:
Note
Introduces a new app panel that loads add-ons via ingress with session handling and iframe messaging, refactors route tail logic, and wires the panel into routing.
src/panels/app/ha-panel-app.tsto load add-ons via ingress iframe, including:computeRouteTailtosrc/data/route.tsand reuse inhass-router-pageandha-panel-app.appinpartial-panel-resolverand prevent disconnectingapppanel when hidden.lit/directives/refinbuild-scripts/rspack.cjs.ui.panel.app.*strings for app errors and actions.Written by Cursor Bugbot for commit 45b93c0. This will update automatically on new commits. Configure here.