Skip to content

Show native chat message timestamps on hover - #19218

Merged
brennanb2025 merged 1 commit into
mainfrom
brennanb2025/nc-hover-timestamps
Sep 7, 2026
Merged

brennanb2025 merged 1 commit into
mainfrom
brennanb2025/nc-hover-timestamps

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​130 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​130
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​67 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​66

What this does, in plain terms

The chat never told you when anything happened. Scrolling back, every message looked equally recent — you couldn't tell if the agent answered two minutes ago or two hours ago.

Now: hover a message, see its time. Move away, it's gone.

Hover-only is deliberate. A permanent timestamp on every row is noise on a surface you read all day; but when you do need it ("did this run before or after I changed that file?") you really need it.

Before → After

Before After
"When did it say that?" No answer anywhere Hover the message
At rest — Identical to today — nothing added
Your own messages No hover controls at all Just the time
Keyboard users — Tab to a message, time appears on focus

Screen readers get the full date and time, not the shortened clock string. No date library was added; times follow your system's regional format.


Technical detail

ELI5

Native chat shows each message's time when you hover over it or navigate to it with the keyboard.

What Changed

Agent messages display the time after copy and scroll-to-top in the existing hover controls. User bubbles get only a timestamp, with a keyboard focus target. Unknown or invalid timestamps render nothing.

Why

This makes message times available without adding persistent transcript clutter. Formatting uses Intl and the UI locale, with semantic ISO dateTime metadata and a full localized accessible label. No date dependency, timer, relative time, shared schema, or wire change.

Linked Issue

Coordinator-dispatched native chat hover timestamp task; no issue number supplied.

Visual Proof

Full hidden Electron renderer, seeded transcript, macOS. Before hover:

Idle

After hovering the user bubble:

User hover

After hovering the agent message:

Agent hover

Testing

  • 32 focused tests passed across timestamp, message-row, transcript-chrome, and message-list suites with ORCA_BACKGROUND_LAUNCH=1.
  • Oxlint, React Doctor lint, formatting, and git diff --check passed on the changed files.
  • Hidden Electron CDP: asserted both timestamps hidden at rest, user and agent hover reveal, user focus reveal, and Tab into agent controls; inspected full-app screenshots.
  • Typechecking remains assigned to the coordinator. Windows, Linux, and SSH were not run locally; this change only reads existing renderer timestamp data and changes no execution or transport behavior.

Review

Self-reviewed for null and invalid dates, epoch zero, live locale changes, semantic accessibility, and preserving existing control eligibility. Agent timestamps add no tab stop; user timestamps do.

Agent skill upstream boundary

  • Not applicable.

Checklist

  • Small and focused; what changed and why explained.
  • Hover state screenshots attached.
  • Cross-platform, SSH, folder workspace, mobile, and wire impact considered.
  • Central typecheck and CI complete.

@coderabbitai

coderabbitai Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: b84be838-6555-4e5e-8fbc-d7a17ae33342

📥 Commits

Reviewing files that changed from the base of the PR and between 2ccf35b and fdd99d5.

📒 Files selected for processing (5)
  • src/renderer/src/components/native-chat/NativeChatMessageRow.test.tsx
  • src/renderer/src/components/native-chat/NativeChatMessageRow.tsx
  • src/renderer/src/components/native-chat/NativeChatMessageTimestamp.test.tsx
  • src/renderer/src/components/native-chat/NativeChatMessageTimestamp.tsx
  • src/renderer/src/components/native-chat/NativeChatTranscriptChrome.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

Adds NativeChatMessageTimestamp with localized formatting, ISO datetime, accessible full-date labels, optional focusability, and invalid-value handling. Integrates timestamps into assistant controls and user message rows with hover/focus visibility. Adds tests for formatting, locale changes, invalid values, focus behavior, message types, and control ordering.

Merge Risk: ⚪ Minimal · up to fdd99

Native chat messages now show localized timestamps on hover or keyboard focus, while invalid or unavailable times remain hidden. The change preserves existing message behavior and has no active merge-blocking risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: showing native chat message timestamps on hover.
Description check ✅ Passed The description is detailed and covers the change, rationale, visual proof, testing, accessibility, and known limitations. The linked issue has no issue number, and central typechecking and cross-plat…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • NativeChatMessageTimestamp — a new <time> component rendering a short localized time (Intl hour/minute) with a full aria-label and semantic ISO datetime; returns null for missing/invalid timestamps, caches formatters keyed on getIntlLocale(), and opts into a keyboard focus target only when requested.
  • NativeChatMessageRow — user rows gain a group container and a focusable timestamp; agent rows forward message.timestamp into their existing hover controls.
  • NativeChatAgentControls — accepts a required timestamp and appends a non-focusable timestamp after the scroll button; the sole caller is updated.
  • Tests — two suites covering control ordering/reveal, the user-bubble focus target, omission of unknown/invalid timestamps, chrome-free reasoning/system rows, and re-render on language change.

The change is small, self-contained, and reads existing renderer data only — no wire, schema, or execution-boundary impact. Timestamp validity checks (null guard plus Number.isNaN(date.getTime())) are sound and cover both overflow directions, and date.toISOString() cannot throw on the surviving valid range. The useTranslation() subscription and module-level formatter cache match existing repo patterns (SidebarHeader, weekday-names.ts), and tests assert exact values rather than looser pass-throughs.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Visual validation of per-message hover timestamps (dark + light), driven in the real app over CDP with the production MessageRow components.
01-dark-rest.png
Dark, at rest: no timestamp on either row.
02-dark-agent-hover.png
Dark, hovering the agent message: timestamp appears next to the copy and scroll-to-top controls.
03-dark-user-hover.png
Dark, hovering the user message: timestamp appears alone, no copy or scroll-to-top buttons.
04-dark-user-focus.png
Dark, keyboard focus on the user timestamp: revealed with a focus ring, no hover involved.
05-light-rest.png
Light, at rest: no timestamp on either row.
06-light-agent-hover.png
Light, hovering the agent message: timestamp appears next to the copy and scroll-to-top controls.
07-light-user-hover.png
Light, hovering the user message: timestamp appears alone, no extra buttons.

