Skip to content

fix(mobile): leave a touch long press on a pane to the phone - #838

Merged
devswha merged 4 commits into
mainfrom
fix/phone-long-press-selects-text
Oct 11, 2026
Merged

devswha merged 4 commits into
mainfrom
fix/phone-long-press-selects-text

Conversation

@devswha

@devswha devswha commented Oct 11, 2026

Copy link
Copy Markdown
Owner

Problem

On a phone, a long press on the chat opened "Pane actions for …" instead of the phone's own text selection and copy. A touch long press fires contextmenu, and PaneCanvas's capture handler took every contextmenu for the pane menu.

Change

  • PaneCanvas ignores a contextmenu whose pointerType is touch or pen (or, where the event carries none, one that followed a touch/pen pointerdown on the frame), and does not prevent its default. Mouse right-click and macOS Control-click are unchanged.
  • Pane actions stay reachable on touch from the pane's ⋯ (and from the tab menu once fix(mobile): move a lone pane's actions into the tab menu on touch screens #835 lands).

Tests

  • New scripts/touch-long-press-demo-regression.ts (demo app, phone viewport): a touch contextmenu is not prevented and opens no pane menu; a mouse right-click still opens it. It fails without the fix. Added to ci-browser.sh (lane count 36 → 37 in ci-browser.test.ts).
  • bun run check fast, tab-menu-regression, key-bar-hold-repeat-regression, terminal-arrows-clicks-regression pass.

🤖 Generated with Claude Code

A long press on a touch screen fires contextmenu, which the pane frame
took for its own menu, so text in the chat could not be selected or
copied. A touch or pen contextmenu now keeps its default; a right-click
still opens the pane menu.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 7 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: devswha/herdr-web-ui/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 62779b9f-f859-497f-b0a5-89e578724842

📥 Commits

Reviewing files that changed from the base of the PR and between f704740 and 2f2a6e8.


📒 Files selected for processing (5)
  • CHANGELOG.md
  • scripts/ci-browser.sh
  • scripts/ci-browser.test.ts
  • scripts/touch-long-press-demo-regression.ts
  • src/components/PaneCanvas.tsx

✨ Finishing Touches
📝 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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

devswha and others added 3 commits October 12, 2026 06:39
…pens

Review finding (Codex, pre-merge): on a browser whose contextmenu carries
no pointer type, the last touch on the frame made Shift+F10 or the Menu
key open nothing, since no pointerdown cleared the touch mark. A keydown on
the frame clears it. The regression covers a contextmenu without pointer
type right after a touch (the phone's) and one after a key (the app's).

The changelog says what the terminal lens gets: no menu, not the phone's
text selection, which xterm's canvas does not offer.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@devswha
devswha force-pushed the fix/phone-long-press-selects-text branch from cba4e5a to 2f2a6e8 Compare October 11, 2026 21:45
@devswha
devswha merged commit 268be9f into main Oct 11, 2026
9 checks passed
@devswha
devswha deleted the fix/phone-long-press-selects-text branch October 11, 2026 21:52
devswha added a commit that referenced this pull request Oct 11, 2026
ci-browser.sh lists both new demo scripts; the lane count is 38.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
devswha added a commit that referenced this pull request Oct 12, 2026
## Change

