PlaywrightTailwind CSSdnd-kitMobile UXNext.js

It Looked Fine on Desktop — 6 Mobile UX Fixes I Found by Auditing with Playwright

July 13, 20268 min read

Stuck for an Answer to "How Does It Look on Mobile?"

In a previous post, I wrote about reviewing my side project MatchDa from a new user's perspective and fixing 4 P0 issues. The natural next question that came up was this:

"So, how does this look on mobile?"

That stung a little. I'd always developed in a desktop browser, and "checking mobile" meant, at most, an occasional glance at devtools' responsive mode. Most of the traffic coming in from the Korean community probably arrives through links shared in KakaoTalk or community apps — which means it's mostly mobile.

So this time I gave mobile a proper audit. This post is the record of how I did it (Playwright mobile viewports) and the fixes that came out of it. If you've been building desktop-first, you probably have similar problems hiding somewhere.

Step 1. Automating Mobile Screenshots with Playwright

Rather than walking through pages on a physical phone one by one, scripting a shot of every key page at once is faster and reproducible. The project already had playwright-core for scraping, so I just reused it.

// mobile-shots.mjs — 프로덕션 빌드를 로컬에 띄우고 실행
import { createRequire } from 'module'
const require = createRequire('/path/to/project/package.json')
const { chromium } = require('playwright-core')

const browser = await chromium.launch({ channel: 'chrome' }) // 시스템 크롬 사용
const ctx = await browser.newContext({
  viewport: { width: 390, height: 844 },  // iPhone 14 급
  deviceScaleFactor: 2,
  isMobile: true,
  hasTouch: true,
})
const page = await ctx.newPage()

for (const [name, path] of [['landing', '/'], ['login', '/login'], ['pricing', '/pricing']]) {
  await page.goto('http://localhost:3457' + path, { waitUntil: 'networkidle' })

  // 핵심: 가로 오버플로(모바일 깨짐의 주범)를 수치로 측정
  const overflow = await page.evaluate(
    () => document.documentElement.scrollWidth - document.documentElement.clientWidth
  )
  console.log(`${name}: horizontal overflow = ${overflow}px`)

  await page.screenshot({ path: `${name}-top.png` })
  await page.evaluate(() => window.scrollTo(0, document.body.scrollHeight * 0.45))
  await page.screenshot({ path: `${name}-mid.png` })
}
await browser.close()

Two things worth calling out:

  1. Measure horizontal overflow as a number. If scrollWidth - clientWidth isn't 0, something is spilling outside the viewport somewhere. Easy to miss by eyeballing screenshots alone, but this one line nails it down for certain.
  2. You don't need the full playwright package. playwright-core plus channel: 'chrome' uses the Chrome you already have installed, with no separate browser binary download.

Result: 0px overflow on the public pages, no broken layout either. A relief. But the real problems showed up in the logged-in "workspace" screen.

Step 2. Problem #1 — The Resume Comparison Screen Is a Scrolling Nightmare on Mobile

The core workspace screen lays a Korean resume (editable) and an English resume (AI-translated) side by side for comparison. Flawless on desktop — but on mobile, where it collapses to grid-cols-1, it turns into this:

한국어 이력서 전체 (스크롤 한참)
  ↓
영문 이력서 전체 (스크롤 한참)
  ↓
AI 채팅 (맨 아래)

You have to scroll past two full resumes' worth of content to reach the AI chat — and when you actually send "fix up my experience summary" through chat, the document that updates is way up off-screen. You can't even see what changed.

Fix: Tab Switching Plus a Fixed Bottom Sheet

I added two mobile-only pieces of UI state.

// 모바일(lg 미만): 원본/영문 탭 전환 + AI 채팅 하단 시트
const [mobilePane, setMobilePane] = useState<'ko' | 'en'>('ko')
const [chatOpen, setChatOpen] = useState(false)

The document panels toggle via Tailwind's responsive utilities. The key is hidden lg:block — on mobile, only the selected tab shows, and on desktop, both show regardless of the state.

{/* 좌: 한국어 원본 */}
<div className={mobilePane === 'ko' ? '' : 'hidden lg:block'}>...</div>

{/* 우: 영문 */}
<div className={mobilePane === 'en' ? '' : 'hidden lg:block'}>...</div>

I turned the AI chat into a fixed bottom sheet on mobile. No need for two separate markup copies — just swap the positioning responsively.

{/* 모바일: 하단 고정 시트 / lg 이상: 본문 하단 정적 카드 */}
<div className="fixed inset-x-0 bottom-0 z-30 lg:static lg:z-auto lg:mx-auto lg:max-w-[1320px]">
  <button
    onClick={() => setChatOpen(o => !o)}
    className="flex w-full items-center ... lg:pointer-events-none"
  >
    이력서 AI 어시스턴트 {/* 모바일: 탭하면 열림 / 데스크톱: 항상 열려 있음 */}
  </button>
  <div className={chatOpen ? 'block' : 'hidden lg:block'}>
    {/* 대화 영역: 모바일은 36dvh — 키보드가 올라와도 이력서가 위로 보인다 */}
    <div className="max-h-[36dvh] overflow-y-auto lg:max-h-[280px]">...</div>
  </div>
</div>

One caveat: a fixed sheet covers up the last bit of content in the document. Don't forget mobile-only bottom padding on the document area (pb-32 lg:pb-6).

Step 3. Problem #2 — The iOS Keyboard Swallows the Input Box (vh vs dvh)

