Skip to content

Show a datetime hover card on result-grid cells - #34

Merged
pavi2410 merged 4 commits into
mainfrom
cursor/datetime-cell-hover-5623
Oct 3, 2026
Merged

pavi2410 merged 4 commits into
mainfrom
cursor/datetime-cell-hover-5623

Conversation

@pavi2410

@pavi2410 pavi2410 commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

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:

  • Unix ms — stored instant as unix milliseconds
  • UTC — wall time in UTC (Jan 15, 2020 12:30:00)
  • Local — same wall time in the user's timezone, labeled with the IANA name (or Local)
  • Relative — e.g. 6 years ago

Datetime 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 zone still get the card when sqlx-sqlite remaps the declared type to INTEGER because the name contains "int". A cell like 2020-01-15 12:30:00+00 is 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_cell and date_and_time_only_cells_stay_plain. Time formatting is covered by hover_card_formats_timestamp_utc_local_relative.

cargo test -p desktop datetime
Open in Web Open in Cursor 

cursoragent and others added 4 commits October 3, 2026 19:30
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>
@pavi2410
pavi2410 marked this pull request as ready for review October 3, 2026 19:57
@pavi2410
pavi2410 merged commit 4c75137 into main Oct 3, 2026
2 checks passed
@pavi2410
pavi2410 deleted the cursor/datetime-cell-hover-5623 branch October 3, 2026 19:58
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.

Display contextual information on cell hover

2 participants