Skip to content

MUL-7926 SOUR-107: Focus the composer after selecting a starter - #9132

Open
Souredfish wants to merge 1 commit into
multica-ai:mainfrom
Souredfish:agent/souredfish/SOUR-107-chat-starter
Open

Souredfish wants to merge 1 commit into
multica-ai:mainfrom
Souredfish:agent/souredfish/SOUR-107-chat-starter

Conversation

@Souredfish

Copy link
Copy Markdown

Summary

  • Selecting a conversation starter now expands the composer, waits for native input layout, then focuses it so Android opens the soft keyboard for immediate typing.
  • Align mobile @types/react with the workspace catalog. The lockfile already resolves it to 19.2.14, so PNPM produced no lockfile diff on the clean branch.

Verification

  • Android 16 physical-device QA (OPPO PKT110): starter tap populated the draft, focused the composer, and opened the soft keyboard (mInputShown=true).
  • Mobile lint passed.
  • Mobile test suite passed: 234 tests.
  • Mobile typecheck passed with 0 diagnostics.
  • git diff --check passed.

No production release or merge was performed.

Co-authored-by: multica-agent <github@multica.ai>
@vercel

vercel Bot commented Oct 8, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the IndexLabs Team on Vercel.

A member of the Team first needs to authorize it.

@multica-eve multica-eve changed the title SOUR-107: Focus the composer after selecting a starter MUL-7926 SOUR-107: Focus the composer after selecting a starter Oct 8, 2026

@multica-eve multica-eve left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Selecting a conversation starter should populate and focus the composer so the user can continue typing immediately. Reusing the existing expansion trigger makes sense, but the shared focus path misses requests when the input is already laid out; please address the inline P2 before merging.

Mobile CI passes. This finding is based on the code and React Native's layout-event contract; I have not independently reproduced the native keyboard behavior on a device.

Comment on lines 228 to 230
triggerSeen.current = expandTrigger;
focusAfterInputLayout.current = true;
setExpanded(true);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P2] Handle focus requests when the input is already laid out

Select a starter, dismiss the keyboard, then select the same starter again. The nonempty draft keeps the composer expanded, and neither the text nor the input's layout changes. This effect only sets the pending-focus flag and calls setExpanded(true); the actual focus() now runs exclusively from onLayout. React Native invokes onLayout on mount or layout changes, so there is no new event to consume this request and the user still has to tap the input. The shared comment composer also loses its previous automatic refocus when switching reply targets without changing the input's layout.

Please wait for layout only while the input is newly mounting/not yet laid out, and schedule focus directly when it is already ready. Verify both repeated starter selection after dismissing the keyboard and switching reply targets in an expanded composer. Event contract: https://reactnative.dev/docs/0.83/view#onlayout

This branch has not been deployed

No deployments
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.

2 participants