The onboarding chat container was h-[70vh]. No problem on desktop, but on iOS Safari, once the keyboard comes up, vh doesn't shrink. The bottom half of the viewport gets covered by the keyboard, yet the container stubbornly keeps its original height, and the input box pinned to the bottom disappears behind the keyboard.

The fix is one character.

- <div className="... flex flex-col h-[70vh]">
+ <div className="... flex flex-col h-[70dvh]">
UnitBased onWhen keyboard comes up
vhInitial viewport height (fixed)Doesn't shrink → input box hidden
dvhCurrent visible viewport height (dynamic)Shrinks along with it → input box stays visible
svh / lvhMinimum/maximum viewport (fixed)Always small/large respectively

For any vertical flex layout with input UI pinned to the bottom — chat, forms — dvh is the safe default. Tailwind lets you use it directly as an arbitrary value, like h-[70dvh].

Step 4. Problem #3 — Kanban Drag Fights the Scroll Gesture on Touch

The application-status kanban board uses dnd-kit to drag cards between states. But the only sensor configured was this.

const sensors = useSensors(
  useSensor(PointerSensor, { activationConstraint: { distance: 8 } })
)

PointerSensor's distance: 8 means "drag starts once you've moved 8px" — fine for a mouse, where it cleanly separates a click from a drag, but disastrous on touch. The moment you swipe a card to scroll with your finger, you cross 8px and a drag starts instead of a scroll.

Touch needs a time-based threshold, not a distance-based one. I added TouchSensor.

const sensors = useSensors(
  // 마우스: 8px 이상 움직여야 드래그 (클릭·드롭다운 조작 보호)
  useSensor(PointerSensor, { activationConstraint: { distance: 8 } }),
  // 터치: 200ms 길게 누른 뒤 드래그 (스크롤 제스처와 충돌 없음)
  useSensor(TouchSensor, { activationConstraint: { delay: 200, tolerance: 8 } }),
)
  • delay: 200 — if the finger moves within 200ms, it's treated as a scroll and the drag never starts
  • tolerance: 8 — allows up to 8px of jitter during a long-press without canceling it

I added touch-manipulation (a Tailwind class) to the card elements too. It disables browser gestures like double-tap zoom, so the long-press-then-drag transition stays reliable. touch-action: none would block page scrolling entirely over a card, so for a delay-based sensor, manipulation is the right call.

And one safety net — however good touch drag gets, dragging across four stacked columns on a narrow mobile screen is still hard. Having a status-change dropdown on every card (which we already had) is the real solution; drag is just a bonus.

Step 5. Flow Improvements — Copy and Flow Change UX More Than a Line of Code

Beyond layout, I also cleaned up P1/P2 flow issues that came out of the review. Technically minor, but the impact is large.

Auto-login after email verification. The old flow was sign up → verify by email → come back and log in manually. Just specifying emailRedirectTo on Supabase's signUp sends the verification link to a callback route, where the session gets exchanged and you're logged in immediately.

await supabase.auth.signUp({
  email, password,
  options: { emailRedirectTo: `${window.location.origin}/auth/callback` },
})

The callback also routes users who haven't finished onboarding straight there. One round-trip drop-off point, gone.

A 3-step cold-start guide. For a brand-new user with nothing registered yet, I put a checklist at the top of the job-search screen: "① Finish your resume → ② Register a job page → ③ Check your first match." Completed steps get a checkmark, incomplete ones get a shortcut link. It disappears once at least one source is registered. The point is that the system tells a user dropped into an empty screen what to do next.

Outcome-oriented button names. There was a button labeled "Send to management" that gave no hint of what actually happens when you press it. I renamed it to "Add to application tracker," matching the sidebar menu name. I also aligned the page title with the menu name ("Resume Studio" → "My Resume"). Buttons and menus should be named after the outcome the user gets, not the feature name a developer happened to use.

Giving errors an exit. A "free plan limit exceeded" error ended with "(pricing page /pricing)" — a path as plain text. Was the user supposed to type that into the address bar? I changed it so that any error message containing the word "upgrade" also renders an actual link button.

Localizing demo data. The service targets Australia and New Zealand, but the landing page demo showed job listings from Berlin, Toronto, and Singapore. I swapped them for Sydney (Atlassian), Auckland (Xero), and Melbourne (Culture Amp). The gap between a target user landing on the page and thinking "oh, that's a company I'd actually want to work at" versus not, is bigger than it sounds.

Summary — A Mobile Audit Checklist

Turning what I ran into this time into a checklist for desktop-first projects:

  1. Measure horizontal overflow as a number. A Playwright mobile viewport plus one line of scrollWidth - clientWidth is all it takes.
  2. Turn side-by-side comparison layouts into tabs on mobile. A hidden lg:block toggle solves it without touching desktop at all.
  3. Use dvh instead of vh for any layout with input UI at the bottom. The input box survives even when the iOS keyboard comes up.
  4. Touch drag needs a time (delay) threshold, not a distance one. With dnd-kit, that's TouchSensor plus delay plus touch-manipulation — and a fallback that works without drag at all.
  5. Layout isn't the only UX. Post-auth flow, empty-screen guidance, button names, exits from errors — small, few-line fixes that change how the product actually feels.

Looking fine on desktop guarantees nothing. What your users are actually holding is a 390px screen.

PM

backtodev

A 40-something PM returns to code. Learning, failing, and growing.