From ee5b0239cb62ace48ba294b1dd574bc5e0e78d9d Mon Sep 17 00:00:00 2001 From: Ananovo Date: Fri, 24 Jul 2026 10:57:32 +0800 Subject: [PATCH] fix(web): prevent narrow session tooltips (#1114) --- web/src/components/HoverTooltip.test.tsx | 12 ++++++++++++ web/src/components/HoverTooltip.tsx | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/web/src/components/HoverTooltip.test.tsx b/web/src/components/HoverTooltip.test.tsx index 3cebecf7..607a05e3 100644 --- a/web/src/components/HoverTooltip.test.tsx +++ b/web/src/components/HoverTooltip.test.tsx @@ -9,6 +9,18 @@ import { afterEach(() => cleanup()) describe('HoverTooltip keyboard wiring', () => { + it('sizes short localized tooltips to their content up to the maximum width', () => { + render( + dot}> + 有新活动 + + ) + + const tooltip = screen.getByRole('tooltip', { hidden: true }) + expect(tooltip.className).toContain('w-max') + expect(tooltip.className).toContain('max-w-[14rem]') + }) + it('applies parent row focus-visible reveal classes', () => { render(