Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(gui): added relative time ago tooltip to timestamps#10325

Open
Kaya-Sem wants to merge 2 commits intosyncthing:mainfrom
Kaya-Sem:reltime_last_scan
Open

feat(gui): added relative time ago tooltip to timestamps#10325
Kaya-Sem wants to merge 2 commits intosyncthing:mainfrom
Kaya-Sem:reltime_last_scan

Conversation

@Kaya-Sem
Copy link

Purpose

Adds a tooltip to the last scanned GUI row to show relative time. Implements #10324

Screenshots

image

@Kaya-Sem Kaya-Sem marked this pull request as ready for review August 31, 2025 13:35
@Kaya-Sem Kaya-Sem changed the title added relative time ago tooltip to last scan feat(gui): added relative time ago tooltip to last scan Aug 31, 2025
@github-actions github-actions bot added the enhancement New features or improvements of some kind, as opposed to a problem (bug) label Aug 31, 2025
@Kaya-Sem
Copy link
Author

I forgot internationalization. Displays always in english

@tomasz1986
Copy link
Member

tomasz1986 commented Aug 31, 2025

I forgot internationalization. Displays always in english

Yeah, this does need to work with translations.

@Kaya-Sem
Copy link
Author

not sure what to make out of all those edits 😅

@tomasz1986
Copy link
Member

tomasz1986 commented Aug 31, 2025

Please ignore the edits, I think with the moment.js library you could easily do translations like 1h 30m ago, etc. Not sure about 1 second ago or 10 minutes ago, where full words are used, because the nouns may change depending on the number, e.g. in Polish, it would say 1 sekundę temu, 2 sekundy temu, 5 sekund temu, and so on. Maybe these are also supported by the library though? I haven't tested it so far.

@calmh
Copy link
Member

calmh commented Aug 31, 2025

There are many places in the GUI where dates and times are presented. Is there something special about last scan to warrant special treatment, or should this be a more general thing?

@Kaya-Sem
Copy link
Author

There are many places in the GUI where dates and times are presented. Is there something special about last scan to warrant special treatment, or should this be a more general thing?

There is nothing special about it. If I can sort out the internationalization, this could be applied in other cases too. Although not sure if anyone wants this feature except me

@calmh
Copy link
Member

calmh commented Aug 31, 2025

I don't particularly desire it, but I see no reason to reject it out of hand -- other than if it becomes a specific hack for the scan time. If it's applied to the timestamp there and in recent changes and last device connection time and maybe log popups etc would make sense.

@rasa
Copy link
Member

rasa commented Aug 31, 2025

https://github.com/cmldk/HumanizeDuration.js provides relative time. If internationalization is needed, perhaps the easiest way would be to merge this fork's changes into https://github.com/rasa/HumanizeDuration.js, though I haven't looked into how easy that would be.

@Kaya-Sem
Copy link
Author

https://github.com/cmldk/HumanizeDuration.js provides relative time. If internationalization is needed, perhaps the easiest way would be to merge this fork's changes into https://github.com/rasa/HumanizeDuration.js, though I haven't looked into how easy that would be.

I think I'll start with the Intl.RelativeTimeFormat object. Not feeling the obscure js packages

@Kaya-Sem Kaya-Sem changed the title feat(gui): added relative time ago tooltip to last scan feat(gui): added relative time ago tooltip to timestamps Aug 31, 2025
@tomasz1986
Copy link
Member

cmldk/HumanizeDuration.js provides relative time. If internationalization is needed, perhaps the easiest way would be to merge this fork's changes into rasa/HumanizeDuration.js, though I haven't looked into how easy that would be.

I think I'll start with the Intl.RelativeTimeFormat object. Not feeling the obscure js packages

For the record, we already use that package (to translate shorthand time formats). I think the package was first introduced into Syncthing maybe ~2 years ago or so, and it seemed like the only way to actually do what we needed, with the alternative being to translate everything ourselves.

@Kaya-Sem
Copy link
Author

seems like a decent choice then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New features or improvements of some kind, as opposed to a problem (bug)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants