Skip to content

fix(android): send chat with hardware Enter#101321

Merged
steipete merged 1 commit into
mainfrom
codex/android-hardware-enter-send
Jul 7, 2026
Merged

fix(android): send chat with hardware Enter#101321
steipete merged 1 commit into
mainfrom
codex/android-hardware-enter-send

Conversation

@steipete

@steipete steipete commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Closes #101239

What Problem This Solves

Fixes an issue where Android users typing with a physical keyboard would insert a newline instead of sending when pressing Enter in chat.

Why This Change Was Made

The chat composer now intercepts an unmodified physical Enter key before BasicTextField applies its newline behavior and uses the same enablement and send action as the visible Send button. Shift+Enter and other modified Enter combinations remain text input; repeats and key-up events do not send.

User Impact

Physical-keyboard users can press Enter to send messages. Modified Enter combinations continue to support multiline composition.

Evidence

  • Blacksmith Testbox tbx_01kwx6hpzsqm3t2jswgr0a6wgw
  • pnpm native:i18n:check
  • focused Robolectric ChatHardwareKeyTest: Enter, numpad Enter, repeat, disabled-send, modifier, and key-up cases
  • :app:assemblePlayDebug
  • :app:lintPlayDebug
  • Isolated-package launch attempted on a Pixel 10a / Android 16 device; interaction proof was blocked by the device fingerprint lock. The isolated package was removed and the existing OpenClaw app was not replaced.

