Skip to content

feat(ui): hover-revealed chat message meta with relative timestamps - #104035

Merged
steipete merged 5 commits into
mainfrom
claude/agent-stream-web-ui-708fce
Jul 11, 2026
Merged

steipete merged 5 commits into
mainfrom
claude/agent-stream-web-ui-708fce

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Follow-up to #104016 (flat assistant text stream). The chat thread still shows a permanent metadata row under every message ("OpenClaw · Jul 10, 2026, 5:20 PM"), which reads as noise now that assistant replies render as a clean stream. Absolute timestamps on every message are heavy; the details are only interesting on demand. Flat tool rows also sat slightly indented from the assistant text edge.

Why This Change Was Made

The sender/time footer is now hidden until the message group is hovered or focused (revealed with an opacity fade, height reserved so nothing shifts; always visible on touch devices where there is no hover). Timestamps show a relative label ("2m ago", falling back to a compact date like "Apr 24" past a week), with the absolute date/time in a styled tooltip — or, for messages with usage metadata, leading the existing token/cost popover so the two hover surfaces don't fight. A single per-pane 60-second tick keeps relative labels fresh on idle panes and is cleared on pane disposal. Flat top-level tool rows bleed their 8px inset into the avatar gutter so their icon/label aligns with the assistant text edge, and assistant stream segments get a touch more vertical breathing room. Web (Control UI) only.

User Impact

The web chat thread reads as a clean document: no repeated name/timestamp rows until you hover the message you care about, familiar "5m ago" times with exact timestamps one hover away, and agent text/tool rows sharing one left edge. Touch/mobile users keep always-visible footers.

Evidence

Deterministic mock-gateway screenshots (Playwright, seeded history):

Clean stream (dark) Clean stream (light)
desktop dark desktop light
Hover reveals footer + absolute-time popover User-message tooltip
hover tooltip user tooltip
  • Hovering the assistant timestamp shows "Jul 10, 2026, 5:54 PM PDT ↑2.4k ↓180 claude-fable-5" (absolute time now leads the usage popover); user messages get a styled tooltip with the absolute time.
  • The minute tick bumps a per-pane version that participates in the thread's guard() dependencies, so idle panes actually re-render; the timer is cleared with existing pane presentation state. Timestamps carry aria-live="off" so ticks don't spam the role="log" polite live region.
  • Relative labels derive from one injected clock (formatTimeAgo on the computed age — same canonical helper family the sessions sidebar uses); slightly-future (clock-skew) messages clamp to "just now" while far-future ones fall back to the compact date instead of lying forever.
  • Tests: chat-message.test.ts, chat-view.test.ts, chat-responsive.browser.test.ts — 286/286 pass on Blacksmith Testbox; timestamp tests pin relative labels with fake timers plus compact-date and future-timestamp fallback contracts (including the cross-year case). pnpm check:changed green (delegated, exit 0). Codex autoreview iterated to clean (final round: no findings, "patch is correct 0.91").

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Jul 11, 2026
@steipete
steipete merged commit c34ada3 into main Jul 11, 2026
94 of 97 checks passed
@steipete
steipete deleted the claude/agent-stream-web-ui-708fce branch July 11, 2026 01:30
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 11, 2026
…penclaw#104035)

* feat(ui): hover-revealed chat message meta with relative timestamps

* fix(ui): derive relative chat timestamps from the injected clock

* fix(ui): date far-future chat timestamps instead of clamping to just now

* fix(ui): invalidate memoized chat thread on relative-time ticks

* fix(ui): keep relative-time ticks out of the chat live region
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant