From 14f41c37758dff435f325f721265676b88d7ff84 Mon Sep 17 00:00:00 2001 From: poli0981 <127664709+poli0981@users.noreply.github.com> Date: Thu, 14 May 2026 11:54:12 +0700 Subject: [PATCH] fix(mobile): header overflow on small viewports + workspace panels disappearing on short/landscape phones (#42) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three viewport regressions reported on iPhone 14 Pro (393 portrait, 852x393 landscape) and shorter phones; iPad and tablets were unaffected. Header overflow - iPhone 14 Pro is 393px wide; the header's brand wordmark + nav + lang switcher + theme + GitHub icon row summed to ~460px, forcing horizontal page scroll. Hide the "JSONPrism" wordmark below sm (640px) and rely on the BrandMark SVG alone on phones — saves ~90px and the row now fits. Workspace panels collapsing - "Output trên một số mẫu điện thoại có chiều dài ngắn không có" + "Khi xoay ngang -> Toàn bộ trường Input và output bị biến mất". Root causes: 1. min-h-[40vh] on each stacked panel (added in 1.4.0 for usable mobile heights) summed to 80vh, which exceeded the available height after the header / Home padding / workspace toolbar / status bar / footer chrome on short phones. The workspace container's overflow-hidden then clipped the lower panel off-screen. 2. h-screen (= 100vh) on the Layout root doesn't account for iOS Safari's dynamic toolbar — the computed height could exceed the actual visible area on rotation. - Swap min-h-[40vh] for grid-rows-2 (mobile) / md:grid-rows-1 (desktop). Each panel now takes exactly half the workspace height share — always visible, no overflow. - Swap h-screen for h-dvh (Tailwind v4 dynamic viewport height) so iOS Safari's actual visible area drives the layout. THIRD-PARTY.md - Add the five CodeMirror language packs that landed across 1.3.0 + 1.4.0 but weren't listed: lang-yaml, lang-xml, lang-markdown, lang-sql, legacy-modes. All MIT, all @codemirror/*. Co-authored-by: Claude Opus 4.7 (1M context) --- THIRD-PARTY.md | 5 +++++ src/components/converter/ConverterWorkspace.tsx | 6 +++--- src/components/layout/Header.tsx | 2 +- src/components/layout/Layout.tsx | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/THIRD-PARTY.md b/THIRD-PARTY.md index 0f658f6..9441235 100644 --- a/THIRD-PARTY.md +++ b/THIRD-PARTY.md @@ -46,6 +46,11 @@ installed as a runtime dependency. | `@codemirror/view` | ^6.34.0 | MIT | [codemirror.net](https://codemirror.net/) | | `@codemirror/language` | ^6.10.0 | MIT | [codemirror.net](https://codemirror.net/) | | `@codemirror/lang-json` | ^6.0.0 | MIT | [codemirror.net](https://codemirror.net/) | +| `@codemirror/lang-yaml` | ^6.1.3 | MIT | [codemirror.net](https://codemirror.net/) | +| `@codemirror/lang-xml` | ^6.1.0 | MIT | [codemirror.net](https://codemirror.net/) | +| `@codemirror/lang-markdown` | ^6.5.0 | MIT | [codemirror.net](https://codemirror.net/) | +| `@codemirror/lang-sql` | ^6.10.0 | MIT | [codemirror.net](https://codemirror.net/) | +| `@codemirror/legacy-modes` | ^6.5.2 | MIT | [codemirror.net](https://codemirror.net/) | | `@codemirror/lint` | ^6.8.0 | MIT | [codemirror.net](https://codemirror.net/) | | `@lezer/highlight` | ^1.2.0 | MIT | [lezer.codemirror.net](https://lezer.codemirror.net/) | diff --git a/src/components/converter/ConverterWorkspace.tsx b/src/components/converter/ConverterWorkspace.tsx index ed3589f..58ee04f 100644 --- a/src/components/converter/ConverterWorkspace.tsx +++ b/src/components/converter/ConverterWorkspace.tsx @@ -215,8 +215,8 @@ export function ConverterWorkspace() {
-
-
+
+
-
+
- + JSONPrism diff --git a/src/components/layout/Layout.tsx b/src/components/layout/Layout.tsx index cc9f20b..d0d4656 100644 --- a/src/components/layout/Layout.tsx +++ b/src/components/layout/Layout.tsx @@ -4,7 +4,7 @@ import { Footer } from './Footer'; export function Layout() { return ( -
+