Skip to content

fix(mobile): a field that keeps its focus with the keyboard down leaves no band under the composer - #349

Merged
devswha merged 3 commits into
devswha:mainfrom
Haeminway1:fix/keyboard-gone-focus-kept
Oct 2, 2026
Merged

devswha merged 3 commits into
devswha:mainfrom
Haeminway1:fix/keyboard-gone-focus-kept

Conversation

@Haeminway1

Copy link
Copy Markdown
Contributor

On an iPhone home screen app, a band as tall as the status bar (~59pt) still showed under the composer, even though #186 removed it for the idle case.

Why. viewport.ts publishes the visual height as --app-height whenever a text field on a touch screen has focus, on the assumption that its keyboard is up. iOS keeps the field focused with the keyboard down in two cases:

  • coming back from a dictation keyboard's own app (e.g. Typeless records in its app, then returns);
  • after the keyboard's own close key.

In standalone mode the idle visual viewport is the screen minus the status bar. So the shell shrank to that height and left the band.

Fix. The keyboard also has to take room: the visual viewport must be more than 150px shorter than the screen (orientation-aware), which a status bar and a toolbar never are. A focused field with the keyboard down now gets the full 100dvh shell. Hardware keyboards on touch devices also stop shrinking the shell.

Test. scripts/mobile-viewport-regression.ts now focuses the composer with the idle 780px visual viewport and expects no keyboard sizing. It then checks that the keyboard opening (500) and closing (795) while focus stays are followed.

  • On main the new step fails: observed {"keyboard":true,"appHeight":"780px","pixels":780}.
  • With the fix the whole viewport contract passes.
  • bun run typecheck passes.

🤖 Generated with Claude Code

…es no band under the composer

A focused text field on a touch screen was taken for an open keyboard. An
iPhone home screen app keeps the field focused with the keyboard down, back
from a dictation keyboard's own app or after the keyboard's own close key,
and its idle visual viewport is the screen less the status bar: the shell
took that height and left a status-bar-tall band under the composer. The
keyboard now also has to take room: the visual viewport short of the screen
by more than a status bar and a toolbar are.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 2, 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: b1327803-6636-4973-88bf-f0d1aa5ac402

📥 Commits

Reviewing files that changed from the base of the PR and between 02e4967 and 228f0d4.

📒 Files selected for processing (1)
  • CHANGELOG.md

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


📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • On mobile, keyboard sizing now activates only when a typing field is focused and the visual viewport is significantly shorter than the screen. This prevents focusing a field while the keyboard is closed from incorrectly triggering keyboard sizing.
    • When the viewport returns to its normal height, keyboard sizing is cleared and the app returns to its expected height.
    • On iPhone home-screen apps, a field that remains focused after the keyboard closes no longer leaves a status-bar band below the message box.

Walkthrough

Keyboard sizing now depends on viewport height as well as pointer type and the focused element. The regression test checks idle, reduced, and restored viewport heights. The changelog records the iPhone home-screen status-bar band issue.

Changes

Mobile keyboard sizing

Layer / File(s) Summary
Keyboard viewport detection and regression coverage
src/lib/viewport.ts, scripts/mobile-viewport-regression.ts, CHANGELOG.md
syncKeyboard sets data-keyboard only when a coarse pointer, a typing-eligible focused element, and a visual viewport reduction greater than 150 pixels are present. The regression test checks idle, reduced, and restored heights. The changelog describes the status-bar band issue when a focused field remains focused after the keyboard closes.

Priority: ⬇️ Low

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

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: beomq

Merge Risk: ⚪ Minimal · up to 228f0

Keyboard sizing now waits for a reduced visual viewport, addressing the reported composer band when focus persists after the keyboard closes. The regression checks idle, open, restored, and rotated states; no actionable merge risk remains.

Architecture Summary

Architecture risk: 🔵 Low · up to 228f0

The change affects 3 systems.

Changed systems: CHANGELOG.md, scripts, src

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

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

Before / after behavior

  • observed — Modified behavior in scripts/mobile-viewport-regression.ts: The test now checks the focused composer with the keyboard down at the idle viewport height, then verifies that resizing to 500px enables keyboard sizing and restoring the height to 795px clears it. Previously, the composer was focused immediately before the existing keyboard-resize checks.
  • observed — Modified behavior in src/lib/viewport.ts: The comment now describes focused fields with the keyboard closed. syncKeyboard adds a keyboard-room check: when a visual viewport exists, it compares its height with the screen’s orientation-adjusted height and requires a difference greater than 150 pixels; without a visual viewport, the check passes. The data-keyboard attribute is set only when this check, the coarse-pointer check, and the existing typing-element check all pass.
  • observed — Modified behavior in CHANGELOG.md: Added a changelog entry for the iPhone home-screen status-bar band issue when a focused text field remains focused after the keyboard closes.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description includes the required Change and Validation sections. It clearly explains the mobile viewport defect, the fix, and the reported regression-test and typecheck results. It does not inclu…