Release 0.4.8, from main at ca6db6e (20 PRs since v0.4.7: the 0.4.7
mobile walk-through fixes, two contributor PRs and the revived #793).

- `package.json` and `herdr-plugin.toml`: 0.4.8.
- CHANGELOG: `[Unreleased]` becomes `[0.4.8] - 2026-10-12`, with the
compare links. Twelve entries that had no PR link get theirs (#835 #837
#838 #840 #842 #843 #844+#848 #845 #847 #849 #851 #852). A Maintenance
line says the remote-PC runtime is now version 27.
- `release-summaries.json`: 0.4.8 in en/ko/ja/zh/tr (3 new, 6 improved,
8 fixed). The Turkish lines are not checked by a native speaker.
- `REMOTE_BUNDLE_VERSION` 26 -> 27: #836 adds the `pending-hold` server
feature and #787 serves precompressed assets, so `remote-v27` is
published before the app release.

Every PR merged since v0.4.7 is linked in the section: #787 #788 #793
#835 #836 #837 #838 #839 #840 #841 #842 #843 #844 #845 #846 #847 #848
#849 #851 #852.

## Validation

- `bun scripts/release-notes.ts 0.4.8` renders the summaries and the
full changelog (116 lines).
- `bun run check fast`: generated types, typecheck, build and 2800+ unit
tests pass.

## Release

After this merges and its CI on `main` passes: push `remote-v27`, wait
for its release, then run the Release workflow with `0.4.8`.

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

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
devswha added a commit that referenced this pull request Oct 13, 2026
## Change

CHANGELOG.md's `## [Unreleased]` lists are the repo's most frequent
merge conflict: every PR appends to the same Added/Changed/Fixed lists,
and a conflict resolver once pushed the markers (#838). A PR now adds
one small file to `changelog.d/` instead, so two PRs never touch the
same lines.

- **Format** (`changelog.d/README.md`): a lowercase `name.md` holding
exactly the lines it would have in CHANGELOG.md: `###
Added|Changed|Removed|Fixed|Maintenance` headings, `- ` entries,
two-space continuations. No PR link or credit needed.
- **Fold** (`scripts/changelog-fold.ts`): the release PR runs `bun
scripts/changelog-fold.ts X.Y.Z [YYYY-MM-DD]` (the date defaults to the
local one). It turns the Unreleased notes into `## [X.Y.Z] - date` under
an empty `## [Unreleased]` (the shape of #853), with the existing
Unreleased entries first, then the fragments sorted by file name,
sections in release order (any other heading the old notes used is kept
after them). It links each fragment's entries to the PR whose squash
merge added the file (from `git log --follow --diff-filter=A`, so a
later rename does not take the link) unless the entry already links that
PR, moves the compare links on, deletes the fragments, and prints what
still needs a link plus the reminder to add `by @login` credits. It
refuses rather than drops a line it cannot place.
- **Release gate**: `scripts/release-notes.ts`, which release.yml runs
before tagging, refuses while `changelog.d/` still holds a fragment (one
merged after the release PR folded them would otherwise ship without a
line in the notes), and says to move its entries into the version by
hand.
- **Transition**: the ~30 open PRs that still append to Unreleased need
no rework; their lines are folded together with the fragments.
CHANGELOG.md content is unchanged in this PR.
`scripts/release-notes.ts`, `server/release-notes.ts` and
`scripts/update-browser-qa.ts` read the same shape as before.
- **Guards** (`scripts/changelog-fold.test.ts`, unit suite): every
fragment parses (known section, at least one non-empty entry, no stray
text, lowercase `.md` name); CHANGELOG.md and the fragments hold no
conflict markers; today's Unreleased notes plus fragments fold for the
next release, so an old PR's malformed entry fails at its own PR rather
than at release. Failure messages name the file and line and point at
`changelog.d/README.md`. Not enforced yet: that a PR leaves CHANGELOG.md
alone. A ratchet or a `changes`-job check would fail the ~30 open PRs
that still append there (or turn main red when one of them merges on a
stale green run), so it is a planned follow-up once they have drained;
AGENTS.md says so.
- **Docs**: CONTRIBUTING.md (changelog bullet), AGENTS.md maintainer
workflow (one line, pointing at the test), docs/development.md Releasing
step 1, the PR template comment.

No CHANGELOG entry or fragment: not user-visible.

## Validation

- `bun run check fast`: workflow syntax, generated types, typecheck (the
fold script added to `tsconfig.tools.json`), build, unit (3032 pass, 0
fail, 8 skip).
- `bun test scripts/changelog-fold.test.ts
scripts/release-notes.test.ts`: 18 pass, including one where
`releaseNotes()` reads a folded changelog.
- `git log --follow --diff-filter=A` checked on a throwaway branch:
after `x (#1000)` adds a fragment and `chore: rename (#1001)` renames
it, it reports #1000 (without `--follow`, #1001).
- Dry run on this branch with a probe fragment: `bun
scripts/changelog-fold.ts 0.4.9 2026-10-13` changed CHANGELOG.md by only
the new heading, the probe line at the end of Fixed and the two compare
links (+5/-1), and deleted the fragment. Reverted afterwards.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
devswha added a commit that referenced this pull request Oct 15, 2026
…id (#1159)

## Change

On Android Chrome, a long press followed by dragging the selection
opened the pane's menu (Rename pane, Split right…) over the phone's Copy
toolbar. A long press alone was fine.

Chrome sends two `contextmenu` events for that gesture: one typed
`touch` when the long press starts, and a second typed `mouse`, with no
`pointerdown` of its own, when the dragged selection ends. #838 trusted
the pointer type whenever there was one, so the second one counted as a
right-click. The last press now decides: after a touch, a `contextmenu`
is the app's only once a mouse press or a key has come since
(`PaneCanvas`'s `touchPress`, which a mouse `pointerdown` and any
`keydown` already reset).

## Validation

- Reproduced on the owned API 36 Pixel 7 emulator (Chrome 133) with
native touches (`adb input touchscreen motionevent`: hold 900 ms, drag,
lift) over a chat message in the demo app. Before: the events were
`contextmenu` (touch), `pointercancel`, then `contextmenu` (mouse,
target `.pane-frame`), and "Pane actions" opened. After: same events,
the selection stays and only Chrome's toolbar shows.
- `scripts/touch-long-press-demo-regression.ts` gains a `drag-select`
case (a touch press, then a `contextmenu` typed `mouse`). It fails on
`main` and passes here; the keyboard and right-click cases still open
the menu.
- `bun run check fast` passes.

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

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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