Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Mobile composer loses focus after selecting skill via $ / / — requires re-tapping textbox #10956

Closedscreen-gd(GitHub profile, opens in a new tab) opened this issue 3 comments

[Bug]: Mobile composer loses focus after selecting skill via $ / / — requires re-tapping textbox

Description

On T3 Code Mobile (native Android app, not t3.chat web), after invoking the skill picker with $ or / and selecting a skill, the composer textbox loses focus. The user must tap the textbox again to continue typing.

Reporter device:

  • App: T3 Code Mobile (Android) — apps/mobile (ThreadComposer / ComposerCommandPopover)
  • Model: Xiaomi Redmi 12 5G (sky / 23076RN8DY) — Snapdragon 4 Gen 2 variant (also sold as Redmi Note 12R / POCO M6 Pro 5G)
  • SoC: Qualcomm SM4450 Snapdragon 4 Gen 2 — 4 nm, Octa-core (2×2.2 GHz Cortex-A78 + 6×1.95 GHz Cortex-A55), Adreno 613
  • OS: Sakura OS custom ROM (AOSP/Lineage-based, Android 13 base — device shipped Android 13 / MIUI 14)

This issue was filed by an LLM — Muse Spark (opencode/muse-spark-1.2-contributor-free) — on behalf of the reporter. Device chipset details sourced from public specs (GSMArena, Xiaomi, Sakura-Devices device_xiaomi_sky).

Steps to Reproduce

  1. Open T3 Code Mobile on Android — e.g., Redmi 12 5G + Sakura OS.
  2. Start a new thread / open any thread composer.
  3. Type $ or / to open the skill picker.
  4. Select any skill from the list (tap).
  5. Observe composer textbox state — it is deselected/blurred.

Expected Behavior

After selecting a skill, the skill token is inserted and the composer retains focus with the keyboard still open and cursor after the token, so typing can continue immediately.

Actual Behavior

After selection, the textbox is deselected/blurred — keyboard dismisses or input is unfocused. User must tap the textbox again before typing.

Additional Finding

  • Also reproduces when using / for skills (same focus loss as $).
  • Workaround that works: Delete the inserted text entirely and then re-add the skill using any command trigger ($ or /) — on the second insertion, focus is retained correctly and typing can continue without re-tapping. This suggests the first insertion blurs the editor, but a clean re-insertion restores the expected focus path.

Environment

  • App: T3 Code Mobile (Android, apps/mobile)
  • Device: Redmi 12 5G (sky) — Snapdragon 4 Gen 2 (SM4450)
  • OS: Sakura OS custom ROM (Android 13 base)
  • Reproducible: Yes, consistent on reporter device — not t3.chat web, strictly T3 Code Mobile

Suggested Fix

After skill insertion via $//, re-focus the editor and preserve selection (e.g., editor.focus() / composerRef.current?.focus()), preventing default blur on the menu item's tap or calling requestAnimationFrame(() => editor.focus()) to keep the keyboard open on Android.

Reporter Notes

Original report: "After I select a skill using the $ sign the text box is deselect like I have to click on the box again to type anything" — Redmi 12 5G, Sakura OS, Snapdragon 4 Gen 2. Updated: also happens with / for skills; deleting text and re-adding the skill works fine. Clarified: T3 Code Mobile, not t3.chat.

  1. Triage

    Confirmed as a real mobile composer focus bug. After picking a skill from the $ menu, the token is inserted but the editor loses focus, so the keyboard drops and you have to tap the textbox again. Same insert path is used for / skill rows (#7737) and @ file picks, so those taps are likely affected too.

    This is not a duplicate of #7498 (picker missing on new-task), #5792 (browser-automation focus steal), #7440 (iOS keyboard position), or #10153 (screen-reader suggestions). No open PR fixes this.

    What’s going on

    Web (t3.chat / Android Chrome — reported surface)

    • Suggestion rows in apps/web/src/components/chat/ComposerCommandMenu.tsx only preventDefault on mousedown.
    • Other composer chrome already uses onPointerDown preventDefault so a tap doesn’t steal the editor (ComposerPrimaryActions, expand/send, stash).
    • The menu is portaled to document.body. On a mobile viewport, losing editor focus collapses the composer (scheduleComposerCollapseCheck / isComposerCollapsedMobile).
    • Skill insert already does a rAF focusAt(). On Android Chrome that often does not bring the IME back once a touch has blurred the field. The reliable fix in this codebase is to stop the blur on pointerdown, not only re-focus afterward.

    Native (apps/mobile — same class of gap)

    • ComposerCommandPopover is a Pressable list with keyboardShouldPersistTaps="always".
    • useComposerCommandMenu onSelect writes the $name token and cursor but never calls editor.focus().
    • ThreadComposer / NewTaskDraftScreen treat editor blur as “collapse the card”. T3ComposerEditor already exposes focus().

    Suggested fix

    1. Web: add onPointerDown={(e) => e.preventDefault()} on ComposerCommandMenuItem (keep the existing mousedown guard and rAF focusAt).
    2. Native: after a picker select, focus() the composer so blur doesn’t collapse it.
    3. Check $, / skill rows, and @ on Android Chrome (and native if that path is touched).

    Severity: medium (extra tap + keyboard bounce on a core mobile prompt flow).

    Accepting this. A small, localized focus-preservation change on the shared picker select path.

  2. juliusmarminge added labelsbug

  3. juliusmarminge added labelsaccepted

  4. juliusmarminge added labelsvia-triage

  5. screen-gd(GitHub profile, opens in a new tab) changed the title

  6. Note

    🤖 Claude Opus 5.5 responding on behalf of karanmrn

    This no longer reproduces on main at 6417151c09 (2026-11-08).

    Setups tested:

    • Web app in Android Chrome, Pixel 7 emulator, Android 16, Gboard.
    • Native dev client (T3 Code Dev 2.2.0), Pixel 7 emulator, Android 16, Gboard.
    • Native dev client, Pixel 7 emulator, Android 13 AOSP image, AOSP keyboard (LatinIME). This is the closest emulator match to the reported Lineage-based Android 13 ROM.

    Cases covered on each setup, in an existing thread and in a new draft:

    • Tap a $ skill row, then keep typing.
    • Tap a / skill row, then keep typing.
    • Tap an @ file row, then keep typing.
    • On native, also pick after scrolling the skill list, and pick from the full $ list with no query.

    In every case, the token is inserted, the editor keeps focus, the keyboard stays open, and the next keys land after the token. On Android 13, the follow-up text was typed on the on-screen keyboard, so it went through the keyboard's input connection.

    How focus was checked:

    • Web: a focusin/focusout listener through Chrome remote DevTools. Menu rows already prevent the default pointerdown action, and no focusout fires on a pick.
    • Native: a temporary log in the composer's focus and blur handlers. It logged no blur during any pick. dumpsys input_method showed the keyboard shown and the composer as the served view after each pick.

    The likely fix is https://github.com/pingdotgg/t3code/pull/15856 (merged 2026-10-07). It moved the Android composer picker out of a wrapper outside the composer's bounds and into its own layer. This was not bisected, so the exact fixing change is not confirmed.

    Screen recordings and screenshots for each setup are available.

  7. [Fable 5.2][Claude Code] on behalf of shivam.

    Closing this as not planned for now. It no longer reproduces on main. The retest on 2026-11-08 at 6417151c09 covered $, / and @ picks on three Android setups, including an Android 13 AOSP image close to the one reported, and none of them showed the focus loss.

    If it still happens on a current build, please reply here with the app version, device and keyboard and we'll reopen it.

Sign in to join this conversation.