Skip to content

Studio: show when a prompt was sent while hovering it - #12170

Merged
mahiatlinux merged 1 commit into
mainfrom
studio/user-message-hover-time
Sep 28, 2026
Merged

mahiatlinux merged 1 commit into
mainfrom
studio/user-message-hover-time

Conversation

@shimmyshimmer

Copy link
Copy Markdown
Member

Summary

Hovering a prompt you sent now shows when it was sent, to the left of its Copy / Edit / Fork / Delete buttons.

  • Today: just the time, e.g. 10:34 PM
  • Yesterday: Yesterday, 9:12 PM
  • Older: Sep 11, 12:22 AM, with the year only when it differs
  • Hovering the time shows the full date, e.g. Sunday, September 27, 2026 at 10:34 PM

It reuses formatMessageDate (the same formatter as the time in a response's More menu) and the existing common.yesterdayAt string, so it follows the UI language and needs no new translations. The time comes from the message's saved createdAt, so it is correct after a reload.

Performance

The new UserMessageTime is the first child of the user ActionBarPrimitive.Root, which is autohide="always" and returns null unless its message is hovered. So:

  • an idle thread renders no timestamps at all
  • there is no timer, interval or effect; the string is formatted once when the bar mounts on hover
  • nothing changes for assistant messages or while streaming

Testing

  • New tests/user-message-time.test.ts pins the time inside the hover-only bar and checks it has no timer
  • npm test: 9203/9203 pass, tsc --noEmit passes
  • Checked in a running Studio:
    • no hover: 0 .aui-user-message-time elements in the DOM
    • hover: 10:34 PM left of the action buttons, full date in the tooltip
    • reopened the chat after a reload at 10:35: still shows 10:34 PM

The time sits left of the user message action bar. That bar only mounts while hovered, so an idle thread renders no timestamps and runs no timers.
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-28T05:45:42.700960Z 3daf453 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 3daf4534ad

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@mahiatlinux

Copy link
Copy Markdown
Contributor

UI review

Verdict: not ready as-is. The core hover and reload path works, but I found two user-facing UI defects and one non-load-bearing test.

Findings

  1. P2: the timestamp is clipped at 320 px in a supported locale.

    studio/frontend/src/components/assistant-ui/user-message-time.tsx:25 keeps the timestamp on one line, and studio/frontend/src/components/assistant-ui/thread.tsx:8733 puts it beside four fixed 32 px actions without a narrow layout. With locale ko, a prior-year timestamp renders as 2025년 9월 11일 오전 12:22; at 320 px the action bar starts at x=-11.72 and the screenshot visibly loses the first digit, showing 025년.... The merge-base bar fits because it has only the actions. Please constrain or stack the timestamp at narrow widths while preserving all four actions and the full-date value.

  2. P2: the sent time is unavailable to keyboard users, and its full date cannot be opened on touch.

    studio/frontend/src/components/assistant-ui/thread.tsx:8731-8735 places the non-focusable <time> from user-message-time.tsx:19-25 only inside autohide="always". That root returns null until pointer hover. A 16-step keyboard traversal crossed the assistant actions and composer but never mounted .aui-user-message-time; its count remained zero. A touch tap does mount the compact time and four actions, but tapping the time exposes no tooltip because the full date exists only in the native title attribute. Please add a keyboard focus-reveal path and a focusable/custom tooltip affordance for the full date.

  3. P3: the new test is not load-bearing for the behavior it claims to protect.

    studio/frontend/tests/user-message-time.test.ts:28-30 scans source text for formatMessageDate( and timer tokens but never renders the component. In isolated mutation checks, both new tests still passed after replacing the saved message.createdAt with Date.now(), and after adding an unconditional return null. Please render UserMessageTime with a fixed saved createdAt, assert no timestamp while idle, then hover and assert the visible text, dateTime, and full-date affordance.

  4. P3: the PR body's streaming claim does not match the shipped behavior.

    The body says nothing changes while streaming, but the user action root at thread.tsx:8731-8733 does not set hideWhenRunning and assistant-ui defaults it to false. A running-thread probe measured timestamp count 0 -> 1 when the preceding user message was hovered. If that is intended, the PR body should be corrected; otherwise the bar needs the running-state guard.

UI evidence

The normal desktop flow matches the intended change after a full thread reload: the timestamp count is 0 while idle on both sides, then 0 BEFORE and 1 AFTER on hover. The AFTER element carried dateTime=2026-09-28T06:11:17.066Z and the localized full-date title.

Reloaded user prompt, merge base versus PR head

At 320 px in Korean, the added prior-year timestamp overflows the viewport and loses its first digit:

320 px Korean prompt actions, merge base versus PR head

The viewport, locale, keyboard and touch measurements are in the browser probe artifact.

Executed checks

  • Tested merge base 268b771b953ad88f9f402761a4e3743c8e3c24d1 against head 3daf4534ad42b2429c232c5c80f602463c7281ed in separate Studio installs.
  • Full frontend suite: 9,203/9,203 passed.
  • npm run typecheck, npm run build, and npm run i18n:check: passed.
  • Focused timestamp/date tests: 4/4 passed.
  • Biome: the new component had no diagnostics; the new source-scanning test had six warnings. thread.tsx had the same 12 errors and 204 warnings at the merge base and head.
  • UI runs used Chromium 153 on Ubuntu 26.04 with isolated application homes, browser state, caches and ports. The live two-install reload check used Playwright 1.63; the 1280/768/390/320 px, 12-locale, keyboard and touch probe used Playwright 1.55.

@mahiatlinux
mahiatlinux self-requested a review September 28, 2026 06:21

@mahiatlinux mahiatlinux 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.

LGTM!

@mahiatlinux
mahiatlinux merged commit 869af7c into main Sep 28, 2026
41 of 43 checks passed
@mahiatlinux
mahiatlinux deleted the studio/user-message-hover-time branch September 28, 2026 06:22
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
The time sits left of the user message action bar. That bar only mounts while hovered, so an idle thread renders no timestamps and runs no timers.
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.

2 participants