Repository navigation
Show a datetime hover card on result-grid cells - #34
Merged
Merged
Conversation
Hovering a timestamp/datetime cell opens a read-only card with the unix timestamp, UTC time, the user's local time, and a relative time. Co-authored-by: Pavitra Golchha <hello@pavi2410.com>
The first card line is still milliseconds since epoch; the new label avoids reading as a second wall-clock time. Co-authored-by: Pavitra Golchha <hello@pavi2410.com>
sqlx-sqlite remaps TIMESTAMPTZ to INTEGER because the name contains "int". Detect parseable instants on remapped columns, keep date/time-only plain, and anchor the card to the right of the cell instead of over the next row. Co-authored-by: Pavitra Golchha <hello@pavi2410.com>
Positioner::side was built during render from a fresh default Bounds, so Placement::Right started at the window origin. Keep the cell rect in keyed state after prepaint and only open the card once that rect is real. Co-authored-by: Pavitra Golchha <hello@pavi2410.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #24.
Hovering a datetime cell in the result grid shows a read-only card immediately to the right of that cell with four lines:
Jan 15, 2020 12:30:00)Local)6 years agoDatetime columns (
timestamp,timestamptz,datetime, and the Postgres with/without time zone names) get the card. Date-only, time-only, and infinity stay plain.timestamptz/timestamp with time zonestill get the card when sqlx-sqlite remaps the declared type toINTEGERbecause the name contains"int". A cell like2020-01-15 12:30:00+00is recovered from the value. Real integers stay numeric.The card uses
Positioner::side(Placement::Right)against the cell's last painted bounds (held in keyed state). It does not use a pointer-relative tooltip, so it neither covers the next row nor opens at the window origin.Type detection is covered by
sqlx_sqlite_timestamptz_remap_recovers_from_cellanddate_and_time_only_cells_stay_plain. Time formatting is covered byhover_card_formats_timestamp_utc_local_relative.