Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ test("error bubbles expose structural provider failure metadata", async () => {
assert.match(html, /data-failure-status="failed"/);
});

test("message timestamp and actions share a hover-only meta row", () => {
test("message timestamp and actions share an always-visible meta row", () => {
assert.match(
messageBubbleSource,
/const showActions =[\s\S]*CHAT_MESSAGE_ROLES\.USER[\s\S]*CHAT_MESSAGE_ROLES\.ASSISTANT/,
Expand All @@ -561,8 +561,13 @@ test("message timestamp and actions share a hover-only meta row", () => {
);
assert.match(
messageBubbleSource,
/mt-1 flex min-h-7 w-max v2-chat-readable-width flex-nowrap items-center gap-3 px-1 text-iron-400 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100/,
"timestamp and controls should stay hidden until message hover or focus without being constrained to the bubble width",
/mt-1 flex min-h-7 w-max v2-chat-readable-width flex-nowrap items-center gap-3 px-1 text-iron-400/,
"timestamp and controls should remain visible without being constrained to the bubble width",
);
assert.doesNotMatch(
messageBubbleSource,
/text-iron-400[^"\n]*(?:opacity-0|group-hover:opacity-100|focus-within:opacity-100)/,
"message actions should not depend on hover or keyboard focus for visibility",
Comment on lines +567 to +570

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Make the visibility assertion independent of class order.

The regular expression at Line 569 only detects opacity utilities after text-iron-400. If a future edit places opacity-0 before that token, the test passes while the row is hidden. Extract the metadata-row class expression first, then assert that it contains none of the prohibited opacity utilities.

Proposed test adjustment
+  const metaRowStart = messageBubbleSource.indexOf('"mt-1 flex min-h-7');
+  const metaRowEnd = messageBubbleSource.indexOf('].join(" ")', metaRowStart);
+  const metaRowSource = messageBubbleSource.slice(metaRowStart, metaRowEnd);
   assert.doesNotMatch(
-    messageBubbleSource,
-    /text-iron-400[^"\n]*(?:opacity-0|group-hover:opacity-100|focus-within:opacity-100)/,
+    metaRowSource,
+    /opacity-0|group-hover:opacity-100|focus-within:opacity-100/,
     "message actions should not depend on hover or keyboard focus for visibility",
   );
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
assert.doesNotMatch(
messageBubbleSource,
/text-iron-400[^"\n]*(?:opacity-0|group-hover:opacity-100|focus-within:opacity-100)/,
"message actions should not depend on hover or keyboard focus for visibility",
const metaRowStart = messageBubbleSource.indexOf('"mt-1 flex min-h-7');
const metaRowEnd = messageBubbleSource.indexOf('].join(" ")', metaRowStart);
const metaRowSource = messageBubbleSource.slice(metaRowStart, metaRowEnd);
assert.doesNotMatch(
metaRowSource,
/opacity-0|group-hover:opacity-100|focus-within:opacity-100/,
"message actions should not depend on hover or keyboard focus for visibility",
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@crates/ironclaw_webui/frontend/src/pages/chat/components/message-bubble.test.ts`
around lines 567 - 570, Update the visibility assertion in the message-bubble
test to first extract the metadata-row class expression from
messageBubbleSource, then assert that this extracted expression contains none of
the prohibited opacity utilities regardless of class order. Replace the current
text-iron-400-anchored regular expression while preserving the existing failure
message and visibility requirements.

);
assert.match(
messageBubbleSource,
Expand All @@ -577,7 +582,7 @@ test("message timestamp and actions share a hover-only meta row", () => {
assert.doesNotMatch(
actionRow,
/>\s*\$\{copied \? "Copied" : "Copy"\}\s*<|>Retry</,
"hover controls should use fixed-size icons instead of text that competes with the timestamp",
"message controls should use fixed-size icons instead of text that competes with the timestamp",
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ function MessageBubbleImpl({
{showMetaRow && (
<div
className={[
"mt-1 flex min-h-7 w-max v2-chat-readable-width flex-nowrap items-center gap-3 px-1 text-iron-400 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100",
"mt-1 flex min-h-7 w-max v2-chat-readable-width flex-nowrap items-center gap-3 px-1 text-iron-400",
isUser
? "self-end justify-end"
: isNotice
Expand Down
Loading