Skip to content

fix(modal): a sheet ends where a phone's keyboard begins - #395

Merged
devswha merged 2 commits into
mainfrom
fix/modal-above-keyboard
Oct 3, 2026
Merged

devswha merged 2 commits into
mainfrom
fix/modal-above-keyboard

Conversation

@devswha

@devswha devswha commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Change

In the iPhone home screen app, a dialog with a text field went behind the keyboard.

.modal-scrim is position: fixed; inset: 0, and at phone width its dialog is a bottom sheet. A home screen app keeps the layout viewport at full height while the keyboard is up, so the sheet's bottom edge was the screen's, under the keyboard: the command palette's list ran behind it, and a palette with few or no results was hidden whole, search field included (only the dimmed app was left on screen).

While the keyboard is up (data-keyboard, lib/viewport.ts) the scrim is now --app-height tall, the same height the shell already takes, and a sheet drops its home-indicator padding. Nothing changes without a keyboard, or on a desktop. Every dialog on the shared scrim gets it: the palette, Settings, New workspace / New tab, the worktree dialogs, confirms, the row menu's sheet, Files and the file viewer.

Found while checking #392 in the iOS Simulator; it predates the tab strip.

Validation

  • scripts/mobile-viewport-regression.ts (part of scripts/ui-regression.ts): with the palette open and its search focused at a 500px visual viewport, the scrim ends at 500 and the palette and its search field are inside 0–500, with the full list and with a query that matches nothing. On main it fails: the scrim ends at the keyboard ({"scrim":{"top":0,"bottom":844},"palette":{"top":32,"bottom":844},…}).
  • iOS Simulator, iPhone 17 Pro, iOS 27.0, home screen app, software keyboard: on main the palette with a query that matched nothing was not on screen at all; here it sits directly above the keyboard's accessory bar with its search field and the "no match" line, and the full list ends at the keyboard.
  • bun run typecheck, bun run build: pass.
  • bun run test:unit: 1086 pass, 3 skip, 0 fail.
  • bun scripts/ui-regression.ts: 59 PASS lines, exit 0.

Not checked

  • A physical iPhone, and iOS 26.5.
  • In the simulator only the palette was opened with the keyboard up; the other dialogs share the rule but were not each opened there.
  • Android Chrome resizes the layout viewport itself (interactive-widget=resizes-content), where the new height equals the old one.

The scrim was fixed to the whole screen. An iPhone home screen app keeps the
layout viewport at full height under the keyboard, so a bottom sheet sat behind
it: the command palette's results ran under the keyboard, and a palette with
few results was hidden whole, its search field included. While the keyboard is
up the scrim is --app-height tall, as the shell is.
@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (1)
CONTRIBUTING.md — configured

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: devswha/herdr-web-ui/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0b931c7a-00bb-4bfe-90a0-5b5b5ff32b7a
📥 Commits

Reviewing files that changed from the base of the PR and between 53cbe93 and 6eebda2.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • DESIGN.md
  • scripts/mobile-viewport-regression.ts
  • src/components/CommandPalette.css
  • src/styles.css

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • On iPhone home-screen apps, dialogs and command-palette sheets now stay above the on-screen keyboard. Short or empty search results remain visible, and sheets no longer extend behind the keyboard.

Walkthrough

Mobile modal and command palette styles now account for a visible keyboard. The viewport regression script checks that the command palette and search field remain within a simulated keyboard-reduced viewport.

Changes

Mobile keyboard overlays

Layer / File(s) Summary
Keyboard-aware modal geometry
src/styles.css, DESIGN.md, CHANGELOG.md
When data-keyboard is present, the modal scrim uses --app-height, and narrow-screen sheets remove bottom safe-area padding. The design documentation and changelog describe this behavior.
Command palette keyboard behavior
src/components/CommandPalette.css, scripts/mobile-viewport-regression.ts
The command palette removes bottom padding while the keyboard is visible. The viewport regression checks empty and unmatched searches at a simulated height of 500px, then closes the palette and restores the viewport.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: haeminway1

Merge Risk: ⚪ Minimal · up to 6eebd

The change sizes mobile overlays to the visible viewport, and the command-palette regression checks empty and unmatched searches. Native-device coverage is limited, but the reviewed evidence reveals no actionable merge risk.

Architecture Summary

Architecture risk: 🔵 Low · up to 6eebd

The change affects 4 systems.

Changed systems: scripts, src, CHANGELOG.md, DESIGN.md

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — scripts (service) was modified; 1 changed file maps to changed impact.
  • observed — src (service) was modified; 2 changed files map to changed impact.
  • observed — CHANGELOG.md (service) was modified; 1 changed file maps to changed impact.
  • observed — DESIGN.md (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in CHANGELOG.md: Added an Unreleased fix entry describing the iPhone home-screen keyboard overlap and its reported resolution for text-field dialogs, bottom sheets, and short command-palette results.
  • observed — Modified behavior in DESIGN.md: The modal documentation adds the phone-keyboard behavior: with data-keyboard, the scrim is --app-height tall and the sheet drops its safe-area padding.
  • observed — Modified behavior in scripts/mobile-viewport-regression.ts: Adds a command-palette keyboard-viewport test: with the simulated height at 500px, it checks an empty search and a no-match query, asserting the scrim ends at 500px and the palette and search field remain within that boundary. It optionally saves a screenshot, then closes the palette, blurs the field, and restores the viewport.
  • observed — Modified behavior in scripts/mobile-viewport-regression.ts: Updates the PASS message to include the sheet-above-keyboard test.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: keeping a phone sheet above the keyboard.
Description check ✅ Passed The description includes the required Change and Validation sections, explains the problem and resulting behavior, and lists specific checks and results. It reports simulator validation but does not i…
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (4 skipped: 4 …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@devswha
devswha merged commit ffe8ab8 into main Oct 3, 2026
4 checks passed
@devswha
devswha deleted the fix/modal-above-keyboard branch October 3, 2026 13:59
devswha added a commit that referenced this pull request Oct 3, 2026
Bumps package.json and herdr-plugin.toml to 0.3.47, moves the Unreleased
notes under [0.3.47] - 2026-10-03 (the two Fixed lists folded into one),
and adds the compare link. Raises the remote PC bundle to 14 (new
routes: `/api/tab/rename`, `/api/tab/close`): push the `remote-v14` tag
and let the bundle workflow publish before running release.yml.

Carries #374, #388, #389, #390, #391, #392, #394, #395.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Fable 5.1 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant