t3code icon indicating copy to clipboard operation
t3code copied to clipboard

[Bug]: Android keyboard closes straight after tapping a text field in the thread feed

Open semyonfox opened this issue 3 weeks ago • 5 comments

Before submitting

  • [x] I searched existing issues and did not find a duplicate.
  • [x] I included enough detail to reproduce or investigate the problem.

Area

apps/mobile

Steps to reproduce

  1. On Android, open a thread where the agent has called request_secret, so the secret card shows in the feed.
  2. Leave the composer unfocused.
  3. Tap the secret field.

Expected behavior

The keyboard opens and stays open while the field has focus.

Actual behavior

The keyboard opens and closes straight away. The field keeps focus and shows a caret, but there's no keyboard to type with. On a Xiaomi phone the keyboard visibly opens and drops. On an API 36 emulator the hide lands before the keyboard draws, so it never appears at all.

Cause

Tapping the secret field also counts as a short tap on the thread feed. handleFeedTouchEnd in ThreadDetailScreen.tsx calls collapseComposer(), which calls the composer's blur(). On Android, T3ComposerEditorView.blurEditor() then calls hideSoftInputFromWindow with the window token. It does this without checking whether the composer has focus, so it hides the keyboard the secret field just opened. On iOS, resignFirstResponder only touches the composer, so iOS isn't affected.

The same should happen to any text input rendered inside the feed on Android, not just the secret field.

Impact

Major degradation or frequent failure

Version or commit

main @ 4c924ff4e6

Environment

Android dev client. Reproduced on a Xiaomi phone and on an Android 16 (API 36) x86_64 emulator.

Logs or stack traces

ImeTracker: onRequestShow  ORIGIN_CLIENT SHOW_SOFT_INPUT  fromUser true    # secret field tapped
ImeTracker: onRequestHide  ORIGIN_CLIENT HIDE_SOFT_INPUT  fromUser false   # about 18 ms later
ImeTracker: onFailed PHASE_IME_ON_SHOW_SOFT_INPUT_TRUE

Stack at the hide, from a breakpoint on hideSoftInputFromWindow:

[1] android.view.inputmethod.InputMethodManager.hideSoftInputFromWindow (InputMethodManager.java:2,605)
[2] expo.modules.t3composereditor.T3ComposerEditorView.blurEditor (T3ComposerEditorView.kt:379)
[3] expo.modules.t3composereditor.T3ComposerEditorModule ... AsyncFunction "blur" (T3ComposerEditorModule.kt:154)

dumpsys input_method afterwards shows mServedView is the secret input and mInputShown=false.

Workaround

None in the app.


I'm working on a fix. The plan is to make blurEditor() do nothing when the composer doesn't have focus, so blurring an unfocused composer never touches the keyboard.

semyonfox avatar Nov 10 '26 16:11 semyonfox

Also hitting this on a Pixel 11 Pro Fold (Android 17), but only with the screen unfolded. Folded (outer screen), the keyboard comes up on the request_secret card normally. Unfolded, tapping the field focuses it but the keyboard never comes up, so I can't enter secrets on the big screen. The rest of the app's keyboard input works fine either way. Looking forward to #34001 landing, thanks for the quick fix!

ethanjnrg avatar Nov 11 '26 04:11 ethanjnrg

Additional report from a Samsung Galaxy S26 Ultra running T3 Code Android 2.3.0 with Samsung One UI 9, reported on November 11, 2026:

The Share Secret dialog does not bring up Android's on-screen keyboard when trying to enter a secret. Expected behavior is for the secret input to open the keyboard so the value can be entered.

This matches the visible symptom in this issue. The reporter has not confirmed whether the keyboard briefly appears and hides, or never becomes visible; no caret/focus behavior or root cause was independently established for this device.

  • T3 Code Android app version: 2.3.0, confirmed by the reporter; build number not provided.
  • One UI version: 9, confirmed by the reporter.
  • Android OS: 17, confirmed by the reporter.
  • Keyboard app: not confirmed.
  • No logs or recording were supplied, and this device has not been tested with the proposed fix in #34001.

Posted by Codex from the user's report; not an independent device reproduction.

tim-of-course avatar Nov 11 '26 16:11 tim-of-course

Reproduced on a real phone with the store release build, so the bug is present on base. Posting this because the #34001 pipeline stopped with "could not show the bug on the base commit" (its install step failed before it got that far).

Device

  • Samsung Galaxy S24 Ultra (SM-S928B), Android 17 (SDK 37), One UI 9, build CP2A.260605.016.S928BXXS6EZJ1
  • T3 Code Android 2.3.0 (versionCode 784), release build from the store, not a dev client
  • Keyboard: Gboard 18.6.3
  • Screen in portrait, 1080x2340, normal (non-foldable) phone

Steps

  1. An agent in the thread calls request_secret. The card with the "Paste the secret" field appears in the feed.
  2. Composer is unfocused and the keyboard is hidden.
  3. Tap the secret field.

Result: 3 of 3 taps failed, and a composer tap worked as a control

Case Field gets caret Keyboard
Tap 1 on the secret field, keyboard hidden yes never drawn
Tap 2 on the secret field, keyboard hidden yes never drawn
Composer focused with keyboard open, then tap the secret field yes (focus moves) closes
Control: tap the composer yes opens normally

