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

Add display of latest height and time #15

Merged
merged 2 commits into from
Dec 3, 2024
Merged

Add display of latest height and time #15

merged 2 commits into from
Dec 3, 2024

Conversation

cronokirby
Copy link
Collaborator

image

This adds a section with the latest block height and time.

For formatting the timestamp, I think using a UTC based ISO string is the simplest and most robust way, since it's completely unambiguous and eminently copy-able.

@hdevalence
Copy link
Member

An approach I used in the LP position page that I liked was to have the time displayed in local time (according to the browser) but put the UTC time in a Tooltip component (so that the difference is clear). The problem with a UTC time is that the user has to think about conversion from their local time to UTC (unless they are the very rare person that lives in UTC).

One thing that would be good -- probably more important ux -- would be to have a client-side check, once, on page load that the time is within some threshold of the current time (say, 30s). If not, there should be some kind of warning that the data might be stale.

@conorsch
Copy link
Contributor

conorsch commented Dec 2, 2024

The pd node status page displays in local timezone:

insights-timestamps

which is pretty cool and would be nice to have here, too. Adding a "stale" warning is probably the best way to inform the user about old data, but I'm not sure how to approach there. On the node status page, we check for catching_up=false and update a widget based on that. I'm surprised that the UI toolkit https://ui.penumbra.zone doesn't have a convenient helper for warning bars; maybe ping the web team about that?

@cronokirby
Copy link
Collaborator Author

image

Pushed a change to have a localized time, as well as a UTC time on hover

@hdevalence hdevalence merged commit 8865e4c into main Dec 3, 2024
@hdevalence
Copy link
Member

Adding a "stale" warning is probably the best way to inform the user about old data, but I'm not sure how to approach there.

I think the way to do it is to check that (when loaded) the timestamp is not too old.

But having the date is enough to solve the problem we were facing about stale data.

@cronokirby cronokirby deleted the time-display branch December 3, 2024 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants