-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Ignore diacritics (accents) in search #21150
Conversation
WalkthroughWalkthroughThe updates aim to enhance search functionality across various components by incorporating the Changes
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (1)
Additional context usedBiome
Additional comments not posted (2)
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: 6
Outside diff range comments (5)
src/panels/lovelace/editor/card-editor/hui-card-picker.ts (1)
Line range hint
162-162
: Replace non-null assertions with optional chaining.The usage of non-null assertions (!) is risky as it assumes the existence of an object without validation. Replace these with optional chaining (?) to prevent runtime errors.
- this.hass!.localize(...) + this.hass?.localize(...) - this.shadowRoot!.getElementById("content") + this.shadowRoot?.getElementById("content") - fireEvent(this, "config-changed", { config }); + fireEvent(this, "config-changed", { config });Also applies to: 175-175, 187-187, 205-205, 210-210, 226-226, 243-243, 244-244, 248-248, 249-249, 257-257, 260-260, 324-324, 327-327, 353-353, 372-372, 403-403, 426-426, 427-427
src/panels/config/integrations/dialog-add-integration.ts (4)
Line range hint
157-157
: Replace non-null assertion with optional chainingUsing non-null assertions can lead to runtime errors if the object is null. Replace it with optional chaining for safer code.
- this.shadowRoot!.querySelector("mwc-list")?.getBoundingClientRect(); + this.shadowRoot?.querySelector("mwc-list")?.getBoundingClientRect();
Line range hint
192-192
: Refactor due to excessive cognitive complexityThe function has a high cognitive complexity. Consider breaking it down into smaller, more manageable functions to improve readability and maintainability.
Consider extracting parts of the function into separate methods or using more descriptive helper functions to handle specific parts of the logic.
Line range hint
297-297
: Replace non-null assertions with optional chainingUsing non-null assertions can lead to runtime errors if the object is null. Replace it with optional chaining for safer code.
- this.shadowRoot!.querySelector(`[data-domain=${domain}]`) + this.shadowRoot?.querySelector(`[data-domain=${domain}]`)Also applies to: 298-298
Line range hint
537-537
: Refactor due to excessive cognitive complexityThe function has a high cognitive complexity. Consider breaking it down into smaller, more manageable functions to improve readability and maintainability.
Consider extracting parts of the function into separate methods or using more descriptive helper functions to handle specific parts of the logic.
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: 1
Outside diff range comments (4)
src/panels/config/integrations/dialog-add-integration.ts (4)
Line range hint
157-157
: Replace non-null assertion with optional chainingThe non-null assertion operator is used, which might lead to runtime errors if not handled properly. Replace with optional chaining for safer access.
- this.shadowRoot!.querySelector("mwc-list")?.getBoundingClientRect(); + this.shadowRoot?.querySelector("mwc-list")?.getBoundingClientRect();
Line range hint
192-192
: Reduce complexity in_filterIntegrations
functionThe
_filterIntegrations
function is flagged for excessive complexity. Consider breaking it down into smaller, more manageable functions or simplifying the logic.Consider extracting parts of the logic into separate methods or using more streamlined logic constructs.
Line range hint
297-298
: Replace non-null assertion with optional chainingThe non-null assertion operator is used multiple times, which might lead to runtime errors if not handled properly. Replace with optional chaining for safer access.
- this.shadowRoot!.querySelector("mwc-list")?.getBoundingClientRect(); - this.shadowRoot!.querySelector("mwc-list")?.getBoundingClientRect(); + this.shadowRoot?.querySelector("mwc-list")?.getBoundingClientRect(); + this.shadowRoot?.querySelector("mwc-list")?.getBoundingClientRect();
Line range hint
537-537
: Reduce complexity in_handleIntegrationPicked
functionThe
_handleIntegrationPicked
function is flagged for excessive complexity. Consider breaking it down into smaller, more manageable functions or simplifying the logic.Consider extracting parts of the logic into separate methods or using more streamlined logic constructs.
Proposed change
Searching with accents will now match in filter/search.
This will work for automation editor dialog, data table, quick bar, etc...
I also created a PR on Fuse repository to add this option and then avoid workaround when we use Fuse : krisk/Fuse#773
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed:
Summary by CodeRabbit
New Features
Bug Fixes