From b270632144a5a8bf069883b6151d853cc9dd4720 Mon Sep 17 00:00:00 2001 From: Bob Lee Date: Mon, 9 Nov 2026 15:18:49 +0800 Subject: [PATCH] fix(web-ui): remove the hover tooltip from companion pet bubbles Hovering a session bubble popped a native title tooltip repeating the session title and status over the pet window. Drop it; the status text stays for assistive tech and an overflowing title still uses the hover marquee. --- .../AgentCompanionDesktopPet.scss | 3 +-- .../AgentCompanionDesktopPet.test.tsx | 15 +++++++++++++++ .../AgentCompanionDesktopPet.tsx | 5 ++--- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/web-ui/src/app/components/AgentCompanionDesktopPet/AgentCompanionDesktopPet.scss b/src/web-ui/src/app/components/AgentCompanionDesktopPet/AgentCompanionDesktopPet.scss index 717143b9e0..e469f628ea 100644 --- a/src/web-ui/src/app/components/AgentCompanionDesktopPet/AgentCompanionDesktopPet.scss +++ b/src/web-ui/src/app/components/AgentCompanionDesktopPet/AgentCompanionDesktopPet.scss @@ -463,8 +463,7 @@ font-weight: var(--openbitfun-type-label-selected-font-weight); } - /* The words behind the glyph stay for assistive tech; sighted users get - them in the bubble's tooltip. */ + /* The words behind the glyph stay for assistive tech. */ &__bubble-status { position: absolute; width: 1px; diff --git a/src/web-ui/src/app/components/AgentCompanionDesktopPet/AgentCompanionDesktopPet.test.tsx b/src/web-ui/src/app/components/AgentCompanionDesktopPet/AgentCompanionDesktopPet.test.tsx index 92b87da952..35cb281d9a 100644 --- a/src/web-ui/src/app/components/AgentCompanionDesktopPet/AgentCompanionDesktopPet.test.tsx +++ b/src/web-ui/src/app/components/AgentCompanionDesktopPet/AgentCompanionDesktopPet.test.tsx @@ -632,6 +632,21 @@ describe('AgentCompanionDesktopPet', () => { ); }); + it('shows no tooltip on a session bubble while keeping its status for assistive tech', () => { + pushActivity({ + mood: 'working', + tasks: [task()], + sequence: 1, + emittedAt: 1, + }); + + const bubble = query('.openbitfun-agent-companion-window__bubble'); + + expect(bubble?.hasAttribute('title')).toBe(false); + expect(query('.openbitfun-agent-companion-window__bubble-title')?.getAttribute('data-overflow-tooltip')).toBeNull(); + expect(bubble?.querySelector('.openbitfun-agent-companion-window__bubble-status')?.textContent).toBeTruthy(); + }); + it('hides the composer entry for sessions that cannot be replied to directly', () => { pushActivity({ mood: 'working', diff --git a/src/web-ui/src/app/components/AgentCompanionDesktopPet/AgentCompanionDesktopPet.tsx b/src/web-ui/src/app/components/AgentCompanionDesktopPet/AgentCompanionDesktopPet.tsx index 9c16b09e62..a67af6a2be 100644 --- a/src/web-ui/src/app/components/AgentCompanionDesktopPet/AgentCompanionDesktopPet.tsx +++ b/src/web-ui/src/app/components/AgentCompanionDesktopPet/AgentCompanionDesktopPet.tsx @@ -114,7 +114,7 @@ function menuAnchorFromEvent(event: React.MouseEvent): MenuAnchor { }; } -/** A bubble states its task with a glyph; the words stay for tooltips and assistive tech. */ +/** A bubble states its task with a glyph; the words stay for assistive tech. */ const TASK_STATE_GLYPHS: Record = { running: LucideLoaderCircle, waiting: LucideHourglass, @@ -1128,7 +1128,7 @@ export const AgentCompanionDesktopPet: React.FC = () => { strokeWidth={2.25} aria-hidden="true" /> - {/* The bubble's own tooltip carries title and status together. */} + {/* Bubbles show no tooltip; an overflowing title scrolls on hover instead. */} {task.title} @@ -1215,7 +1215,6 @@ export const AgentCompanionDesktopPet: React.FC = () => {