Skip to content
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

20240904.0 #21876

Merged
merged 5 commits into from
Sep 4, 2024
Merged

20240904.0 #21876

merged 5 commits into from
Sep 4, 2024

Conversation

bramkragten
Copy link
Member

@bramkragten bramkragten commented Sep 4, 2024

Summary by CodeRabbit

  • New Features

    • Introduced a new HaBadge component for enhanced badge/button functionality.
    • Updated HuiEntityBadge and HuiErrorBadge components to utilize the new HaBadge for improved rendering and styling.
  • Improvements

    • Enhanced configurability of compression tasks for service worker and modern files.
    • Refactored data handling in the HaDataTable component for better performance and clarity.
  • Bug Fixes

    • Updated @codemirror/commands package to address minor issues.
  • Version Updates

    • Incremented version for home-assistant-frontend project and @codemirror/commands package.

renovate bot and others added 5 commits September 4, 2024 07:48
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* Move badge styling into ha-badge component to reuse it

* Fix error badge

* Update src/components/ha-badge.ts

Co-authored-by: Paulus Schoutsen <[email protected]>

---------

Co-authored-by: Paulus Schoutsen <[email protected]>
* Change update logic in ha-data-table

* use time of last request
@github-actions github-actions bot added the Build Related to building the code label Sep 4, 2024
Copy link
Contributor

coderabbitai bot commented Sep 4, 2024

Walkthrough

Walkthrough

The changes involve updates to several files, enhancing functionality and structure across the codebase. Key modifications include the addition of parameters for compression functions to control the inclusion of service worker files, updates to the versioning of dependencies, and the introduction of a new HaBadge component. Additionally, existing badge components have been refactored to utilize the new HaBadge, improving rendering logic and styling consistency.

Changes

File(s) Change Summary
build-scripts/gulp/compress.js Updated compressDistBrotli and compressDistZopfli functions to include new parameters for controlling service worker and modern file inclusion during compression.
package.json Updated @codemirror/commands package version from 6.6.0 to 6.6.1.
pyproject.toml Incremented version of "home-assistant-frontend" from "20240903.1" to "20240904.0".
src/components/data-table/ha-data-table.ts Replaced _items with _filteredData for data handling, added _lastUpdate, and restructured _groupData for efficiency.
src/components/ha-badge.ts Introduced HaBadge component, defining properties for badge/button functionality, rendering logic, and styling encapsulation.
src/panels/lovelace/badges/hui-entity-badge.ts Replaced error display structure with ha-badge component, simplifying rendering logic and improving styling consistency.
src/panels/lovelace/badges/hui-error-badge.ts Updated HuiErrorBadge to use ha-badge for error display, refactoring styles to enhance maintainability and consistency.

Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9c12ab9 and 6aa5bc2.

Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
Files selected for processing (7)
  • build-scripts/gulp/compress.js (2 hunks)
  • package.json (1 hunks)
  • pyproject.toml (1 hunks)
  • src/components/data-table/ha-data-table.ts (11 hunks)
  • src/components/ha-badge.ts (1 hunks)
  • src/panels/lovelace/badges/hui-entity-badge.ts (5 hunks)
  • src/panels/lovelace/badges/hui-error-badge.ts (2 hunks)
Files skipped from review due to trivial changes (2)
  • package.json
  • pyproject.toml
Additional context used
Biome
src/components/data-table/ha-data-table.ts

[error] 678-678: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

Additional comments not posted (18)
build-scripts/gulp/compress.js (4)

18-28: LGTM!

The changes to the compressDistBrotli function are implemented correctly and enhance its configurability by allowing control over the inclusion of the service worker file during compression.


32-40: LGTM!

The changes to the compressDistZopfli function are implemented correctly and enhance its configurability by allowing control over the exclusion of modern files during compression.


49-53: LGTM!

The change to the compressHassioBrotli function correctly passes false as the third argument to compressDistBrotli, ensuring that the service worker file is excluded from compression in the context of Hassio.


58-62: LGTM!

The change to the compressHassioZopfli function correctly passes true as the third argument to compressDistZopfli, ensuring that the modern files are included in compression in the context of Hassio.

src/panels/lovelace/badges/hui-error-badge.ts (2)

57-65: LGTM!

The changes improve the semantic structure and accessibility of the error badge by using the ha-badge component. The ha-badge component encapsulates the error display, taking advantage of its built-in properties such as label and type, which streamline the rendering process. The ha-badge component's appearance is consistent with the design system used throughout the application.


70-86: LGTM!

The styles associated with the badge have been refactored to target the ha-badge component. The previous styles were directly applied to the button and its child elements, while the new styles are now scoped to the ha-badge component. This change not only simplifies the CSS but also ensures that the badge's appearance is consistent with the design system used throughout the application. The error color is now applied through CSS variables, enhancing maintainability and theming capabilities.

src/components/ha-badge.ts (3)

1-6: LGTM!

The imports are correctly specified and necessary for the component.


7-149: LGTM!

The ha-badge custom element is well-structured and follows best practices for defining custom elements using LitElement. The properties, template, and styles are correctly defined.


151-155: LGTM!

Declaring the global interface HTMLElementTagNameMap ensures that the ha-badge custom element is recognized by TypeScript and can be used in other parts of the codebase.

src/panels/lovelace/badges/hui-entity-badge.ts (4)

14-14: LGTM!

The code changes are approved.


163-170: LGTM!

The code changes are approved.


206-231: LGTM!

The code changes are approved.


241-249: LGTM!

The code changes are approved.

src/components/data-table/ha-data-table.ts (5)

37-37: LGTM!

The code changes are approved.


180-181: LGTM!

The code changes are approved.


182-182: LGTM!

The code changes are approved.


209-212: LGTM!

The code changes are approved.


Line range hint 294-658: LGTM!

The code changes are approved. The refactoring improves the efficiency and readability of data filtering and rendering logic. The usage of the delete operator in this context is valid and does not significantly impact performance.


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Related to building the code cla-signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants