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

Update developer-tools-state.js: fix alignment for ha-tips #17608

Merged
merged 1 commit into from
Oct 9, 2023

Conversation

ildar170975
Copy link
Contributor

@ildar170975 ildar170975 commented Aug 17, 2023

Before:
image

After:
image

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

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

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:

@@ -98,6 +98,7 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) {
ha-tip {
display: flex;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove display: flex, I feel like ha-tip should handle that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W/o flex:
image

Copy link
Contributor Author

@ildar170975 ildar170975 Aug 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably the correct style should be defined for the "standard" ha-tip component. Now it is "block" - which looks ok when text-align=center:
image
but not ok when text-align=left:
image

So, probably we need to change a style for the ha-tip component itself (to display=flex).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can propose a PR for ha-tip component if you agree this way.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will need more than just display: flex (the icon changes size for example, and the text is not vertically centered) but yeah, that's fine by me.

Copy link
Contributor Author

@ildar170975 ildar170975 Aug 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with display: flex for the "ha-tip" component - and I do not like results.

Check this for some iPhone with the current default settings:
image

And with these:

    display: flex;
    justify-content: center;
    align-items: center;

image

Or with this (align-items: start):
image

The default style looks much nicer!
So I propose to use the display: flex style for Dev tools -> Set state only, not globally.

Another unrelated proposal: let's get rid of the "Tip!" label, the "bulb" icon is self-explanatory (btw this label is hidden in "Dev tools -> Set state"):

image

@bramkragten bramkragten merged commit 220b479 into home-assistant:dev Oct 9, 2023
@ildar170975 ildar170975 deleted the ildar170975-patch-1 branch November 14, 2023 13:59
@github-actions github-actions bot locked and limited conversation to collaborators Nov 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants