Skip to content

feat(ChatLayout): dragging the conversation to the composer dismisses the keyboard - #8217

Draft
vjeux wants to merge 180 commits into
meta:mainfrom
vjeux:uikit/c08-keyboard-dismiss
Draft

vjeux wants to merge 180 commits into
meta:mainfrom
vjeux:uikit/c08-keyboard-dismiss

Conversation

@vjeux

@vjeux vjeux commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Stack: #9777 → #8080 → #11859 → #8217 ← #9983.
Merge group: #9983, #8217

Review only this PR's change: vjeux/astryx@86c74e8...1fd9e0e, vjeux/astryx@6fd4c28...680bf29, vjeux/astryx@cc668a0...8a7df57 and vjeux/astryx@1fbb4e4...909aa6e. Merges of #9983 and main sit between.

User need

In iOS Messages, dragging the conversation to the field, or swiping down on the input bar, puts the keyboard away. ChatLayout kept it up.

Problem and solution fit

A watcher pan on the root lets the transcript scroll. With a software keyboard up, the field blurs when a touch or pen drag reaches the composer's top. Under a coarse primary pointer, focus rests on the composer region, as after Done. The dock bounces once on springs.keyboard, from the finger's speed, at most the composer's bottom padding, unless motion is reduced. Gboard's slide adds to the bounce.

A drag down from the composer blurs it too, unless a long press began it. Under a coarse primary pointer, while the keyboard is up, the page hold cancels one-finger drags that start on the composer. Its own scrollers, a pinch and a zoomed page stay the browser's.

Current specification

Public delta and caller burden

No new prop or type. The follow code goes.

Design and alternatives

  • Dismissing at the lift with an armed follow: rejected in DEC-1.
  • Claiming the composer drag: its touch-action blocks pinch-zoom.
  • A bounce as its own Web Animation: a second writer of the dock's translate.

Evidence

iOS 26.2 Simulator, "Full AI Chat":

  • A drag down the conversation blurred the field at the composer, 0.4 to 1.6 s before the lift.
  • A drag down from the composer blurred it within 0.3 s, the transcript still. A press-and-hold caret drag kept the keyboard.
  • In every traced frame, the composer stayed 44 px below the button.

Scope

  • One capability is added.
  • Unrelated fixes, cleanup, and policy changes were removed or split.
  • Consumer docs, focused tests, and migration evidence ship with the feature.
  • Public text and artifacts contain no internal Meta context.

Writing rubric results

component:ChatLayout: R4, DEC-1's two one-line rejections; others none. spec:AST-094 FR19, FR36, FR37, FR43 and current-state lines and spec:AST-099 paths and current-state line: R1–R7 none.

Testing

Behavior module: ChatLayout transcript dismissal (transcriptDismiss.ts)

ChatLayout's import, bytes (core build, esbuild, minified, React and StyleX external), both on main 3bd058c:

follow code (1fd9e0e, import updated) this change (680bf29)
minified 281,788 254,428
gzip 91,202 81,421

The table predates the keyboard ride. Since then, ChatLayout loads the animator again through its keyboard hook, and the bounce plays on the dock's motion engine.

@vercel

vercel Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 17, 2026 1:42pm UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟡 Reviewed (for maintainers only) Nov 17, 2026, 2:04 PM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 24, 2026
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

Current run: The current CI run concluded skipped. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

@astracat-bot astracat-bot 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.