Backing checks: at rest the user time and the agent controls container both report computed opacity: 0; on hover/focus they report opacity: 1. No regressions visible in the surrounding rows.

@brennanb2025

brennanb2025 commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor Author

Status: ready for merge

Plan review

Reviewed before any code was written, against the actual source. Verdict APPROVE, no required amendments. One optional refinement was taken: the timestamp is keyboard-focusable only on user rows, since agent rows already have two focusable controls in the hover cluster and a third tab stop per row would add real navigation cost in a long transcript.

Code review loop

Same-model subagent review returned clean with no meaningful fixes warranted, so nothing was pushed. readiness-checklist was run at both the start and the end of the review session — both PASS, including the mobile backward-compatibility subcheck. 32 focused tests pass, oxlint and React Doctor lint clean.

Manual UI validation

Driven in a real Electron instance over CDP against a hidden renderer (ORCA_BACKGROUND_LAUNCH=1, alternate ports, no window ever revealed or focused). All five behaviours verified, with 7 screenshots attached in the comment above:

  • invisible at rest (computed opacity 0)
  • revealed on agent-message hover, beside the existing copy and scroll-to-top controls
  • revealed on user-message hover, alone (user rows still carry no copy/scroll buttons)
  • revealed on keyboard focus, with a focus ring
  • correct in both light and dark theme

Notes for the reviewer

  • No new dependency. The repo has no date library, so this uses Intl.DateTimeFormat with getIntlLocale(), following the convention documented in relative-time-format.ts. Formatters are cached per locale at module level rather than constructed per row, which matters because this renders on every row of a streaming transcript.
  • No fourth relative-time helper was added; this is absolute time only.
  • timestamp: null renders nothing, which covers the streaming row and the scrape fallback. Epoch zero is preserved rather than treated as falsy.
  • Accessibility: semantic <time> with an ISO dateTime attribute and a full localized accessible label, so screen readers get the complete timestamp rather than a truncated clock string.

Process deviation, stated plainly

The review loop's $orchestration arm was not used to spawn the validation agent. Nested worker depth is 1 in this install, so a dispatched worker cannot dispatch its own workers (nested_worker_depth_exceeded). The validation lane was therefore run directly by the coordinator at depth 0. The substance of the loop — subagent review to clean, readiness bookends, independent UI validation with visual evidence — was carried out in full.

readiness-checklist's severity-counsel step was unavailable for the same depth reason and is recorded as such rather than reported as a verdict.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

ELI5 — what this PR actually does

The problem in one sentence. The chat never tells you when anything happened. Scrolling back through a long session, every message looks equally recent — you can't tell if the agent answered that two minutes ago or two hours ago.

What this adds. Hover any message and its time appears. Move away and it disappears again.

Why hover-only. A timestamp on every row, permanently, is visual noise on a surface you read top-to-bottom all day. You almost never need the time — but when you do (did this run before or after I changed that file?) you really need it. Hover keeps it available and invisible.

Before → After

Before After
"When did it say that?" No answer anywhere in the chat Hover the message
Reading a long scrollback Every message looks equally recent Times on demand, per message
At rest — Looks exactly as it does today, nothing added
Keyboard-only users — Tab to a message, the time appears on focus

Notes

  • Nothing is visible until you hover or focus. The default look of the transcript is unchanged.
  • It joins the controls that already appear on hover (copy, scroll-to-top) rather than adding a second hover behaviour, so agent messages gain a third item in a strip that already exists. Your own messages previously had no hover controls at all and now show just the time.
  • Screen readers get the full date and time, not the shortened clock string sighted users see.
  • Times follow your system's regional format. No new dependency was added to do this.

@brennanb2025
brennanb2025 merged commit 0b3af9d into main Sep 7, 2026
27 of 29 checks passed
brennanb2025 added a commit that referenced this pull request Sep 8, 2026
…cus (#19426)

* fix(native-chat): reveal message chrome on keyboard focus, not any focus

`:focus-within` cannot tell a mouse click from a keyboard tab, so clicking any
control inside a message row — a tool run's disclosure, most visibly — parked
focus there and left the row's copy, scroll, and timestamp chrome showing after
the pointer had moved away. The row read as permanently hovered.

`:focus-visible` is the distinction the browser already computes, and it is the
keyboard focus this reveal was written for in #19218. Measured in the running
app: after a real click on a run header, `document.activeElement` is that button
and `:focus-visible` is false, while `:focus-within` is true.

* refactor(native-chat): spell the keyboard-focus reveal with the first-class has variant

Swaps the hand-rolled arbitrary variant `group-[&:has(:focus-visible)]:` for
Tailwind's `group-has-[:focus-visible]:`. Every other `has-` variant in the
renderer is already spelled in the bracket form, including the same
hover-plus-keyboard-focus reveal on the project header actions.

Measured in the running app: both spellings compile to an equivalent selector
and are identical in every state (idle, mouse click on a control inside the
row with the pointer moved away, and each keyboard tab stop).

Also asserts the pointer-events half of both reveals, which governs whether
the copy button is clickable and had no coverage.

* fix(native-chat): preserve message controls on touch devices

---------

Co-authored-by: Merge Sim <sim@local>
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.

1 participant