fix(web): remove redundant You header and time stamp from user chat messages#4515
fix(web): remove redundant You header and time stamp from user chat messages#4515maxmilian wants to merge 3 commits into
Conversation
…essages The project chat panel rendered two pieces of metadata above/around each user message that added visual noise without earning their space: the `chat.you` "You" role header and the relative time stamp beside the copy button. nexu-io#3875 removed the day separator and the inline relative message time, but these two user-message elements were left behind (noted in the issue thread on Jun 17). Remove both from the user message in ChatPane, drop the now-unused messageTime/shortTime/exactDateTime wiring, and prune the orphaned `.msg.user .role` / `.msg.user .user-actions-time` style rules (the shared `.msg .role` used by assistant messages is untouched). Tighten conversation-timestamps.test.tsx to assert both elements are absent for a user message directly, rather than only covering the older `.msg-time` element. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
🧪 Queued for QA validation — this PR has changes that need a manual QA pass before it's merged. Nothing needed from you; we'll update here once it's validated. Thanks for the contribution! 🙏 |
nettee
left a comment
There was a problem hiding this comment.
I found one non-blocking follow-up in the changed range: the visual cleanup also removes the only sender cue from the user-message DOM, so I left an inline note about preserving that context for assistive tech. I wasn't able to rerun the web tests in this checkout because workspace dependencies are missing here (vitest: command not found).
| const ts = messageTime(message); | ||
|
|
||
| return ( | ||
| <div className="msg user"> |
There was a problem hiding this comment.
Removing the .role block here also removes the only sender label from the user-message DOM, so screen readers now encounter bare prompt text plus the copy button while assistant messages still announce their role in AssistantMessage. The new test in conversation-timestamps.test.tsx reinforces that by asserting .role is absent altogether. To keep the visual cleanup without dropping speaker attribution, consider leaving an off-screen label such as VisuallyHidden with t('chat.you'), or giving the wrapper an equivalent aria-label/aria-labelledby, and update the test to assert the accessible label instead of the DOM node disappearing entirely.
|
The visual cleanup looks good to me — removing the visible "You" header and hover timestamp makes the user prompt bubble feel cleaner and less noisy. One small accessibility follow-up would be nice to keep before/after behavior balanced: even if the "You" label is no longer visible, could we keep a screen-reader-only sender label or add an equivalent aria label for user messages? That way the UI stays visually clean while assistive-tech users can still tell that the message is from the user. This feels like a small follow-up rather than a visual blocker from my side. |
chaoxiaoche
left a comment
There was a problem hiding this comment.
UI/design LGTM. The user-message cleanup matches the goal of reducing visual noise in the chat panel, and the before/after screenshots make the change clear.
I left one small accessibility follow-up about preserving sender context for screen readers, but I do not see that as a visual blocker from my side.
Removing the visible "You" header (PR nexu-io#4515) also dropped the only sender cue for assistive tech, leaving user and assistant messages indistinguishable to screen readers (assistant still renders a visible role header). Re-add the sender name as a visually-hidden .sr-only label so the bubble stays visually clean while AT users can still tell the message is from the user. Addresses @chaoxiaoche's review note. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@chaoxiaoche good catch — agreed the balance matters. Pushed Added a regression test ( Heads-up for QA: this adds one commit on top of the previously-validated head, so the latest |
nettee
left a comment
There was a problem hiding this comment.
@maxmilian I reviewed the live changed ranges in ChatPane, the user-message CSS cleanup, and the updated timestamp regression coverage. The follow-up sr-only sender label restores the user-message speaker cue for assistive tech while keeping the intended visual simplification, and I did not find a new correctness or maintainability issue on 09671d3.
I could not rerun the local web checks in this checkout because node_modules are missing here (vitest: command not found), but the patch itself is coherent and the added regression coverage matches the behavior change. Nice cleanup, and thanks for turning the accessibility follow-up around quickly.
|
The only red check here is unrelated to this PR. This PR touches just four chat-side files:
The failure is in I ran that exact test locally on both ends and it's green both times:
The assertion shape ( |





































































Fixes #3847
Why
Scratching the issue's itch: the project chat panel still showed two pieces of metadata around each user message that add visual noise without earning their space — the
chat.you"You" role header and the relative time stamp beside the copy button. #3875 already removed the day separator and the inline relative message time, but @lefarcen's Jun 17 re-check noted these two user-message elements were still rendered onmain, so the issue was reopened withgood first issue/help wanted. This finishes that cleanup.What users will see
In a project conversation, the user's prompt now reads as just the prompt bubble:
Assistant messages are unchanged (they keep their role label and run metadata). No timestamps elsewhere in the app are affected — this is purely the chat renderer.
Surface area
apps/webScreenshots
Before → after (new project conversation, user prompt in the left chat panel):
Bug fix verification
apps/web/tests/components/conversation-timestamps.test.tsx→ new casedoes not render the user-message "You" header or time stampmainand green on this branch? yes — onmainit fails withexpected <div class="role">…</div> to be null(the "You" header is still rendered); after the change both.roleand.user-actions-timeassertions pass for a user message.Validation
pnpm --filter @open-design/web test— 334 files pass (3334 tests), including the tightenedconversation-timestampscasepnpm typecheck— clean (apps/webDone)Scope notes: the change is limited to the user-message branch of
ChatPaneplus the now-orphaned styles. The shared.msg .rolerule (still used by assistant messages inAssistantMessage.tsx) is intentionally left in place; only the.msg.user-scoped.role/.user-actions-timerules were removed.Also now unused after this change but intentionally left out of scope (happy to prune in a follow-up if you'd prefer): the
chatTimehelpersmessageTime/shortTime/exactDateTime(their last caller was the removed<time>; they still have their own unit tests), and thechat.youi18n key (its only consumer was the removed header).