fix: timestamp tooltip on relative datetime labels#1796
fix: timestamp tooltip on relative datetime labels#1796pedrolamas merged 1 commit intofluidd-core:developfrom
Conversation
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
There was a problem hiding this comment.
Pull request overview
Adds absolute timestamp tooltips to Spoolman UI where relative timestamps are shown, improving usability when the relative label becomes stale after the underlying data stops updating (Fixes #1772).
Changes:
- Add tooltip support on the Spoolman card for
first_used/last_usedfields. - Add tooltips in the spool selection table for
first_used/last_usedcolumns showing absolute datetime.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/components/widgets/spoolman/SpoolmanCard.vue | Wraps relative time labels with a tooltip that displays the absolute timestamp. |
| src/components/widgets/spoolman/SpoolSelectionDialog.vue | Adds tooltips to table cells to show absolute timestamps for first/last used. |
| </span> | ||
| </template> | ||
|
|
||
| <template v-else-if="getTooltipField(field) != null"> |
There was a problem hiding this comment.
getTooltipField(field) is evaluated twice (once in the v-else-if and again inside the tooltip content), which means formatDateTime(...) runs redundantly on every render. Consider branching on field/activeSpool.first_used|last_used in the template (or returning the raw Date from a helper) so the formatted tooltip string is computed once per render.
| <template v-else-if="getTooltipField(field) != null"> | |
| <template | |
| v-else-if=" | |
| (field === 'first_used' && activeSpool.first_used) || | |
| (field === 'last_used' && activeSpool.last_used) | |
| " | |
| > |
There was a problem hiding this comment.
Granted, that is correct, however I don't expect this to have a large impact so leaving as is.
|
this won't work on mobile/touchscreen though? but its a step in right direction i guess. havent tested it yet though so could be wrong. |
Adds a tooltip with the absolute timestamp when a relative timestamp label is shown.
Fixes #1772