Skip to content

fix: keep host interactions responsive in large apps - #49

Merged
stackloomdev merged 1 commit into
mainfrom
codex/fix-large-app-click-performance
Jul 27, 2026
Merged

stackloomdev merged 1 commit into
mainfrom
codex/fix-large-app-click-performance

Conversation

@stackloomdev

Copy link
Copy Markdown
Owner

Summary

  • resolve event-handler expressions from the runtime metadata index instead of running a full element/Fiber inspection for every captured pointer, focus, mouse, and click event
  • subscribe to runtime refreshes only while the drawer is open, coalesce bursts to one animation frame, and clear the selection on close
  • hide props whose current value is unavailable while preserving their typed undefined representation in exports and sensitive-value handling
  • release the fix as 1.0.0-beta.6

Real-app performance

Measured on the same large Vite/React page:

  • ordinary menu click after closing CauseScope: ~3908 ms on beta.5 → 278–295 ms across six beta.6 runs (281 ms median)
  • inspected-element selection: ~1268 ms → 285 ms
  • Values panel: 0 rendered undefined strings; 76 available props shown and 5 unavailable props summarized

Validation

  • pnpm check
  • pnpm test:e2e:firefox
  • runtime-core: 39/39
  • React 19 E2E: 9/9
  • React 18 E2E: 1/1
  • React SWC E2E: 1/1
  • Firefox E2E: 3/3
  • package verification across Vite 5.4, 6.4, 7.3, and 8.1
  • production-absence, performance, public API, release metadata, links, trace contract, and StackBlitz gates
  • independent final review: no findings

Closes #48

@stackloomdev
stackloomdev merged commit a97f628 into main Jul 27, 2026
11 checks passed
@stackloomdev
stackloomdev deleted the codex/fix-large-app-click-performance branch July 27, 2026 05:49

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ec3f34a9e7

ℹ️ 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".

if (selectedElement.current) setInspection(runtime.inspectElement(selectedElement.current));
}), [runtime]);
useEffect(() => {
if (!drawerOpen) return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Capture the event that opens the drawer

When a selection opens a previously closed drawer, inspect() creates the inspection snapshot and then calls recordEvent, but this effect returns while drawerOpen is false and cannot subscribe until the next render. Since recordEvent notifies synchronously, that notification is lost, so immediately opening Timeline or exporting the trace omits the newly recorded inspect ... event until an unrelated runtime update refreshes the snapshot. Refresh after recording the event or subscribe early enough to capture it.

AGENTS.md reference: AGENTS.md:L9-L9

Useful? React with 👍 / 👎.

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.

Ordinary clicks trigger repeated full inspections in large React apps

1 participant