Repository navigation
test(ChatLayout): the rise proof keeps the caret out and names a starved start - #10489
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| ChatComposer | 76.7 kB (0) · 12.0 kB CSS (0) | — | ✓ · ✓ · — |
| ChatComposerDrawer | 17.9 kB (0) · 4.7 kB CSS (0) | — | ✓ · ✓ · — |
| ChatComposerInput | 74.4 kB (0) · 11.2 kB CSS (0) | — | ✓ · ✓ · — |
14 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| ChatComposerTokenElement | 74.4 kB (0) · 11.2 kB CSS (0) | — | ✓ · ✓ · — |
| ChatDictationButton | 59.7 kB (0) · 10.0 kB CSS (0) | — | ✓ · ✓ · — |
| ChatLayout | 79.3 kB (0) · 10.5 kB CSS (0) | — | ✓ · ✓ · — |
| ChatLayoutScrollButton | 59.6 kB (0) · 10.1 kB CSS (0) | — | ✓ · ✓ · — |
| ChatMessage | 17.1 kB (0) · 3.7 kB CSS (0) | — | ✓ · ✓ · ✓ |
| ChatMessageBubble | 7.5 kB (0) · 3.7 kB CSS (0) | — | ✓ · ✓ · ✓ |
| ChatMessageList | 27.5 kB (0) · 7.0 kB CSS (0) | — | ✓ · ✓ · — |
| ChatMessageMetadata | 20.2 kB (0) · 4.1 kB CSS (0) | — | ✓ · ✓ · — |
| ChatSendButton | 59.5 kB (0) · 9.9 kB CSS (0) | — | ✓ · ✓ · — |
| ChatSystemMessage | 7.0 kB (0) · 3.8 kB CSS (0) | — | ✓ · ✓ · — |
| ChatTokenizedText | 7.2 kB (0) · 4.0 kB CSS (0) | — | ✓ · ✓ · — |
| ChatToolCalls | 31.3 kB (0) · 8.3 kB CSS (0) | — | ✓ · ✓ · — |
| chat | — | — | — · ✓ · — |
| Chat | — | — | ✓ · ✓ · — |
Package size: no published package changed; no new dependencies.
API changes: none in this pull request
Committed API report behind this build: cli 29 rows, core 35 rows, theme-butter 1 row, theme-y2k 1 row; run pnpm api:report.
Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Approval waits on an engineering owner's decision on spec:AST-099, and three changes are needed either way.
This head adds ChatLayout verification rows to the current record (docs/specs/AST-099-mobile-keyboard/spec.md lines 401-403, including the FR8 row's no-paint-per-frame failure and the FR3-FR4 row's composer-group and newest-message failures) and ships two behaviors no current clause settles: the composer region becoming an unnamed role="group" that Done parks focus on, and the keyboard module holding the shown height through a stepped hide under Remove animations. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so if they are an engineering owner.
Required changes:
- The diff carries 3,228 authored lines (3,005 from #8176) with no
Stack:declaration, so declareStack: #8176 → #10489in both bodies or rebase once #8176 and #10486 merge. useChatKeyboard.ts:425-454copies the reveal-pan put-back inkeyboardTarget.ts'swatchPans, so exportwatchPansasdeliverTapandfollowsKeyboardalready are, and call it.- The Effect at
useChatKeyboard.ts:354-356only re-runscommit()afteruseKeyboardHeightre-renders on a keyboard report, so subscribecommitto the keyboard module's reports in the Effect at:224(after its guide subscription) and dropuseKeyboardHeightand that Effect.
Non-blocking: move the new isKeyboardSurface lines in ChatComposerInput.tsx above the doc comment they now sit under.
[Automated review]
ac8e4aa to
a3a0331
Compare
There was a problem hiding this comment.
Changes requested for the stack: #10489's own change is ready, but #8176 below it needs three fixes, and a pull request lands only when it and every pull request below it are approved.
#8176: changes requested
useChatKeyboard.ts:435-449repeatswatchPansfromkeyboardTarget.ts(last height,report()on a change,putBack()on a reveal pan), so please exportwatchPansasdeliverTapandfollowsKeyboardalready are, and call it.- The Effect at
useChatKeyboard.ts:354-356only re-runscommit()afteruseKeyboardHeightre-renders on a keyboard report, so please subscribecommitto the keyboard module's reports in the Effect at:224, after the guide subscription, and dropuseKeyboardHeightand that Effect. - Miss:
spec:AST-099Platform support asks for Android emulator evidence at the exact head, and the description's Firefox for Android, slow-device (animations on) andinteractive-widget=resizes-contenttakes come from an earlier head, so please retake them at this head. - Non-blocking: move the new
isKeyboardSurfacelines inChatComposerInput.tsxabove the doc comment they now sit under.
#10489: approved on its own, pending CI
The reworked rise proof passes on this head and still fails a frame loop that repaints the dock or the page background. CI has not run on this head yet: a maintainer adds the ci:run label so CI runs.
- Non-blocking:
ridesOnlychecks that a start restyle touches at most two elements, not which ones, so its comment should say that.
Whole stack: changes requested until #8176's three items are fixed.
[Automated review]
a3a0331 to
cc0837d
Compare
There was a problem hiding this comment.
Changes requested for the stack: #10489's own change is ready, but #8176 below it still needs device evidence at its current head, and a pull request lands only when it and every pull request below it are approved.
#8176: changes requested
spec:AST-099Platform support asks for Android emulator evidence at the exact head, and the description's Chrome (animations normal and removed, slow-device), Firefox for Android andinteractive-widget=resizes-contenttakes come from earlier heads, before the commit-path change, so please retake them at the current head and say so in the description.
#10489: approved on its own, pending CI
The reworked rise proof passes on this head and still fails a frame loop that repaints the dock or the page background. CI has not run on this head yet: a maintainer adds the ci:run label so CI runs.
Whole stack: changes requested until #8176's Android evidence is retaken at its head.
[Automated review]
Chrome's caret blinks every 500 ms from the focus, and each blink is a main-thread frame. The proof focused, then made several DevTools round trips before the keyboard report, so under load the first blink landed in its 125-220 ms window. Focus, the wait for the focus feedback and the report now run in one step, as on a phone. The proof fails by name when the report comes 280 ms or more after the focus.
Under load the report's own task can run late, and the ride's start frames then reach the steady window. The proof now places them and leaves them out of its count: the commit frame of the report's layout, then up to one restyle frame per ridden element. Each comes within three frames of the one before, restyles only the dock and the transcript, and paints only the root layer and the code block. Every other frame in the window still counts. When a starved main thread leaves less than two frames to judge, the proof fails by name, with its evidence.
cc0837d to
13231e9
Compare
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. Next step: a maintainer adds the ci:run label so CI runs.
The reworked rise proof passes on this head. It still fails a frame loop that repaints the dock's outline or the page background, and it now names a late report or a starved start instead of failing on a bare Paint count.
- Miss: (non-blocking) a late start the page causes itself now passes: with 130 ms of script in a
visualViewportresize listener, main's proof fails on 5 Paints while this one passes, so consider leaving the start frames out only when the report task was starved (thread time at most half its wall time, whichstarvation()already measures) and failing by name otherwise.
[Automated review]
The ride's start frames reach the window when the main thread is starved, and the proof left them out wherever they landed. So a late start the page causes itself, as 130 ms of script in a visual viewport resize listener does, passed. Now the start frames are left out only when the report's task had the main thread for half its wall time or less. A start the page delays into the window fails by name.
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. Next step: a maintainer adds the ci:run label so CI runs.
The rise proof now leaves the ride's start frames out only when the report's task was starved. With 130 ms of script in a visualViewport resize listener it fails by name, while a starved renderer that fails main's proof 7 of 12 passes 12 of 12 here. It still fails a frame loop that repaints the dock's outline or the page background.
[Automated review]
There was a problem hiding this comment.
Changes requested: since the merge of main, the rise proof's starved-start rule no longer finds a starved report task on this head.
- Regression: the report task is looked up only in
trace.longTasks(ChatLayoutKeyboard.interaction.browser.spec.ts:797and:152), but since #10510 the harness puts every task with 50 ms or less of main-thread time intrace.stretchedTasks, so a starved start (the description's own example, 160 ms of wall time for 14 ms of thread time) fails as "the ride's start reached the window without a starved thread" withreportTask: null.
Reading [...trace.longTasks, ...trace.stretchedTasks] in one helper shared by both lookups, as the harness's own spec does, should restore the rule; please re-measure the flake rates on the merged main. This pull request changes no spec record, so the /approve-spec on this head leaves the finding above standing. Non-blocking: the comment at :736-738 is stale, since under the coarse-pointer phone profile the composer's focus look no longer animates and that wait does nothing.
[Automated review]
The harness keeps a task whose main thread ran 50 ms or less with its stretched tasks, and the rise proof looked for the report's task among the long ones only. So a starved start failed as one the page delayed. One helper now reads the long and the stretched tasks, for the test and for starvation(), and the failure detail lists the stretched ones. The focus wait's comment says it matters only under a fine pointer.
|
/approve-spec 2f31145 |
|
/approve-spec 07d0d52 |
|
Fixed in 07d0d52: one helper reads the long and the stretched tasks, for the test and for |
There was a problem hiding this comment.
Approved pending CI: required checks are still running on this head.
The rise proof now finds the report's task among both the harness's long and stretched tasks through one taskAt helper, so the starved-start rule works again on the merged main, and the focus-wait comment now says the wait matters only under a fine pointer. A start the page delays itself still fails by name, and a dock that lays out or paints per frame still fails as rendering.
Non-blocking: the taskAt JSDoc says a starved task ran its main thread 50 ms or less, but a task the proof counts as starved can run longer (60 ms of thread time in 140 ms of wall time lands in longTasks), so only the wording needs a touch.
[Automated review]
| * The page's task that holds `t`, long or stretched. A starved task ran its | ||
| * main thread 50 ms or less, so the trace keeps it with the stretched tasks. |
There was a problem hiding this comment.
Non-blocking: a task the proof counts as starved (threadMs <= durationMs / 2) can run its main thread longer than 50 ms; 140 ms of wall time with 60 ms of thread time goes to longTasks and is still starved. The helper reads both lists, so the behavior is right. Wording that states only what holds: "A task whose main thread ran 50 ms or less sits with the stretched tasks."
Maintainer impact
Four commits and a merge of main (compare). The chat keyboard's rise proof fails under load on a 2-thread pin (one physical core): on main, 11 of 48 at 4 workers and 17 of 48 at 6.
Intended invariant
spec:AST-099FR8: in Chrome on Android, the dock rides Gboard's slide with no main-thread layout or paint per frame, counted 125–220 ms after the report. Neither changes.Change
Evidence
Scope
Testing
ChatLayoutKeyboardspec: Chromium 18 of 18.ChatLayoutKeyboardspec, Chromium 18/18.ChatLayoutKeyboardWebKit (CI-profile container) 12 passed, 6 skipped (Chrome's profile needs the VirtualKeyboard API). The rise proof: 24/24 on a 2-thread pin (one physical core) at 1 worker, 48/48 at 4 workers and 48/48 at 6, and 24/24 in the CI-profile container. On the earlier base, 6 workers once gave 47 of 48; the other failed by name, its report task at 160 ms of wall time for 14 ms of thread time, leaving 11 ms of window.