Skip to content

perf(site): keep mobile dropdown variables off the root on desktop - #29596

Open
mafredri wants to merge 6 commits into
mainfrom
perf/chat-interaction
Open

mafredri wants to merge 6 commits into
mainfrom
perf/chat-interaction

Conversation

@mafredri

@mafredri mafredri commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

Base: main. First of a stack; #31365, #31366, #31367 and #31572 follow.

useChatDropdownPosition, which both chat composers use, sets five --mobile-dropdown-* properties on <html> from an effect that re-reads the composer's position on focus, input, selection, scroll and resize, at every width. Only below-md utilities read them, and a changed custom property on the root restyles every element. Browsers skip a write of an equal value, so on main the root restyles each time a value changes, for example when the composer grows by a line.

This PR runs the effect only below md, where dropdown positioning is unchanged.

#31278 bench (a tool, not for merging) on production builds of f348cd66d7 (this PR's base on main then) and the pre-rebase version of af7b2c7b4a (this PR; later commits change only tests), one chat with 72k nodes at 1800 px, 3 alternating runs per side:

keystroke that wraps the composer main this PR
Chromium 467 to 649 ms 17 to 32 ms
WebKit 3,381 to 3,892 ms 99 to 118 ms

Other keystrokes and focusing the composer did not change beyond noise.

Run details

Each run types 560 characters after 340 prefilled ones, so the composer grows by a line 6 times in Chromium and 5 in WebKit. Each wrap cell gives min to max over the wrapping keystrokes of all 3 runs.

p50, min to max main this PR
Chromium, other keystrokes 23 to 24 ms 23 to 24 ms
WebKit, other keystrokes 97 to 99 ms 97 to 98 ms
Chromium focus, pointer 11 to 13 ms 11 to 15 ms
WebKit focus, pointer 271 to 332 ms 303 to 324 ms

🤖 This PR was created with the help of Coder Agents, and will be reviewed by a human. 🏂🏻

mafredri added a commit that referenced this pull request Sep 21, 2026
Source-only pick of the six perf commits in #29596, to test
whether several long streaming chats become usable in Safari:

- keep mobile dropdown variables off the root on desktop
- scroll markdown code blocks natively
- avoid descendant :focus-within selectors
- stop loading monaco on every page
- re-lex only the tail of a streaming message
- find the grapheme boundary without a full walk

The compare route and the chatbench stack are left out. One import line in
Response.tsx differs because this branch still uses ComponentPropsWithRef.
@mafredri
mafredri force-pushed the perf/chat-interaction branch from 1540758 to f6c1b3f Compare September 21, 2026 08:24
@linear-code

linear-code Bot commented Sep 21, 2026

Copy link
Copy Markdown

CODAGT-1081

@github-actions github-actions Bot added the stale This issue is like stale bread. label Oct 20, 2026
@mafredri
mafredri force-pushed the perf/chat-interaction branch 2 times, most recently from 1e73a6f to 9a327e5 Compare October 21, 2026 09:02
@github-actions github-actions Bot removed the stale This issue is like stale bread. label Oct 23, 2026
@mafredri
mafredri force-pushed the perf/chat-interaction branch 2 times, most recently from dbcf27b to be95b4c Compare October 26, 2026 14:24
@mafredri mafredri changed the title perf: fix interaction lag with long side-by-side streaming chats perf(site): fix interaction lag with long side-by-side streaming chats Oct 26, 2026
@mafredri

This comment has been minimized.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T21:30:30.370832Z d521894 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

chatgpt-codex-connector[bot]

This comment was marked as outdated.

coder-agents-review[bot]

This comment was marked as outdated.

@mafredri
mafredri force-pushed the perf/chat-interaction branch from fb89841 to 199f727 Compare October 26, 2026 17:51
@mafredri

This comment has been minimized.

@mafredri
mafredri force-pushed the perf/chat-interaction branch from a575160 to 215a10c Compare October 26, 2026 22:28
@mafredri mafredri changed the title perf(site): fix interaction lag with long side-by-side streaming chats perf(site): keep mobile dropdown variables off the root on desktop Oct 26, 2026
@mafredri
mafredri force-pushed the perf/chat-interaction branch from 9a948d2 to 41ecbf8 Compare October 27, 2026 14:24
mafredri added a commit that referenced this pull request Oct 27, 2026
--type-prefill and --type-chars fill the composer and then type filler
text one key at a time, so it grows line by line. On main each growth
changes the composer's mobile dropdown variables on <html>; the #29596
numbers for that case come from these flags.
mafredri added a commit that referenced this pull request Oct 27, 2026
…at caused them

