Skip to content

fix(ui): let a phone release its pane as soon as it is hidden - #748

Merged
devswha merged 3 commits into
mainfrom
fix/mobile-release-hidden
Oct 10, 2026
Merged

devswha merged 3 commits into
mainfrom
fix/mobile-release-hidden

Conversation

@devswha

@devswha devswha commented Oct 10, 2026

Copy link
Copy Markdown
Owner

Change

herdr holds a pane at an attached client's size until that attach ends, and its own TUI cannot take the size back. A phone that left the web UI (lock screen, another app, another tab) kept its attach, so the PC's herdr window stayed at the phone's size.

The release-on-leave path (releasePaneAway, "Use alongside herdr's own window") was off by default, and even when it was on it waited a 1 s timer after the page went hidden. A mobile page can freeze before that timer runs.

Now a touch screen (pointer: coarse) releases the pane as soon as the document goes hidden, whatever the setting says, and switches to the existing read-only watch. Coming back to the page attaches again through the existing back() path. The existing guards still apply: a queued message that is still waiting, a mirrored pane, and the embedded demo all keep the pane. Desktop behavior does not change.

Validation

  • bun run typecheck: pass
  • bun run build: pass
  • HERDR_TEST_MODE=unit bun test ./src: 991 pass, 0 fail
  • Not yet exercised on a real phone or with a Playwright touch emulation run.

@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

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: a5ace380-00e4-4c8f-9cab-b9040496efd1

📥 Commits

Reviewing files that changed from the base of the PR and between 596798b and c9e20bb.


📒 Files selected for processing (1)
  • scripts/chat-size-regression.ts

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
    • Phones and tablets now release their pane and switch to watching when the web page becomes hidden, regardless of the pane-release setting. Returning to the page attaches the pane again.

Walkthrough

When a coarse-pointer device hides the page, PaneTerminal now releases the pane even if releasePaneAway is disabled. A regression check verifies that the page watches while hidden and attaches again when restored.

Changes

Hidden-tab pane release

Layer / File(s) Summary
Visibility-triggered pane release
src/components/PaneTerminal.tsx, scripts/chat-size-regression.ts, src/AGENTS.md, CHANGELOG.md
PaneTerminal calls leave() and releases the pane when a coarse-pointer device's document becomes hidden. The regression check verifies detach and watch before timers run, then verifies attach after visibility returns. The documentation and changelog describe the behavior.

Priority: ⬇️ Low

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

Change: Bug fix

Suggested reviewers: wouldu-pres


Merge Risk: ⚪ Minimal · up to c9e20

The regression check covers hidden-phone release with release-on-away disabled, and no concrete merge risk remains evident.

Architecture Summary

Architecture risk: 🔵 Low · up to c9e20

The change affects 3 systems.

Changed systems: scripts, src, CHANGELOG.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 (ui) was modified; 2 changed files map to changed impact.
  • observed — CHANGELOG.md (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in CHANGELOG.md: Added a changelog entry describing that leaving the web UI on a phone or tablet releases the pane immediately and watches it, while returning to the page attaches again.
  • observed — Modified behavior in src/AGENTS.md: The Geometry/fit documentation adds that a touch-screen device hidden from view detaches immediately, regardless of the releasePaneAway setting.
  • observed — Modified behavior in src/components/PaneTerminal.tsx: release now also permits detaching when hiddenOnTouch() is true, even if releasePaneAway is disabled; its other release guards are unchanged.
  • observed — Modified behavior in src/components/PaneTerminal.tsx: Adds hiddenOnTouch(), which detects a hidden document on a coarse-pointer device. onVisibility still calls leave() when the tab is not in use and now also calls release() immediately for that hidden-touch case.

Pre-merge checks | Passed 3 | Failed 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check Warning The description includes the required Change and Validation sections and reports relevant checks. It does not include the required screenshot or recording for this UI change. Add a screenshot or recording from an owned demo or test session that shows a hidden touch page detaching and switching to watch, then attaching again when visibility returns.
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: releasing a phone pane when the page becomes hidden.
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.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR






🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

A touch page with the default settings and a frozen clock detaches and
watches as soon as it is hidden, and attaches again when it is back.
Fails without the fix: no detach before any timer runs.
@devswha
devswha merged commit 1314161 into main Oct 10, 2026
5 checks passed
@devswha
devswha deleted the fix/mobile-release-hidden branch October 10, 2026 18:28
devswha added a commit that referenced this pull request Oct 10, 2026
…er 4008

- A pane mounted while a phone is put away (one closed from the desktop)
  inherits the release and lets go at once, whatever releasePaneAway says,
  so it does not hold herdr's window at the phone's size (#748).
- When the PC's shared connection comes back after a 4008 overload close,
  mounted panes clear their stalled ended/error state: the shared socket
  has replayed their attaches.

Found by Codex review.
devswha added a commit that referenced this pull request Oct 10, 2026
## Change

Release 0.4.6, from main at 2ae281d (24 PRs since v0.4.5: #615,
#693-#748).

- `package.json` and `herdr-plugin.toml`: 0.4.6.
- CHANGELOG: `[Unreleased]` becomes `[0.4.6] - 2026-10-11`. #615's entry
moves out of the 0.4.2 section, where its branch's merge left it. #697
and #695 get their links and credits. A Maintenance section covers #738,
#733 and #696. The compare links are fixed.
- `release-summaries.json`: 0.4.6 in en/ko/ja/zh (5 new, 3 improved, 5
fixed).
- `REMOTE_BUNDLE_VERSION` 24 -> 25. Bridge routes were added since
v0.4.5 (plugin actions, integrations, pane
split/zoom/swap/resize/clear/move/focus, tab move, find, layout ratio,
agent rename), so `remote-v25` is published before the app release.

## Validation

- `bun scripts/release-notes.ts 0.4.6` renders the summaries and the
full changelog.
- `bun run typecheck` and `bun run test:unit` pass: 2459 tests, 0 fail.

---------

Co-authored-by: devswha <[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