@openclaw-barnacle openclaw-barnacle Bot added app: android App: android size: S maintainer Maintainer-authored PR labels Jul 7, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7c6ca85e49

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

): Boolean {
val enterKey = event.key == Key.Enter || event.key == Key.NumPadEnter
val modified = event.isShiftPressed || event.isCtrlPressed || event.isAltPressed || event.isMetaPressed
if (event.type != KeyEventType.KeyDown || event.nativeKeyEvent.repeatCount != 0 || !enterKey || modified) return false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Consume repeated Enter keydowns after the first send

When a physical Enter key is held down, the first KeyDown sends and clears the draft, but subsequent auto-repeat KeyDowns hit this early return and are passed through to BasicTextField, which this helper is specifically trying to intercept before newline insertion. That leaves blank newline(s) in the composer after a long-press Enter send instead of making repeats a no-op; repeated unmodified Enter events should be consumed without calling onSend.

Useful? React with 👍 / 👎.

@steipete

steipete commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready review complete.

What changed:

  • physical unmodified Enter and numpad Enter now use the same send-enabled predicate and action as the Android chat Send button
  • modified Enter combinations remain text input; repeats and key-up do not send
  • focused Robolectric coverage added for every decision branch

Proof:

Known proof gap: an isolated APK was installed and launched on an attached Pixel 10a / API 36, but the device required fingerprint unlock before interaction. The isolated package was removed and the existing OpenClaw app was not replaced.

@steipete
steipete merged commit 780ca1d into main Jul 7, 2026
104 of 108 checks passed
@steipete
steipete deleted the codex/android-hardware-enter-send branch July 7, 2026 03:36
@steipete

steipete commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Jul 7, 2026
…eyTest

Import-order/blank-line drift landed via the hardware-Enter changes
(#101321 and follow-up) while this PR was open — the exact recurrence
the new android-ktlint lane prevents. Generated with ktlintFormat;
native i18n inventory resynced for the shifted line numbers.
steipete added a commit that referenced this pull request Jul 7, 2026
* style(android): fix ktlint drift in ShellScreen.kt

Formatting drift landed via #101161; :app:ktlintCheck fails on main
without this. Generated with ./gradlew :app:ktlintFormat.

* ci(android): add ktlint lane to the Android CI job

Android formatting drift kept landing on main because CI never ran
ktlintCheck (see the #100304 manual sweep). Adds an android-ktlint
matrix lane mirroring pnpm android:lint.

* chore(i18n): sync native inventory after ShellScreen.kt format

The ktlint format fix shifted line numbers tracked in
apps/.i18n/native-source.json; regenerated via pnpm native:i18n:sync.

* style(android): fix new ktlint drift in NodeRuntime and ChatHardwareKeyTest

Import-order/blank-line drift landed via the hardware-Enter changes
(#101321 and follow-up) while this PR was open — the exact recurrence
the new android-ktlint lane prevents. Generated with ktlintFormat;
native i18n inventory resynced for the shifted line numbers.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 7, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 7, 2026
* style(android): fix ktlint drift in ShellScreen.kt

Formatting drift landed via openclaw#101161; :app:ktlintCheck fails on main
without this. Generated with ./gradlew :app:ktlintFormat.

* ci(android): add ktlint lane to the Android CI job

Android formatting drift kept landing on main because CI never ran
ktlintCheck (see the openclaw#100304 manual sweep). Adds an android-ktlint
matrix lane mirroring pnpm android:lint.

* chore(i18n): sync native inventory after ShellScreen.kt format

The ktlint format fix shifted line numbers tracked in
apps/.i18n/native-source.json; regenerated via pnpm native:i18n:sync.

* style(android): fix new ktlint drift in NodeRuntime and ChatHardwareKeyTest

Import-order/blank-line drift landed via the hardware-Enter changes
(openclaw#101321 and follow-up) while this PR was open — the exact recurrence
the new android-ktlint lane prevents. Generated with ktlintFormat;
native i18n inventory resynced for the shifted line numbers.
sheyanmin pushed a commit to sheyanmin/openclaw that referenced this pull request Jul 8, 2026
sheyanmin pushed a commit to sheyanmin/openclaw that referenced this pull request Jul 8, 2026
* style(android): fix ktlint drift in ShellScreen.kt

Formatting drift landed via openclaw#101161; :app:ktlintCheck fails on main
without this. Generated with ./gradlew :app:ktlintFormat.

* ci(android): add ktlint lane to the Android CI job

Android formatting drift kept landing on main because CI never ran
ktlintCheck (see the openclaw#100304 manual sweep). Adds an android-ktlint
matrix lane mirroring pnpm android:lint.

* chore(i18n): sync native inventory after ShellScreen.kt format

The ktlint format fix shifted line numbers tracked in
apps/.i18n/native-source.json; regenerated via pnpm native:i18n:sync.

* style(android): fix new ktlint drift in NodeRuntime and ChatHardwareKeyTest

Import-order/blank-line drift landed via the hardware-Enter changes
(openclaw#101321 and follow-up) while this PR was open — the exact recurrence
the new android-ktlint lane prevents. Generated with ktlintFormat;
native i18n inventory resynced for the shifted line numbers.
giodl73-repo pushed a commit to giodl73-repo/openclaw that referenced this pull request Jul 8, 2026
giodl73-repo pushed a commit to giodl73-repo/openclaw that referenced this pull request Jul 8, 2026
* style(android): fix ktlint drift in ShellScreen.kt

Formatting drift landed via openclaw#101161; :app:ktlintCheck fails on main
without this. Generated with ./gradlew :app:ktlintFormat.

* ci(android): add ktlint lane to the Android CI job

Android formatting drift kept landing on main because CI never ran
ktlintCheck (see the openclaw#100304 manual sweep). Adds an android-ktlint
matrix lane mirroring pnpm android:lint.

* chore(i18n): sync native inventory after ShellScreen.kt format

The ktlint format fix shifted line numbers tracked in
apps/.i18n/native-source.json; regenerated via pnpm native:i18n:sync.

* style(android): fix new ktlint drift in NodeRuntime and ChatHardwareKeyTest

Import-order/blank-line drift landed via the hardware-Enter changes
(openclaw#101321 and follow-up) while this PR was open — the exact recurrence
the new android-ktlint lane prevents. Generated with ktlintFormat;
native i18n inventory resynced for the shifted line numbers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: android App: android maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android: Enter key should send message when physical keyboard is connected

1 participant