Repository navigation
Studio: fix prompt timestamp layout, accessibility, and imported times - #12173
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 73c180f41e
ℹ️ 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".
Review and verificationTested source head: I confirmed and repaired three correctness/accessibility defects:
Verification:
Review convergence completed on mirror head UI evidence used isolated Studio installs in Playwright Chromium 151 on Linux at 760 x 720. The pair compares merge base |
mahiatlinux
left a comment
There was a problem hiding this comment.
LGTM! Ready to merge, all manually checked.
unslothai#12173) * Fix chat timestamp layout, accessibility, and imported-time accuracy * Fix reverse message actions and imported timestamps * Show focus on user action sentinel --------- Co-authored-by: Unsloth <[email protected]> Co-authored-by: mahiatlinux <[email protected]>
…x slot (#12781) * Branch picker chevrons: give back the 24px hit target in the same 20px slot #12735 shrank .aui-branch-chevron-btn from 24x32 to 20x20 to make the chevrons read as part of the count. That dropped them under the 24px every footer control keeps since #12173, which playwright_user_message_time.py checks, so 'Frontend build + bundle sanity' fails on main once its earlier steps pass (#12770, #12772). Size the button 24px and take the extra 4px back with a -2px margin. Every footer element stays where it was and the glyph centres do not move; only the clickable area grows, and with no hover fill it is not visible. * Branch picker chevrons: make 24px a floor, not a multiple of the space scale 24px * --ui-space-scale fell to 19.2px at the 12px UI font size (scale 0.8). Size the target as max(24px, the scaled 20px slot) and hand the difference back with the margin, so the slot and the glyph centre still follow the scale while the hit area never drops under 24px. Add the 12px layout to playwright_user_message_time.py, which only covered 15px and 20px and so could not see it. * Branch picker chevrons: grow the hit area toward the count, and scale its floor with Interface Scale The symmetric -extra/2 margin pushed Previous over the Delete/More button beside it: at the 12px UI font the gap is 1.6px and the extra 8px, and at the browser's 50% Interface Scale a fixed 24px reached 7px past the slot. In an overlap the later element wins the click. Put the extra on the inner side only (toward the count, which is not a control), with padding keeping the glyph where it was, and make the floor 24px times the browser Interface Scale, as browser zoom would. The browser check now asserts no two footer controls overlap and adds the 50% Interface Scale layout; the previous commit fails the overlap check at 12px. * Branch picker chevrons: extend the hit area with a ::before so the button and focus ring stay as drawn Growing the button itself moved its focus ring: a 24px circle off the glyph's centre and over the count. The button is back to the 20px slot, scaled; an invisible positioned ::before carries the extra toward the count, and, being positioned, paints over the count so presses there reach the chevron (the previous padding never did: the count, painted later, took them). The layout check now measures each control's real target by hit testing the middle of every edge, and requires the chevron's own box to stay square and unpadded so the ring stays centred on the glyph. * Branch picker: keep the count at least as wide as both chevron extensions In a narrow custom chat font a short count such as 1/2 can be narrower than the two ::before extensions together, and Next would then win presses on the inner edge of Previous. The count now has a minimum width of both extensions plus 1px, centred; any count wider than that, the usual case, is untouched. The layout check gains a narrow-count layout at the smallest UI font. * Branch picker: reserve room above and below for the chevron targets At 200% Interface Scale and the 12px UI font the target reaches 8px past the box on each side, more than the footer's 6.4px row gap, so once the picker wrapped onto its own row it took the lower edge of the action buttons above. The chevrons now carry block margins of half the extra: inside one row with the actions they fit in the row's height and nothing moves; a wrapped picker row grows to hold its targets. The layout check gains 200% layouts at 375 and 320px; the previous head fails them.
Fixes unslothai#13673 ## Summary Adds an opt-in **Reply times** switch to Settings > Chat > Display. When it is on, every reply shows when it finished, at the start of the row under it, so you can tell at a glance whether a long agent or tool run ended an hour ago or eight hours ago. - Off by default. With it off, nothing renders and the thread looks exactly as it does today. - The time is absolute, e.g. `Oct 13, 11:55 PM`, with the year only when it is not the current one, in the UI language's format. It is deliberately not "Today" / "Yesterday": nothing re-renders an old reply, so a thread left open past midnight would keep calling yesterday's replies today. - Hovering the time shows the full date with seconds, e.g. `Monday, October 13, 2026 at 11:55:01 PM`. - The time is the reply's recorded finish time (`responseDetails.finishedAt`). A reply that was stopped or failed records no `responseDetails`, so its finish is its persisted stream start plus stream duration, i.e. when it stopped. A Deep Research reply uses its run's `completedAt`, and shows nothing while the run has not finished. Replies with none of these fall back to their creation time. Imported messages whose time is only an ordering estimate still show nothing, as in unslothai#12173. - Nothing shows while a reply is still generating, so the row does not change under a streaming reply. ## Layout and performance - With the switch off, each reply mounts only a component that reads the preference from the chat preferences store and returns nothing. No assistant-ui selector is added, so composer keystrokes cost exactly what they do today (see `composer-keystroke-subscription-budget.test.ts`). - The time sits before the branch picker and action bar, outside the bar that mounts on hover, so hovering an older reply never moves it. - The footer row already reserves its height, so turning the switch on adds no vertical space. - It is a plain `<time>` with a native `title`, not a Tooltip. One Tooltip per reply would subscribe to the modal layer store on every message of a long thread, which is the cost the action bar's `autohide` comment describes. - No timer, interval or effect; the clock is only read once, for the current year. ## Changes - `chat-preferences-store.ts`: `showReplyTimes` (default `false`; a saved payload without the key rehydrates as off). - `assistant-message-time.tsx`: the new component; `message-timestamp.ts`: `replyFinishedTimestamp`. - `thread.tsx`: renders it first in the reply footer. - `chat-tab.tsx`, `settings-search.ts`: the switch, searchable by "timestamp", "time", "clock" and so on. - Strings for all 14 locales. - `check-bundle-budget.ts`: the startup budget raised for this PR, about +1.5 KB raw / +0.4 KB transfer; merged with main at c2f75c4 the build measures 6,892,776 B raw / 2,076,549 B transfer (Node 24, 98 chunks), and the limits are that plus about 200 B, as main does. ## Validation - `npm test` in `studio/frontend`: 13,234 passed, 0 failed, 1 skipped. - `npm run typecheck`: clean. `eslint` on the new and changed files: clean except two errors in `chat-tab.tsx` on import lines this PR does not touch, which also fail on `main`. - `tests/studio/test_chat_response_details_ui_contract.py`, `tests/studio/test_en_catalog.py`: 51 passed. - New `tests/reply-times-preference.test.ts` covers the off default (fresh and older saved preferences), the Settings wiring, the footer position outside the autohiding bar, no assistant-ui selector while off, and the finish time, stopped reply, fallback, running and estimated cases. ## Screenshots Two Studios built from main at 6bbe268 (BEFORE) and this branch at 980e663 (AFTER), with the same seeded thread and Reply times turned on. The reply finished at 23:55:01 UTC; the browser shows it in its own time zone (US Pacific here). With the switch off, both builds render the thread identically. Reply footer: AFTER shows when the reply finished, before the existing actions.  Settings > Chat > Display: AFTER adds the Reply times switch below Response model. 

Prompt timestamps could be clipped outside narrow chats when the branch picker was visible, and the hover-only footer could not be reached by keyboard or touch. The footer now uses the message's full width, truncates the date while preserving action target sizes, and exposes the full date through the shared accessible tooltip. User messages reuse the existing focus-reveal behavior and can reveal their actions with a touch tap.
Imports that lack a per-message send time now mark their synthetic ordering timestamp as estimated. That marker survives restoration, and both timestamp displays omit estimated values. Existing imported records without provenance cannot be distinguished retroactively.
The timestamp remains unmounted when its actions are hidden, selects only a stable timestamp value, and adds no polling or recurring clock work. Follow-up to #12170.
Validation
node --experimental-strip-types --test --test-concurrency=4 'tests/**/*.test.ts').npm run typecheckpassed, including the browser fixture.tests/studio/playwright_user_message_time.pypassed in Chromium with real assistant-ui runtime primitives and application styles: 500 messages, 120 streaming updates with zero additional date-formatting calls; keyboard focus and pointer exit; touch reveal and full-date disclosure; 320/375 px panes, larger text, English/Russian/Arabic; invalid and estimated dates.The browser regression is self-contained and starts its own Vite fixture; it needs frontend npm dependencies and Python Playwright/Chromium, with no model or backend required.