From d09e400d0498aa6c9c1d0d1cf2bb2f9c9bd277d6 Mon Sep 17 00:00:00 2001
From: Linus Rath <139418639+rathlinus@users.noreply.github.com>
Date: Tue, 3 Nov 2026 16:11:16 +0100
Subject: [PATCH] fix: keep the tab bar on the mail list on a phone held
sideways, hiding it only over what fills the window
---
app/globals.css | 9 --
.../mail-app-short-window-tab-bar.test.tsx | 129 ++++++++++++++++++
components/mail/mail-app.tsx | 10 +-
3 files changed, 137 insertions(+), 11 deletions(-)
create mode 100644 components/mail/__tests__/mail-app-short-window-tab-bar.test.tsx
diff --git a/app/globals.css b/app/globals.css
index c1d473154..94c1acac4 100644
--- a/app/globals.css
+++ b/app/globals.css
@@ -1351,15 +1351,6 @@ optgroup {
inset-inline-end: 0;
}
-/* A phone on its side counts as a tablet, which keeps the bottom bar. With a
- message or the composer open the bar takes a sixth of a window this short and
- leaves the message a few lines; a phone held upright hides it there too. */
-@media (max-height: 32rem) {
- body:has([data-tour="email-viewer"], [data-tour="composer"]) [data-mobile-navigation] {
- display: none;
- }
-}
-
/* The account popover: a wide card with a very round corner, rather
than the narrow menu the rail and the sidebar switchers drop. */
[data-interface-layout="mountain-view"] [data-mv-account-popover] {
diff --git a/components/mail/__tests__/mail-app-short-window-tab-bar.test.tsx b/components/mail/__tests__/mail-app-short-window-tab-bar.test.tsx
new file mode 100644
index 000000000..8e4932e68
--- /dev/null
+++ b/components/mail/__tests__/mail-app-short-window-tab-bar.test.tsx
@@ -0,0 +1,129 @@
+import React from 'react';
+import { fireEvent, render, screen } from '@testing-library/react';
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
+import type { Email, Mailbox } from '@/lib/jmap/types';
+import { useAuthStore } from '@/stores/auth-store';
+import { useEmailStore } from '@/stores/email-store';
+import { useSettingsStore } from '@/stores/settings-store';
+import { usePluginStore } from '@/stores/plugin-store';
+import { useThemeStore } from '@/stores/theme-store';
+import { useUIStore } from '@/stores/ui-store';
+import { DEFAULT_SEARCH_FILTERS } from '@/lib/jmap/search-utils';
+
+// A phone on its side: the bottom bar takes a sixth of the window, so it goes
+// over what fills the window. It stays wherever the list shows, or there is no
+// way left to the other apps.
+
+const device = vi.hoisted(() => ({ current: { isMobile: false, isTablet: true, isDesktop: false }, short: true }));
+
+vi.mock('@/hooks/use-media-query', () => ({
+ useDeviceDetection: () => device.current,
+ useMediaQuery: (query: string) => query.includes('max-height') && device.short,
+ useIsDesktop: () => false,
+}));
+vi.mock('@/components/layout/navigation-rail', () => ({ NavigationRail: () => }));
+vi.mock('@/components/layout/sidebar', () => ({
+ Sidebar: ({ onCompose }: { onCompose: () => void }) => ,
+}));
+vi.mock('@/components/email/email-composer', () => ({ EmailComposer: () =>