So there is no workaround: focusing the composer first and then tapping the field also closes the keyboard.

tap secret field: caret but no keyboard; composer tap opens it

MP4 of the same clip (cropped to the card and composer)

Composer focused first, then a tap on the field:

composer focused then tap secret field: keyboard closes

Logcat: the app hides the keyboard 4 ms after asking to show it

21238 is the com.t3tools.t3code process. hsifw() is Samsung's log line for hideSoftInputFromWindow.

Tap 1:

09:09:14.710 21238 I ImeTracker: com.t3tools.t3code:49b611f4: onRequestShow at ORIGIN_CLIENT reason SHOW_SOFT_INPUT fromUser true
09:09:14.712  3151 V InputMethodManagerService: Client requesting input be shown
09:09:14.713  6622 I GoogleInputMethodService: onStartInput(... inputType=280081, inputTypeString=Password[NoSuggestion] ...)
09:09:14.714 21238 I ImeTracker: com.t3tools.t3code:1193eec9: onRequestHide at ORIGIN_CLIENT reason HIDE_SOFT_INPUT fromUser false
09:09:14.714 21238 I InputMethodManager_LC: hsifw() - flag : 0
09:09:14.714 21238 I InputMethodManager_LC: hsifw() - mService.hideSoftInput
09:09:14.720  3151 V InputMethodManagerService: Client requesting input be hidden
09:09:14.756  6622 I InputMethod: hideSoftInput(): flags=0
09:09:14.756  3151 I ImeTracker: com.t3tools.t3code:49b611f4: onFailed at PHASE_SERVER_ABORT_SHOW_IME_POST_LAYOUT

Tap 2 has the same pattern, with the hide 6 ms after the show:

09:09:20.685 21238 I ImeTracker: com.t3tools.t3code:f3baa029: onRequestShow at ORIGIN_CLIENT reason SHOW_SOFT_INPUT fromUser true
09:09:20.691 21238 I ImeTracker: com.t3tools.t3code:2e703c71: onRequestHide at ORIGIN_CLIENT reason HIDE_SOFT_INPUT fromUser false
09:09:20.691 21238 I InputMethodManager_LC: hsifw() - mService.hideSoftInput
09:09:20.702  3151 I ImeTracker: com.t3tools.t3code:f3baa029: onFailed at PHASE_SERVER_ABORT_SHOW_IME_POST_LAYOUT

Composer focused, then a tap on the field. The hide comes 10 ms after the show:

09:11:02.730 21238 I ImeTracker: com.t3tools.t3code:e6b0a8c4: onRequestShow at ORIGIN_CLIENT reason SHOW_SOFT_INPUT fromUser true
09:11:02.740 21238 I ImeTracker: com.t3tools.t3code:f68840ce: onRequestHide at ORIGIN_CLIENT reason HIDE_SOFT_INPUT fromUser false
09:11:02.740 21238 I InputMethodManager_LC: hsifw() - mService.hideSoftInput
09:11:03.061  6622 I InputMethod: hideSoftInput(): flags=0

dumpsys input_method 2 s after the tap

mServedView=scd{33d3c1c VFED..CL. .F...... 0,0-832,68}   <- the secret field holds focus
mInputShown=false
mImeWindowVis=0

After the composer control tap, it shows mServedView= the composer, mInputShown=true and mImeWindowVis=3.

This matches the cause described in the issue: the feed tap collapses the composer, which calls blurEditor(), which calls hideSoftInputFromWindow. In both failing cases the focused view is the secret field, a text editor other than the composer, so the early return in #34001 should cover both. I couldn't capture a Java stack because the release build isn't debuggable. I'm happy to test a build of #34001 on this phone if you share an APK.

Captured over adb on my own phone with Claude Code. The test secret card was raised in a throwaway thread.

mrdivax avatar Nov 12 '26 05:11 mrdivax

[Haiku 5.5][Claude Code] on behalf of shivam.

Julius already has this covered in #34001, which is open, closes this issue, and fixes the same cause: the Android blurEditor() hiding the keyboard a feed field just opened. We have no competing PR, so nothing new is being pushed from our side.

shivamhwp avatar Nov 12 '26 13:11 shivamhwp

Additional reproduction reported on November 12, 2026 from a Samsung Galaxy S23 (SM-S911B), Android 17, using the T3 Code Android app.

An agent requested a credential via request_secret, displaying the secure entry card with the “Paste the secret” field and “Save securely” action. Tapping the secret input does not bring up a usable Android on-screen keyboard, so the user cannot enter the credential. The issue occurs while the agent is waiting for the secret in the conversation feed.

Expected: tapping the secret field focuses it and keeps the keyboard open until entry is complete.

Actual: the field cannot be typed into because the keyboard is not visible. Whether the IME briefly opens and closes was not independently confirmed.

The reporter provided a screenshot of the card showing the affected state. T3 Code app version and keyboard app were not confirmed.

This appears to be the same behavior described in this issue, rather than a separate bug.

felipeassump22 avatar Nov 12 '26 21:11 felipeassump22