feat(templates): improve highlight date and time in template list created/updated column#484
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ated/updated column
122e357 to
dbd77cb
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 122e357cd4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
LGTM — self-contained visual tweak to template list date/time highlighting.
Extended reasoning...
Overview
Single-file change in src/features/dashboard/templates/list/table-cells.tsx. Refactors the two near-identical CreatedAtCell / UpdatedAtCell renderers into a shared DateTimeCell that compares each row's date against its immediate neighbors to decide whether the date part, time part, or both get emphasized. Also removes the previous restriction that only ran the highlight logic on the actively sorted column.
Security risks
None. Pure presentation logic operating on already-rendered data — no auth, network, storage, or user input surfaces are touched.
Level of scrutiny
Low. This is a cosmetic/UX change: two className branches swap between text-fg and text-fg-tertiary based on neighbor comparisons. Worst case is a visual glitch that doesn't affect functionality or data. The 'use no memo' directive plus getRowModel().rows access is a reasonable pattern for reading sibling row state in TanStack Table.
Other factors
- The prior Codex bot comment about
isSortedColumnskipping the non-sorted column is explicitly addressed in this iteration (comment marked resolved) — the current code runs the same logic on both columns unconditionally. - Fallback behavior is preserved: when
datePartis missing, both flags default tofalse, keeping tertiary styling. - Vercel preview build is green.
Improve highlighting of the date and time in the Created/Updated columns of the
Templates list to better visually group rows by day.
Why?
Team behavior is split: most teams have only a few templates (dates alone
differentiate rows), while templates-heavy teams create dozens to thousands per
day (only times differentiate rows). For ~65% of active paying teams the first
page of the table mixes both regimes, so a fixed emphasis on either the date or
the time is wrong for part of the page. The highlight now adapts per row and
emphasizes the part that actually changed.
Highlight rules
For each row, its date is compared with the rows directly above and below
(per column):
text/primary.
date and the time are rendered using text/primary.
time is rendered using text/primary; the date drops to text/tertiary.
This applies to both the Created and Updated columns at all times, regardless of
which column the table is sorted by or the sort direction. (Previously the logic
only ran on the actively sorted column.)