wrap-summary.mjs recomputes the #29596 wrapping table from results.json:
the slowest keystroke before each growth, the other keystrokes' p50 and
the <html> style mutation records, all within the typing window.
@mafredri

This comment has been minimized.

@coder-agents-review

coder-agents-review Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Chat: Review posted | View chat
Requested: 2026-10-27 21:29 UTC by @mafredri

Review history
  • R2 (2026-10-27): 11 reviewers, 3 Nit, 7 P2, 7 P3, 7 P4, COMMENT. Review
  • R3 (2026-10-27): 7 reviewers, 3 Nit, 7 P2, 7 P3, 7 P4, APPROVE. Review

deep-review v0.13.0 | Round 3 | f348cd6..d521894

Last posted: Round 3, 24 findings (7 P2, 7 P3, 7 P4, 3 Nit), APPROVE. Review

Finding inventory

Finding inventory: PR #29596

Findings

# Sev Status Location Summary Round Reviewer Posted
CRF-1 P3 Moved to #31366 (PR split); author claims fixed (4d0b319) AttachmentPreview.stories.tsx:59 ThumbnailFocused story tabs but asserts nothing R1 Netero Yes
CRF-2 P4 Moved to #31366 (PR split); author claims fixed (a575160) AttachmentPreview.tsx:187 Paste inline hidden when Remove has keyboard focus (peer-focus only matches earlier siblings) R1 Netero Yes
CRF-3 Nit Moved to #31365 (PR split); author claims fixed (ee27c33) Response.tsx:243 Code block scrollbar color uses surface-quaternary instead of global surface-scrollbar R1 Netero Yes
CRF-4 Note Deferred (CODAGT-1081); moved to #31366 (PR split) AttachmentBlocks.tsx:190 peer-focus-within still a non-subject :focus-within selector, unmeasured R1 Netero No
CRF-5 P3 Moved to #31367 (PR split); author claims fixed (c6f8ab5) vite.config.mts:79 Global includeDependenciesRecursively: false creates radix-ui <-> Command chunk cycle R1 Nami, Pariston, Mafuuu, Leorio, Razor Yes
CRF-6 P3 Author contested; panel closed R2 (2/2 accept); code moved to #31367 vite.config.mts:79 monaco CSS with 4 A:focus-within B rules returns to /agents after visiting a template files page R1 Pariston P3, Razor Note Yes
CRF-7 P2 Moved to #31366 (PR split); author claims fixed (4d0b319, a575160) AttachmentBlocks.tsx:173 Tab from attachment View button no longer reaches Download link (focus goes to body) R1 Bisky Yes
CRF-8 P3 Moved to fifth stacked PR, not open (PR split); author claims fixed (5c3cd7a) streamingBlockParser.ts:84 No test fails when the witness check is deleted R1 Bisky Yes
CRF-9 P3 Moved to fifth stacked PR, not open (PR split); author claims fixed (5c3cd7a) streamingBlockParser.ts:8 No test fails when the duplicate link definition alternative of NEEDS_FULL_PARSE is deleted R1 Bisky Yes
CRF-10 P4 Moved to fifth stacked PR, not open (PR split); author claims fixed (5c3cd7a) streamingBlockParser.ts:71 Cache reset in remember changes no result; delete or test it R1 Bisky Yes
CRF-11 P3 Moved to fifth stacked PR, not open (PR split); author claims fixed (5c3cd7a) streamingBlockParser.ts:8 Link label regex uses \\. instead of marked's \\[\s\S]; backslash-newline labels mismatch Streamdown R1 Gon Yes
CRF-12 P2 Author fixed (a47e012) AgentChatInput.tsx:830 Comment restates the two guards below it R1 Gon Yes
CRF-13 P2 Moved to fifth stacked PR, not open (PR split); author claims fixed (62e6e5c) SmoothText.ts:343 Comment narrates what containing() does R1 Gon Yes
CRF-14 P2 Author contested; panel closed R2 (1/1 accept); code moved to #31365 Response.stories.tsx:107 Modified comment restates the waitFor lookup R1 Gon Yes
CRF-15 P2 Moved to fifth stacked PR, not open (PR split); author claims fixed (5c3cd7a) streamingBlockParser.ts:68 Comment repeats the duplicate link definition fact from line 5 R1 Gon Yes
CRF-16 P2 Moved to fifth stacked PR, not open (PR split); author claims fixed (5c3cd7a) streamingBlockParser.test.ts:118 fuzzPieces comment lists 5 construct kinds; array has many more R1 Gon Yes
CRF-17 P2 Moved to fifth stacked PR, not open (PR split); author claims fixed (5c3cd7a) streamingBlockParser.test.ts:233 Comment repeats the test name, does not explain the bounds R1 Gon Yes
CRF-18 P4 Moved to fifth stacked PR, not open (PR split); author claims fixed (5c3cd7a) streamingBlockParser.test.ts:239 longestBlock * 3 and lengths.length / 2 are unexplained limits R1 Gon Yes
CRF-19 P4 Moved to fifth stacked PR, not open (PR split); author claims fixed (5c3cd7a) streamingBlockParser.ts:8 Footnote pattern {1,200} copies Streamdown with no source cited R1 Gon Yes
CRF-20 Nit Moved to fifth stacked PR, not open (PR split); author claims fixed (5c3cd7a) streamingBlockParser.ts:18 witness name says nothing about content (first line after the cut) R1 Gon Yes
CRF-21 Nit Moved to fifth stacked PR, not open (PR split); author claims fixed (5c3cd7a) streamingBlockParser.ts:23 One concept named final, complete, and completed R1 Gon Yes
CRF-22 P4 Moved to fifth stacked PR, not open (PR split); author claims fixed (62e6e5c) SmoothText.ts:296 GraphemeSegments hand-declares containing(), which lib es2022.intl already types R1 Ging-TS, Ging-React Yes
CRF-23 P3 Moved to fifth stacked PR, not open (PR split); author claims fixed (5c3cd7a) streamingBlockParser.test.ts:190 Random construct fuzz test runs near the 5000 ms vitest timeout; timed out 2 of 4 runs R1 Killua Yes
CRF-24 P4 Moved to fifth stacked PR, not open (PR split); author claims fixed (5c3cd7a) streamingBlockParser.ts:47-51 Doc comment names one full-parse condition of four R1 Leorio Yes
CRF-25 Note Author fixed (b063958, equal-value check removed) AgentChatInput.tsx:861 setRootVariable skips based on per-instance cache, not the current value on html R1 Mafuuu No
CRF-26 Note Note (body); moved to fifth stacked PR, not open (PR split); author replied SmoothText.ts:346 segment(text) still copies the whole text into ICU each frame R1 Killua No
CRF-27 OOS Out of scope (body) AgentChatInput.tsx:924 Below md, each input/keyup/selectionchange runs update() six times with layout reads R1 Killua No
CRF-28 OOS Out of scope (body); moved to fifth stacked PR, not open (PR split) SmoothText.ts:355 Codepoint fallback unreachable for every browserslist target R1 Ging-TS No
CRF-29 OOS Out of scope (body) ScrollArea.tsx:41 Radix ScrollArea per-instance style remains in ToolCall Scrollable and TerminalOutput R1 Pariston No
CRF-30 OOS Out of scope (body) transcript list Every document-wide restyle trigger scales with the full transcript DOM; bounding it caps all R1 Pariston No
CRF-31 OOS Out of scope (body) index.css:323 mobile-full-width-dropdown utilities hard-code 767px separately from belowMdViewportMediaQuery R1 Gon No
CRF-32 OOS Author fixed (0ff1441, renamed to stubMediaQuery) AgentChatInput.test.tsx:56 stubViewport(isMobile) name suggests it stubs every viewport query R1 Gon No
CRF-33 Note Note (body) AgentChatInput.tsx:969 No test crosses the md breakpoint while mounted; isBelowMd dependency untested R2 Netero No
CRF-34 OOS Out of scope (body) AgentChatInput.tsx:1634 Plus menu reads isBelowMdViewport() non-reactively, so it does not switch layout on crossing md R2 Netero No
CRF-35 P4 Author fixed (d521894) AgentChatInput.test.tsx:1045 Desktop test credits jsdom with the repo's matchMedia polyfill and relies on its default instead of stubbing the query R2 Gon, Bisky, Leorio Yes
CRF-36 Note Note (body) PR description "Below md the effect runs on both sides" does not say mobile behavior is unchanged or whether it was benchmarked R2 Leorio P4 No
CRF-37 Note Note (body) commit 9a0799b Commit body still says variables are written only when the value differs; b063958 removed that check (matters only without squash merge) R3 Leorio No

