Skip to content

armgit / alook

Public Imported from GitHub
0

Multi-Agent Collaboration for Team and Friends

fix(web): fill selected reaction tab (#643)

Gener845ab6b2aee7
diff --git a/src/web/src/components/community/messages/message-reactions.test.ts b/src/web/src/components/community/messages/message-reactions.test.ts
index 6432b51f0..a40d0b3db 100644
--- a/src/web/src/components/community/messages/message-reactions.test.ts
+++ b/src/web/src/components/community/messages/message-reactions.test.ts
@@ -179,6 +179,18 @@ describe("MessageReactions", () => {
expect(rail.props.className).toContain("bg-transparent!")
})
+ it("fills only the active reaction tab without relying on the line indicator", () => {
+ vi.useFakeTimers()
+ const { renderer } = renderReactions()
+ const chip = renderer.root.findByProps({ "data-testid": tid.reactionChip("message_1", "πŸ‘") })
+ act(() => chip.props.onPointerDown({ pointerType: "touch", clientX: 10, clientY: 10, stopPropagation: vi.fn() }))
+ act(() => vi.advanceTimersByTime(450))
+ const tab = renderer.root.findByProps({ "data-testid": tid.reactionTab("πŸ‘") })
+ expect(tab.props.className).toContain("data-active:bg-accent!")
+ expect(tab.props.className).toContain("data-active:text-foreground!")
+ expect(tab.props.className).toContain("after:hidden")
+ })
+
it("uses the message author and one-line message preview as its header", () => {
vi.useFakeTimers()
const { renderer } = renderReactions()
diff --git a/src/web/src/components/community/messages/message-reactions.tsx b/src/web/src/components/community/messages/message-reactions.tsx
index 502f36d99..9c69ebcfb 100644
--- a/src/web/src/components/community/messages/message-reactions.tsx
+++ b/src/web/src/components/community/messages/message-reactions.tsx
@@ -246,7 +246,7 @@ function ReactionDetailsDialog({
data-testid={tid.reactionTab(reaction.emoji)}
aria-label={`${reaction.emoji}, ${reaction.count}`}
aria-controls={`${tid.reactionDialog(messageId)}-panel`}
- className="h-11! min-h-11 min-w-11"
+ className="h-11! min-h-11 min-w-11 data-active:bg-accent! data-active:text-foreground! after:hidden"
>
<span aria-hidden="true">{reaction.emoji}</span>
<span>{reaction.count}</span>