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

Fix long title for section in add card dialog #20863

Merged
merged 1 commit into from
May 24, 2024
Merged

Conversation

piitaya
Copy link
Member

@piitaya piitaya commented May 24, 2024

Breaking change

Proposed change

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

Summary by CodeRabbit

  • Improvements
    • Enhanced the responsiveness of the card creation dialog by adjusting its maximum and minimum width settings. The dialog now scales better on various screen sizes and maintains a minimum width of 1000px for improved usability.

This comment was marked as off-topic.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 and nitpick comments (1)
src/panels/lovelace/editor/card-editor/hui-dialog-create-card.ts (1)

Line range hint 93-93: Consider replacing non-null assertions with optional chaining or proper checks.

Using non-null assertions (!) can lead to runtime errors if the values turn out to be null or undefined. It's safer to use optional chaining (?.) where possible, or add necessary checks to ensure the values are not null before accessing their properties. Here's an example of how you might adjust one of the lines:

- const title = this._containerConfig.title ? this.hass!.localize(...) : this.hass!.localize(...);
+ const title = this._containerConfig.title ? this.hass?.localize(...) : this.hass?.localize(...);

This change helps prevent potential runtime errors and improves the robustness of your code.

Also applies to: 97-97, 121-121, 127-127, 156-156, 161-161, 229-229, 231-231, 233-233, 238-238, 239-239, 240-240, 278-278, 285-285, 300-300, 301-301, 302-302

@silamon silamon merged commit 34b9c7b into dev May 24, 2024
14 checks passed
@silamon silamon deleted the fix_long_title_section branch May 24, 2024 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Naming Section a large length name cause the add card window to go off screen
2 participants