Title check ✅ Passed The title clearly and specifically describes the primary mobile keyboard-focus fix. It is related to the changeset and sufficiently concise despite its length.
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 2 files. (1 skipped: 1 …
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 unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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

Haeminway1 added a commit to Haeminway1/herdr-web-ui that referenced this pull request Oct 2, 2026
…mo chat from its own agent dir (devswha#350)

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@devswha
devswha merged commit ae1ed32 into devswha:main Oct 2, 2026
4 checks passed
devswha added a commit that referenced this pull request Oct 3, 2026
Bumps package.json and herdr-plugin.toml to 0.3.44, moves the Unreleased
notes under [0.3.44] - 2026-10-03, adds the compare link, and removes a
merge marker line left in CHANGELOG.md by #351's conflict resolution.
### Added
- Native Windows x64 installation through `install.ps1`, with the same
herdr plugin startup
and updates. Windows needs Bun and Git, without Node or WSL, and keeps
using the terminal
screen mirror. ([#330](#330)
by @JJLiebig)
- Settings can choose Chat, Terminal, or Auto as the default view for
panes. Changing it resets
remembered pane views on this device. Shell panes still open in
Terminal.
([#325](#325) by
@Haeminway1)
- Choose the terminal input line or direct typing on desktop as well as
touch screens, and
customize or unbind the app's Mod+Shift shortcuts with conflict checks
and reset.
  ([#334](#334))

### Changed
- In the sidebar's By workspace view, a workspace with one pane keeps
its numbered header and
can be folded, renamed and reordered from that header, just like a
workspace with several panes.
  ([#332](#332) by @beomq)
- The top usage panel shows larger percentages, remaining-capacity
colors and compact reset
countdowns with their local time. Expired reset times stay hidden until
fresh usage arrives.
([#336](#336) by
@Haeminway1)
- Pane titles that contain a directory show its last folder, and
matching workspace and folder
names appear once in the sidebar and command palette, including Windows
paths.
([#337](#337) by
@Haeminway1)
- In the sidebar's By workspace view, a pane row no longer repeats the
workspace its header names.
Its second line shows the folder only when neither the title nor the
workspace already says it.
  ([#358](#358))

### Fixed
- GJC conversations are resolved from the foreground process directory
when it differs from
the pane directory.
([#333](#333) by @Kinetic27)
- Direct terminal input preserves rapid IME commits when punctuation
arrives before composition
timers run, with a bounded xterm 5.5 backport and Korean final-consonant
regression checks.
Native Android/Gboard checks also fixed stale editor text after
Backspace breaking the next
Hangul word. Secret entry now refuses a held or unready attachment and
failed PTY writes.
  ([#334](#334))
- New session in the browser demo opens the new session instead of
leaving a blank page.
  ([#355](#355))
- Terminal input keeps multi-character IME commits and emoji while
disconnected, waits for the
attachment before sending keys, and reports input failures. Unsent input
lines survive pane,
lens and mode changes; late acknowledgements preserve replacement edits.
Composition keeps
its Enter and Send button, and terminal key-bar taps wait until it
finishes.
  ([#334](#334))
- The background tasks list stays below the app header on a short
screen, such as a phone held
  sideways, and scrolls inside the room above the message box.
  ([#354](#354))
- The mobile message box sits closer to the home indicator while
retaining its base spacing.
([#335](#335) by
@Haeminway1)
- Adding or reconnecting a remote PC says when herdr is not running or
not answering there,
  instead of only `Bridge verification failed (500)`.
  ([#353](#353))
- Shift+Enter in the live terminal sends the same newline chord as
Alt+Enter, instead of plain
Enter that submits an agent's message. Pending IME text is sent before
the newline chord.
([#339](#339) by
@WOULDU-pres)
- On Windows, and from an install path with a space or a non-ASCII
character, the app page loads
instead of the "not built yet" notice. The Windows installer replaces a
copy from a release
  without Windows support, and says so when a release cannot run there.
  ([#356](#356))
- On an iPhone home screen app, a text field that keeps its focus with
the keyboard down no
  longer leaves a status-bar band under the message box.
([#349](#349) by
@Haeminway1)
- After `/new` in an OmO pane, the chat stops showing the conversation
before it: OmO writes the
new session's file only with its first message, and until then the chat
shows what a fresh OmO
shows. ([#351](#351) by
@WOULDU-pres)
- On a Windows PC, an omo pane shows omo's mark instead of Claude's, and
its chat finds the
conversation: process words with `bun.exe`, backslashes and a drive
letter read as omo, and the
  session folder is named as omo's engine names a Windows folder.
([#342](#342) by
@Haeminway1)
- The chat lens finds an omo pane's conversation when its process keeps
its sessions outside
`~/.omo/agent` (`OMO_CODING_AGENT_DIR`, `SENPI_CODING_AGENT_DIR` or
`PI_CODING_AGENT_DIR`).
([#350](#350) by
@Haeminway1) passes. After the merge: .
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.

2 participants