Skip to content

Add last_updated tooltip to more info dialog#6926

Merged
bramkragten merged 6 commits intohome-assistant:devfrom
pszafer:person_last_updated
Sep 29, 2020
Merged

Add last_updated tooltip to more info dialog#6926
bramkragten merged 6 commits intohome-assistant:devfrom
pszafer:person_last_updated

Conversation

@pszafer
Copy link
Contributor

@pszafer pszafer commented Sep 11, 2020

Proposed change

Currently entities shows only last_changed of state.
If person has state away for a long time (during work or travel somewhere etc.) it's impossible to say from ui when location was last updated and if it is still "valid".
It might be useful for all entities.

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

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • 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:

Copy link
Member

@ludeeus ludeeus left a comment

Choose a reason for hiding this comment

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

We should not inject state properties in the state attributes.

@pszafer
Copy link
Contributor Author

pszafer commented Sep 11, 2020

@ludeeus I changed it.
any thoughts how can I reuse css classes from HaAttributes?

@ludeeus
Copy link
Member

ludeeus commented Sep 11, 2020

Look at the styles used in that element, copy+paste -> adjust.

@pszafer
Copy link
Contributor Author

pszafer commented Sep 11, 2020

I copied them. I thought that maybe is more efficient way.

return html`
<ha-attributes
.stateObj=${this.stateObj}
extraFilters="id,user_id,editable"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
extraFilters="id,user_id,editable"
extra-filters="id,user_id,editable"

@bramkragten
Copy link
Member

I think we should do this differently, lets add it as a tooltip to the last changed time.

@pszafer
Copy link
Contributor Author

pszafer commented Sep 11, 2020

by tooltip do you mean tooltip to hover over last_changed?

@bramkragten
Copy link
Member

bramkragten commented Sep 11, 2020

Yes

@pszafer
Copy link
Contributor Author

pszafer commented Sep 11, 2020

but then it wouldn't be mobile accessible, would it?

@bramkragten
Copy link
Member

It would show on tap on mobile

@zsarnett
Copy link
Contributor

zsarnett commented Sep 11, 2020

I don't think a tool tip is a good alternative here. It hides this information which I believe is important. We should just add it be a more user friend attribute.

GPS Location Last Update: 45 min ago

Under the state card content.

This gives the user looking at this information a good representation of how accurate the zone may be.

@bramkragten
Copy link
Member

This not just for person, adding it as a tooltip would make it available for every entity.

@pszafer
Copy link
Contributor Author

pszafer commented Sep 11, 2020

ok, I will do it.

@pszafer pszafer changed the title Add last_updated field to more-person-info dialog Add last_updated tooltip to more info dialog Sep 12, 2020
datetime="[[stateObj.last_changed]]"
></ha-relative-time>
<paper-tooltip animation-delay="0">
[[localize('ui.dialogs.more_info_control.last_updated')]]:
Copy link
Member

Choose a reason for hiding this comment

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

This string doesn't exist yet? You have to add it to src/translations/en.json

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added. one notice, even if string is added it doesn't show in my browser. Actually it doesn't show even if I use some other string like ui.dialogs.more_info_control.dismiss.

@bramkragten bramkragten merged commit a214ab4 into home-assistant:dev Sep 29, 2020
@bramkragten
Copy link
Member

Oh, this is missing the LocalizeMixin...

@bramkragten
Copy link
Member

Fixed in dev.

@bramkragten bramkragten mentioned this pull request Sep 30, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jul 5, 2022
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.

5 participants