fix(mobile): header overflow on small viewports + workspace panels disappearing on short/landscape phones (#42)

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) <noreply@anthropic.com>
This commit is contained in:
poli0981andClaude Opus 4.7 authored and GitHub committed 2026-05-14 11:54:12 +07:00
1 parent 5659c67f4b
commit 14f41c3775
4 files changed
+10 -5

No files matched your search

+5
View File
@@ -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/) |
@@ -215,8 +215,8 @@ export function ConverterWorkspace() {
</div>
<div className="border-border bg-card/40 flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border">
<div className="grid min-h-0 flex-1 md:grid-cols-2">
<div className="md:border-border/60 min-h-[40vh] border-b md:min-h-0 md:border-r md:border-b-0">
<div className="grid min-h-0 flex-1 grid-rows-2 md:grid-cols-2 md:grid-rows-1">
<div className="md:border-border/60 min-h-0 border-b md:border-r md:border-b-0">
<InputPanel
value={input}
onChange={setInput}
@@ -226,7 +226,7 @@ export function ConverterWorkspace() {
onMultiFileDrop={handleMultiFileDrop}
/>
</div>
<div className="min-h-[40vh] md:min-h-0">
<div className="min-h-0">
<OutputPanel
format={format}
content={output}
+1 -1
View File
@@ -13,7 +13,7 @@ export function Header() {
<div className="mx-auto flex h-14 max-w-screen-2xl items-center gap-2 px-3 sm:gap-6 sm:px-6">
<Link to="/" className="group flex items-center gap-2 sm:gap-2.5">
<BrandMark className="h-6 w-6 sm:h-7 sm:w-7" />
<span className="font-display text-base leading-none tracking-tight sm:text-xl">
<span className="font-display hidden text-xl leading-none tracking-tight sm:inline">
JSON<span className="text-spectrum italic">Prism</span>
</span>
</Link>
+1 -1
View File
@@ -4,7 +4,7 @@ import { Footer } from './Footer';
export function Layout() {
return (
<div className="flex h-screen flex-col">
<div className="flex h-dvh flex-col">
<Header />
<main className="flex min-h-0 flex-1 flex-col">
<Outlet />