Contested and acknowledged

CRF-4 (Note, AttachmentBlocks.tsx:190) - peer-focus-within selector cost unmeasured

  • Finding: The replacement peer-focus-within/attachment is still a non-subject :focus-within selector (A:focus-within ~ B); the PR measured peer:focus-visible ~ B, not this form, so its WebKit cost on a transcript with attachments is unknown.
  • Author defense: Tracked in CODAGT-1081: the attachment fix gets its own before and after WebKit benchmark on a transcript with attachments in its split PR (perf(site/src/pages/AgentsPage/components): avoid descendant :focus-within selectors #31366).
  • Do not re-evaluate. Tracked in CODAGT-1081.

CRF-6 (P3, vite.config.mts:79) - monaco focus-within CSS returns to /agents after a monaco page

  • Finding: Removing monaco from the entry preload keeps its 4 A:focus-within B rules off /agents only until the user opens a page that loads monaco (template files, version pages, editor) in the same session, because Vite never removes an inserted stylesheet; the PR's own table suggests about 145 ms WebKit idle focus p50 in that state. Proposed: keep the selectors out of the built CSS, or measure the post-navigation state and state it in the PR as accepted.
  • Author defense: The 4 rules are monaco's own hover styles (copy button and hover pointer), so removing them would break monaco; the PR's table already measures that state at 145 ms idle focus p50 in WebKit, and it applies only after a monaco page loads in the session.
  • Code now lives in perf(site): stop loading monaco on every page #31367 (PR split).
  • Panel closure (R2, 2/2): Pariston and Razor, the agents that raised it, accepted. Both confirmed the 4 rules are monaco's hover widget styles (.monaco-hover .hover-row-with-copy:focus-within .hover-copy-button, .workbench-hover-container:focus-within ...), so removing them breaks monaco's hover copy button and pointer on template pages. The post-navigation state equals the measured 145 ms row (3 Tailwind rules removed, 4 monaco rules present), below the 238 ms baseline and far below the 11,976 ms before the stack; the state depends on the user's navigation path and is disclosed.

CRF-14 (P2, Response.stories.tsx:107) - modified comment restates the waitFor lookup

  • Finding: The LongLineFencedBlock play comment restates the waitFor and scrollWidth > clientWidth lookup; proposed a shorter rewrite stating only that FileViewer renders asynchronously and the capture needs the scrolled state.
  • Author defense: The comment is main's text; the PR changes only "viewport" to "container" because the Radix viewport is gone, so rewriting the rest is outside this change.
  • Code now lives in perf(site/src/pages/AgentsPage/components/ChatElements): scroll markdown code blocks natively #31365 (PR split).
  • Panel closure (R2, 1/1): Gon, the agent that raised it, accepted. In git diff origin/pr-29596..origin/pr-31365 the only edit to the comment is "viewport" to "container", which makes it correct for the new markup; the rest is main's text, and no behavior depends on it.

CRF-26 (Note, SmoothText.ts:346) - segment(text) passes the whole text to ICU each frame

  • Finding: Per-frame grapheme slicing cost still grows with message length because the whole accumulated text is segmented each frame.
  • Author accepted R2: Passing only a prefix to ICU would need lookahead past the cut to keep the cluster boundary exact, and the measured share after the change is 2.1% of WebKit JS samples. Note only; no change was requested. Code now lives in the fifth stacked PR.

Round log

Round 1

Netero first pass: 1 P3, 1 P4, 1 Nit, 1 Note; no P0, panel proceeded. Full panel (round 1): ging-ts, ging-react, nami, killua (specialists), pariston, mafuuu (core), bisky (tests changed), gon, leorio (once-per-PR floor), razor (wildcard). Size 9 + wildcard exceeds the focused target of 6-8 because the four triggered specialists, two core, Bisky and the Gon/Leorio floor are all required. Panel: 1 P2 behavior, 6 P2 comment quality (Gon rubric), 6 P3, 6 P4, 2 Nit, 2 Note, 6 out of scope. CRF-5 fix proposals conflict: monaco-only (Pariston, Mafuuu) moves React into emoji-mart and preloads 559 KB on every page per Nami and Razor builds; posted the two variants Nami and Razor verified. CRF-6 rated P3 over Razor's Note (higher wins). Killua's SmoothText.ts:346 item reclassified from out of scope to Note (body) because the PR changes those lines. Reviewed against 5a1a059..be95b4c.

Round 2

PR split into a five-PR stack; this PR now changes only AgentChatInput.tsx and its test. Churn guard PROCEED (23/23 responded). Restructure round: PR title and goal changed and 10 files left the diff. Full panel: ging-ts, ging-react, nami, killua (specialists), pariston, mafuuu (core), bisky (tests changed), gon, leorio (mandatory on restructure), razor (dispute check-in for CRF-6), kite (wildcard). Size 9 + dispute + wildcard: required specialists, core, Bisky and the Gon/Leorio restructure floor force it above the focused target. Reused round 1 agents for pariston, gon and razor (dispute check-in); others new. Findings on moved code tagged "Moved to #N" and not verified here; their verification belongs to the reviews of #31365, #31366, #31367 and the fifth PR. CRF-6 closed 2/2, CRF-14 closed 1/1. CRF-12, CRF-25, CRF-32 verified fixed. New: CRF-35 P4 (Gon, Bisky, Leorio convergent). CRF-33 (Netero P4) moved to Note (body): oxlint exhaustive-deps is error in site/.oxlintrc.jsonc:204, so dropping isBelowMd from the dependencies fails lint, and the unmount test covers the cleanup; keep-argument was that the md transition itself has no test. CRF-36 (Leorio P4, PR description wording) moved to Note (body): keep-argument was that the mobile path is the only place this PR could regress and the text does not say whether it was measured; it has no code location and Nami and Mafuuu verified below-md behavior is unchanged. Pariston and Razor reproduced in Chromium that equal-value custom property writes queue no mutation record and cost about 0 ms, supporting the removal of the equal-value check; WebKit unverified (Playwright WebKit did not launch). Reviewed against f348cd6..0ff1441.

Round 3

Fix round (one commit, d521894, test file only; no files added or moved, no signature or goal change). Churn guard PROCEED: CRF-35 addressed, CRF-4 deferred (CODAGT-1081). Netero: no findings. Panel: gon, bisky, leorio (raised CRF-35), ging-ts, ging-react, nami (.tsx and frontend triggers), razor (wildcard). CRF-35 verified fixed by Netero, Gon, Bisky, Nami and Razor; Bisky, Nami and Razor confirmed by mutation that the desktop test fails without the isBelowMd guard. No new findings. New Note (body) CRF-37 from Leorio. No open in-scope findings remain on this PR. Reviewed against f348cd6..d521894.

About deep-review

CRF = Coder Review Finding (P0-P4, Nit, Note)

Reviewer Focus
Bisky tests
Chopper ops/errors
Churn-guard change verification
Ging language modernization
Gon naming
Hisoka edge cases
Killua perf
Kite change integrity
Knov contracts
Knuckle SQL
Komugi flake/determinism
Kurapika security
Law decomposition
Leorio docs
Luffy product
Mafu-san process
Mafuuu contracts
Melody dispatch/pairing
Meruem structural
Nami frontend
Netero mechanical checks
Pariston premise testing
Pen-botter product gaps
Razor verification
Robin duplication
Ryosuke Go arch
Takumi concurrency
Zoro shape

🤖 Managed by Coder Agents.

@chatgpt-codex-connector

This comment has been minimized.

@mafredri

Copy link
Copy Markdown
Member Author

@codex review
/coder-agents-review

🤖

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: d5218948dc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@pr-queue-manager
pr-queue-manager Bot requested a review from jaaydenh October 27, 2026 21:32

@coder-agents-review coder-agents-review 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.

This PR runs the AgentChatInput effect that writes the five --mobile-dropdown-* variables on <html> only below md. No new findings; the desktop test now stubs the below-md query itself and fails without the isBelowMd guard.

Out of scope (needs a ticket or explicit acceptance by a human), unchanged from the previous review:

  • site/src/pages/AgentsPage/components/AgentChatInput.tsx:924: below md, each input, keyup and selectionchange event still runs update() six times, each with two getBoundingClientRect calls.
  • site/src/index.css:323: the mobile-full-width-dropdown* utilities hard-code 767px separately from belowMdViewportMediaQuery in site/src/utils/mobile.ts:19, and the isBelowMd guard is correct only while the two match.
  • site/src/pages/AgentsPage/components/AgentChatInput.tsx:1634: the plus menu reads isBelowMdViewport() without subscribing, so it does not switch layout when the viewport crosses md until something else re-renders it.

Notes:

  • Commit 9a0799b: its body still says the variables are written only when the value on <html> differs, which b063958 removed. This matters only if the branch is merged without squashing.

🤖 This review was automatically generated with Coder Agents.

kylecarbs
kylecarbs previously approved these changes Oct 27, 2026
@mafredri
mafredri force-pushed the perf/chat-interaction branch from d521894 to 4302e8a Compare October 30, 2026 11:38
mafredri added a commit that referenced this pull request Oct 30, 2026
--type-prefill and --type-chars fill the composer and then type filler
text one key at a time, so it grows line by line. On main each growth
changes the composer's mobile dropdown variables on <html>; the #29596
numbers for that case come from these flags.
mafredri added a commit that referenced this pull request Oct 30, 2026
…at caused them

wrap-summary.mjs recomputes the #29596 wrapping table from results.json:
the slowest keystroke before each growth, the other keystrokes' p50 and
the <html> style mutation records, all within the typing window.
@mafredri
mafredri force-pushed the perf/chat-interaction branch from 4302e8a to 931f7d7 Compare October 30, 2026 18:37
mafredri added a commit that referenced this pull request Oct 30, 2026
--type-prefill and --type-chars fill the composer and then type filler
text one key at a time, so it grows line by line. On main each growth
changes the composer's mobile dropdown variables on <html>; the #29596
numbers for that case come from these flags.
mafredri added a commit that referenced this pull request Oct 30, 2026
…at caused them

wrap-summary.mjs recomputes the #29596 wrapping table from results.json:
the slowest keystroke before each growth, the other keystrokes' p50 and
the <html> style mutation records, all within the typing window.
@mafredri
mafredri force-pushed the perf/chat-interaction branch from 931f7d7 to 1a186e9 Compare November 4, 2026 11:00
mafredri added a commit that referenced this pull request Nov 4, 2026
--type-prefill and --type-chars fill the composer and then type filler
text one key at a time, so it grows line by line. On main each growth
changes the composer's mobile dropdown variables on <html>; the #29596
numbers for that case come from these flags.
mafredri added a commit that referenced this pull request Nov 4, 2026
…at caused them

wrap-summary.mjs recomputes the #29596 wrapping table from results.json:
the slowest keystroke before each growth, the other keystrokes' p50 and
the <html> style mutation records, all within the typing window.
@mafredri
mafredri force-pushed the perf/chat-interaction branch from 1a186e9 to c39457b Compare November 6, 2026 19:44
@github-actions github-actions Bot added the stale This issue is like stale bread. label Nov 14, 2026
@github-actions github-actions Bot removed the stale This issue is like stale bread. label Nov 16, 2026
AgentChatInput wrote the --mobile-dropdown-* custom properties on <html>
on every focus and keystroke at every viewport width, and a custom
property change on the root restyles every element. Only the below-md
dropdown utilities read them, so write them only below md, and only when
the value on <html> differs.
…check

Chromium, WebKit and Firefox already skip a setProperty that sets the
value an element's style holds: on a 60k-element page it queued no
mutation record and took 0 ms, against 25 to 141 ms for a changed
value. The check and its test covered behavior the browser provides.
… one helper

The below-md stub was a copy of stubViewport with another query and one
caller, and stubViewport already takes the query, so the caller uses it.
…the root variable test

The test relied on the matchMedia stub in site/test/setup/polyfills.ts,
which matches no query, and its comment credited jsdom with it. It now
stubs the below-md query to false, as the below-md test stubs it to
true.
@mafredri
mafredri force-pushed the perf/chat-interaction branch from c39457b to 841242b Compare November 18, 2026 13:50
mafredri added a commit that referenced this pull request Nov 18, 2026
--type-prefill and --type-chars fill the composer and then type filler
text one key at a time, so it grows line by line. On main each growth
changes the composer's mobile dropdown variables on <html>; the #29596
numbers for that case come from these flags.
mafredri added a commit that referenced this pull request Nov 18, 2026
…at caused them

wrap-summary.mjs recomputes the #29596 wrapping table from results.json:
the slowest keystroke before each growth, the other keystrokes' p50 and
the <html> style mutation records, all within the typing window.

This branch was previously deployed

1 inactive deployment
main — 841242b7 Deployed Nov 18, 2026 by mafredri via cla #259496
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