Skip to content

perf(app): smoother panel, list and dialog motion - #142

Merged
httpsphl merged 3 commits into
mainfrom
perf/compositor-motion
Oct 4, 2026
Merged

httpsphl merged 3 commits into
mainfrom
perf/compositor-motion

Conversation

@httpsphl

@httpsphl httpsphl commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Why

On a 180 Hz screen, hiding the bots list and opening or closing a side panel did not look smooth. Both animated width, so the whole chat was laid out on every frame. Measured in the WebView2 with a long chat: 4-7 ms of main-thread work a frame (the budget at 180 Hz is 5.5 ms), frames arriving 4-10 ms apart, and 85-115 fps during the slide. WebView2 itself runs at 179 fps, so the limit was ours.

What

  • Panels and the bots list slide with transform. The room changes at once (one layout), and the list or panel slides over the chat. Same chat: 178-180 fps, about 1.8 ms a frame.
  • A panel slides open in dev too. React's strict mode mounted each panel twice, and the second mount took the first as "the panel being replaced", starting from its own width, so it did not slide. Production was not affected.
  • Dialogs fade out. They popped in but vanished at once. Dialog now leaves a still copy of itself that fades and shrinks a little in 150 ms, however it was closed (X, Escape, Cancel, Save). No dialog had to change.

Spec 15.1 and 15.3 are updated: the chat now takes its new width at once instead of narrowing with the panel.

Testing

  • pnpm check: 333 tests pass. New tests cover the dialog's exit copy (and none in strict mode) and a panel in strict mode still sliding from the edge.
  • Measured in the dev app over the WebView2 debug port: frame times during the list and panel slides, the panel's transform during opening, and the dialog copy's opacity while closing.

Manual check in the real app: open a bot with a long chat, press Ctrl+B a few times, open and close Details, Files and the browser panel, and open and close Settings, Usage and Edit bot.

Both animated their width, so the chat was laid out again on every
frame. With a long chat that took 4-7 ms a frame, over the 5.5 ms a
180 Hz screen gives, and frames came unevenly. Now the room changes at
once and only a transform moves: the list and the panels slide over the
chat, at 180 fps and about 1.8 ms a frame on the same chat.

Spec 15.1 said the chat narrowed along with the panel; it now says the
chat takes its new width at once.
React's strict mode mounts a panel twice in dev. The first mount left
its own width as "the panel being replaced", so the second started from
that width and did not slide. A panel no longer counts as replacing
itself.
A dialog popped in but vanished at once, since its owner unmounts it.
It now leaves a still copy of itself that fades and shrinks a little in
150 ms, whatever closed it (X, Escape, Cancel, Save), with what was
typed still in its fields. Nothing changes for the dialogs that use it.
@httpsphl
httpsphl enabled auto-merge October 4, 2026 01:34
@httpsphl
httpsphl merged commit f1121fa into main Oct 4, 2026
4 checks passed
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.

1 participant