-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Improve error messages in config entries #20934
Conversation
Warning Rate limit exceeded@piitaya has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 29 minutes and 18 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe updates to the Changes
Sequence Diagram(s) (Beta)Silently ignored as the changes are too specific and do not modify the overall control flow significantly. Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 2
Outside diff range comments (3)
src/panels/config/integrations/ha-config-integration-page.ts (3)
Line range hint
169-169
: Avoid using non-null assertions unless absolutely necessary as they bypass TypeScript's strict null checks.- this.hass!.localize("ui.common.disable") + this.hass?.localize("ui.common.disable")
Line range hint
333-333
: Use simple strings instead of template literals when there is no dynamic content.- `ui.panel.config.integrations.integration_page.attention_entries` + "ui.panel.config.integrations.integration_page.attention_entries"Also applies to: 448-448, 501-501, 530-530, 762-762, 780-780, 796-796
Line range hint
905-905
: Avoid usingany
type. Specify a more precise type to improve type safety and code maintainability.- catch (err: any) { + catch (err: unknown) {Also applies to: 906-906, 908-908, 950-950, 1066-1066, 1072-1072, 1078-1078, 1084-1084, 1090-1090, 1096-1096
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.
That's more or less how the new list-item works. The more you put in the "end" slot, the more width you'll lose of the content. Do you have a suggestion? |
Can we remove this change on this PR so we have fix for the beta? I will discuss that change with the UI/UX team to see how we can better display the error on this page. |
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.
Actionable comments posted: 0
Outside diff range comments (1)
src/panels/config/integrations/ha-config-integration-page.ts (1)
Line range hint
686-802
: Refactor the_renderConfigEntry
method to avoid non-null assertions and improve type safety.- class=${classMap({ - config_entry: true, - "state-not-loaded": item!.state === "not_loaded", - "state-failed-unload": item!.state === "failed_unload", - "state-setup": item!.state === "setup_in_progress", - "state-error": ERROR_STATES.includes(item!.state), - "state-disabled": item.disabled_by !== null, - })} + class=${classMap({ + config_entry: true, + "state-not-loaded": item?.state === "not_loaded", + "state-failed-unload": item?.state === "failed_unload", + "state-setup": item?.state === "setup_in_progress", + "state-error": item ? ERROR_STATES.includes(item.state) : false, + "state-disabled": item?.disabled_by !== null, + })}Tools
Biome
[error] 763-763: Do not use template literals if interpolation and special-character handling are not needed.
[error] 781-781: Do not use template literals if interpolation and special-character handling are not needed.
[error] 797-797: Do not use template literals if interpolation and special-character handling are not needed.
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Proposed change
#20764 has been a source of bugs during the beta. After fixing the config flow in second beta, it was still not possible to enable a config entry again since the new material list disable everything (there's an opacity layer and pointer-events none on the whole container). Also found some remaining items that started to show up wrongly in the config menu, I've converted those those menu-items as well.
Then lastly, decided to pull in ha-alerts to display the errors so we don't need custom logic.Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed:
Summary by CodeRabbit
New Features
ha-alert
elements for displaying different states.Style