Approval waits on an owner decision: no current spec covers ChatLayout's new keyboardDismissMode prop or its default-on 'interactive' dismissal. An engineering owner needs to provide or identify the governing spec, meaning whether ChatLayout ships the prop and which default it uses, and record it by commenting /approve-spec <full head SHA> on this pull request; the author can do this if they are an engineering owner. Independently of that decision, these changes are needed:

  • The diff includes four open predecessor pull requests (#8045, #8067, #8074, #8176), about 27,000 authored lines, so please land them through their own reviews and rebase this branch down to its ChatLayout commit.
  • 'onDrag' blurs the composer even when no software keyboard is shown, unlike 'interactive', so please gate it on the keyboard being up and add a test.
  • The new draft spec:AST-094 needs its own owner ruling in the pull request that introduces it, and its FR7 cites spec:AST-090, which is not in the repository.

[Automated review]

@astracat-bot astracat-bot 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.

Approval waits on an owner decision: no current spec covers ChatLayout's new keyboardDismissMode prop or its default-on 'interactive' dismissal. An engineering owner needs to provide or identify the governing spec, meaning whether ChatLayout ships the prop and which default it uses, and record it by commenting /approve-spec <full head SHA> on this pull request; the author may do so if they are an engineering owner. Independently of that decision, these changes are needed:

  • The diff includes four open predecessor pull requests (#8045, #8067, #8074, #8176), about 27,000 authored lines, so please land them through their own reviews and rebase this branch down to its ChatLayout commit.
  • 'onDrag' blurs the composer even when no software keyboard is shown, unlike 'interactive', so please gate it on the keyboard being up and add a test for that case.
  • The new draft spec:AST-094 needs its own owner ruling in the pull request that introduces it, and its FR7 cites spec:AST-090, which is not in the repository.
  • docsZh in ChatLayout.doc.mjs has no keyboardDismissMode entry and does not mention the new default.

[Automated review]

@astracat-bot astracat-bot 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.

Approval waits on an owner decision: no current spec covers ChatLayout's new keyboardDismissMode prop or its default-on 'interactive' dismissal. An engineering owner needs to provide or identify the governing spec, meaning whether ChatLayout ships the prop and which default it uses, and record it by commenting /approve-spec <full head SHA> on this pull request; the author may do so if they are an engineering owner. Independently of that decision, these changes are needed:

  • The diff includes six open predecessor pull requests (#8045, #8067, #8074, #8176, #8258, #8287), about 29,800 authored lines, so please land them through their own reviews and rebase this branch down to its ChatLayout commit.
  • 'onDrag' blurs the composer even when no software keyboard is shown, unlike 'interactive', so please gate it on the keyboard being up and add a test for that case.
  • The draft spec:AST-094 needs its own owner ruling in the pull request that introduces it: its FR7 cites spec:AST-090, which is not in the repository, and its FR4 rules out the theme-tunable touch motion that #8258 adds.
  • docsZh in ChatLayout.doc.mjs has no keyboardDismissMode entry and does not mention the new default.

[Automated review]

@cixzhang

Copy link
Copy Markdown
Contributor

Posted by Cindy's agent on her behalf.

Parts of this PR re-implement behavior that already exists, or is being specified, as a shared part of core. Converging keeps one implementation per behavior:

  • Commit or spring back on release. core/src/keyboard/keyboardDismiss.ts:72 decides on its own whether a release finishes or springs back. A shared release rule is being specified (AST-057 FR5 covers row swipe today); avoid a component-specific threshold model.

This is about where the behavior lives, not about the PR's intent.

@vjeux

vjeux commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

Agreed: one implementation.

  • Commit or spring back on release: the dismissal will take its decision from the shared release rule once that rule is specified, with no threshold model of its own. In the next push it reads the keyboard height from the shared keyboard module (AST-099).

vjeux added a commit to vjeux/astryx that referenced this pull request Oct 25, 2026
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 25, 2026
@vjeux
vjeux force-pushed the uikit/c08-keyboard-dismiss branch from edc7843 to cd49b1b Compare October 25, 2026 01:51
@vjeux

vjeux commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

Pushed in cd49b1b: the dismissal reads the shared height from the keyboard module, stacked on #8176.

@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec b7fbaef

@astracat-bot astracat-bot 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.

Changes requested: the drag-to-dismiss and every record edit this head carries are approved by an engineering owner and the code reads correctly, but device and emulator results for this head are missing, and the description still describes a ChatLayout-only change.

  • spec:AST-094 Platform support (with DEC-27 and DEC-31) needs a real-iPhone side-by-side and Chrome with Gboard in the Android emulator (normal animation scale, animations removed, slow-device profile) for a build of this exact head, because merges since the last takes change motion/resolveMotion.ts and keyboard/keyboardHeight.ts, which the bounce and the drag dismissal import directly, and the Android takes ran on a physical phone.
  • With #9777, #8080 and #11859 carried, their behavior needs its platform results at this head too: Safari on iOS in the Simulator and Firefox for Android and Chrome with Gboard in the emulator for the field reveal and its scroll back (spec:AST-099 Platform support and its FR9 rows), Safari on iOS in the Simulator for #9983's whole-keyboard height during Safari's pan (FR2), and iOS and Android results for DropdownMenu's touch grow (spec:AST-094 FR31).
  • The first-load report that architecture:component-import-boundaries INV10 asks for was measured before the merge, and the form and menu reference pages now load the grown keyboard module (through TextInput) and DropdownMenu's grow on the animator, so it needs base-against-head numbers per page for this head.
  • The description's Scope checklist still says one capability is added and unrelated changes were removed or split, and its Current specification lists three records, while this head also ships the field reveal, the menu touch grow and the pick's touchend cancel with three more release notes and five more record edits; update those sections, or take the merge out.

Non-blocking: the Stack line here (#9777 → #8080 → #11859 → #8217 ← #9983) matches neither #9983's line nor the one in #9777, #8080 and #11859, so it declares no stack and this pull request was reviewed on its own; DEC-1's composer-drag sentence could say "on a phone or a tablet" as FR10 does, and the Chinese description does not mention drag-to-dismiss yet.

Claims and files checked

Review mode: same-head; reason: none

  • Release note, ChatLayout drag-to-dismiss (dismissal as the finger reaches the composer, one bounce never faster than the finger with the scroll-to-bottom button, the Gboard slide adding to it, nothing moving under Reduce Motion, the composer drag except after a long press, the phone-or-tablet page hold, inner scrollers and pinch kept, mouse unchanged, focus rest, no caller control) — verified in code and unit cases (transcriptDismiss.ts:156-183, composerBounce.ts, useChatKeyboard.ts); not shown on iOS or Android at this head.
  • Release note, whole keyboard height during Safari's pan — verified in code and unit cases (utils/layoutViewport.ts, keyboard/keyboardHeight.ts).
  • Release notes for fields above the keyboard, the menu touch grow and the pick's touchend cancel — accurate to the code (keyboard/keyboardTarget.ts, DropdownMenu.tsx, utils/clickGuard.ts).
  • Description: no new prop or type — verified (the built surface lists no change); the follow code is gone — verified; a test keeps the keyboard module gesture-free — verified.
  • Description: the latest merge keeps both sides in three keyboard files (store version 5, the band reading the keyboard-viewport height, the layout-viewport import kept) — verified (keyboardHeight.ts:136-137, keyboardTarget.ts:20, :401).
  • Description: this change's own lines equal the previous head's apart from those resolutions and the shared-store test — verified (the same 28 files, identical apart from those three).
  • Description: Scope checklist (one capability; unrelated changes removed or split) — false (finding above).
  • Description: first-load numbers on the reference pages — measured before the merge, so stale for this head (finding above).
  • Description: build, type check, lint and test runs at this head — consistent with this review's build and unit runs; CI is skipped on the draft.
  • Description: device runs on a real iPhone and a physical Pixel 8 at earlier heads, later runs pending — accurate as stated; none carries to this head (finding above).
  • Files, ChatLayout's change: ChatLayout.tsx, transcriptDismiss.ts, composerBounce.ts, useChatKeyboard.ts, rideKeyboard.ts, nativeScroll.ts, ChatLayout.doc.mjs, its release note, the touch-support check and its tests — clear apart from the evidence findings and the two non-blocking notes.
  • Files, #9983's lines: layoutViewport.ts, keyboardHeight.ts, useLayerKeyboardClearance.ts, useMobileKeyboard.ts, the keyboard README, its release note, its record line and tests — clear apart from the evidence finding.
  • Files, carried by the merge: TextInput, TextArea, NumberInput, DropdownMenu, Popover's surface motion, useMenuPress.ts, clickGuard.ts, inputStream.ts, touchQueries.ts, settledBox.ts, keyboardTarget.ts, the sheet doc, three release notes, stories, sandbox pages, the sheet bundle check and tests — no code defect; evidence and description findings above.
  • Files, records: the eight changed records — owner-approved at this head; one non-blocking wording note on DEC-1.

Automated review (maintainer link)

@vjeux

vjeux commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Thanks. This head merges the stack below it (#9777 → #8080 → #11859), and #9983 sits under it too, so one Stack line can't match both chains. The description now lists what the stack brings. Those pull requests' own results stay on them. This one owes proof that its keyboard-top change regresses none of them, and the description lists those takes, pending at this head. The Scope checklist covers this pull request's own change; the stack's changes are reviewed in their own pull requests.

@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 4bbfd49

@astracat-bot astracat-bot 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.

Changes requested: the drag-to-dismiss and every record edit this head carries are approved by an engineering owner and the code reads correctly, but the iPhone, Simulator and emulator results this head still needs are listed as pending in the description.

  • spec:AST-094 Platform support and DEC-31 need a real-iPhone side-by-side for the drag dismissal at this head against the head the owner passed, because the earlier iPhone takes do not carry across the merges since then.
  • With #9777, #8080 and #11859 carried, their behavior needs its platform results at this head too: Safari on iOS in the Simulator for #9983's whole-keyboard height during Safari's pan (spec:AST-099 FR2), Chrome with Gboard and Firefox for Android in the emulator for the field reveal and its scroll back (spec:AST-099 FR9 rows), and iOS and Android takes for DropdownMenu's touch grow (spec:AST-094 FR31), which DEC-31 cannot carry from #8080 because this head adds its own keyboard and layer lines.

The Chrome-with-Gboard emulator run for the drag dismissal carries to this head, and the first-load report covers the reference pages. Non-blocking: the Scope checklist could say it covers this pull request's own increment; the Stack line matches neither #9983's line nor the one in #9777, #8080 and #11859, so it declares no stack; DEC-1's composer-drag sentence could say "on a phone or a tablet" as FR10 does; and the Chinese description does not mention drag-to-dismiss yet.

Claims and files checked

Review mode: same-head; reason: none

  • The code is unchanged since the previous review of this same head; the description, approvals, labels, status checks and the other pull requests' Stack lines were read again — verified.
  • Release note, ChatLayout drag-to-dismiss (dismissal as the finger reaches the composer, one bounce never faster than the finger with the scroll-to-bottom button, the Gboard slide adding to it, nothing moving under Reduce Motion, the composer drag except after a long press, the phone-or-tablet page hold, inner scrollers and pinch kept, mouse unchanged, focus rest, no caller control) — verified in code and unit cases (transcriptDismiss.ts, composerBounce.ts, useChatKeyboard.ts); shown in the Android emulator, not yet on an iPhone at this head.
  • Release note, whole keyboard height during Safari's pan — verified in code and unit cases (utils/layoutViewport.ts, keyboard/keyboardHeight.ts); Simulator take pending.
  • Release notes for fields above the keyboard, the menu touch grow and the pick's touchend cancel — accurate to the code (keyboard/keyboardTarget.ts, DropdownMenu.tsx, utils/clickGuard.ts).
  • Description: no new prop or type — verified (the built surface lists no change); the follow code is gone — verified; a test keeps the keyboard module gesture-free — verified.
  • Description: the latest merge has no conflicts and leaves this change's own lines unchanged — verified (identical diff against each merge base).
  • Description: the emulator runs for the drag dismissal at the previous head carry here — verified (the merge changes none of this pull request's files, their direct imports or shared motion and layer modules).
  • Description: first-load numbers per reference page against main — reported as the import-boundaries record asks; not rebuilt here.
  • Description: build, typecheck, lint and test results at this head, with three node-suite files failing (two said to fail on main too) — not rerun here, since the heavy CI jobs have not run on the draft; the two named files are CLI theme-editor tests this pull request does not change.
  • Description: Scope checklist (one capability; unrelated changes removed or split) — accurate only for this pull request's own increment (non-blocking note).
  • Description: iPhone, Simulator and emulator takes pending at this head — accurate as stated (findings above).
  • Files, ChatLayout's change: ChatLayout.tsx, transcriptDismiss.ts, composerBounce.ts, useChatKeyboard.ts, rideKeyboard.ts, nativeScroll.ts, ChatLayout.doc.mjs, its release note, the touch-support check and its tests — clear apart from the evidence findings and two non-blocking notes.
  • Files, #9983's lines: layoutViewport.ts, keyboardHeight.ts, useLayerKeyboardClearance.ts, useMobileKeyboard.ts, the keyboard README, its release note, its record line and tests — clear apart from the evidence finding.
  • Files, carried by the merge: TextInput, TextArea, NumberInput, DropdownMenu, Popover's surface motion, useMenuPress.ts, clickGuard.ts, inputStream.ts, touchQueries.ts, settledBox.ts, keyboardTarget.ts, the sheet doc, three release notes, stories, sandbox pages, the sheet bundle check and tests — no code defect; evidence finding above.
  • Files, records: the eight changed records — owner-approved at this head; one non-blocking wording note on DEC-1.

Automated review (maintainer link)

@vjeux

vjeux commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Thanks. DropdownMenu's touch grow is now on this head's pending list, in Safari on an iPhone and in the Android emulator. Its layer imports useLayerKeyboardClearance, which this change edits. The other results you list are on that list too.

This branch was successfully deployed

1 active deployment
Preview — 4bbfd495 Deployed Nov 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants