From 257cf6ed025da6f1d5310ffafff2e26257a65366 Mon Sep 17 00:00:00 2001 From: lucaronin Date: Mon, 27 Apr 2026 02:20:28 +0200 Subject: [PATCH] fix: keep theme tooltip inside window --- src/components/StatusBar.test.tsx | 21 +++++++++++++++++++ .../status-bar/StatusBarSections.tsx | 2 +- src/components/ui/action-tooltip.tsx | 11 +++++++++- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/components/StatusBar.test.tsx b/src/components/StatusBar.test.tsx index ffa94cfb..378383c5 100644 --- a/src/components/StatusBar.test.tsx +++ b/src/components/StatusBar.test.tsx @@ -131,6 +131,27 @@ describe('StatusBar', () => { expect(screen.queryByLabelText('Notifications are coming soon')).not.toBeInTheDocument() }) + it('end-aligns the theme tooltip to keep it inside the right window edge', async () => { + render( + , + ) + + act(() => { + fireEvent.focus(screen.getByTestId('status-theme-mode')) + }) + const tooltip = await screen.findByTestId('status-theme-mode-tooltip') + expect(tooltip).toHaveAttribute('data-align', 'end') + expect(tooltip).toHaveTextContent('Switch to dark mode') + }) + it('calls onToggleThemeMode from the bottom bar', () => { const onToggleThemeMode = vi.fn() render( diff --git a/src/components/status-bar/StatusBarSections.tsx b/src/components/status-bar/StatusBarSections.tsx index e0fa59b9..7da24e86 100644 --- a/src/components/status-bar/StatusBarSections.tsx +++ b/src/components/status-bar/StatusBarSections.tsx @@ -461,7 +461,7 @@ export function StatusBarSecondarySection({ )} {onOpenFeedback && } - +