Skip to content

perf(web): load Zendesk on support intent - #41653

Merged
lyzno1 merged 2 commits into
mainfrom
codex/snp-742-lazy-load-zendesk
Sep 2, 2026
Merged

perf(web): load Zendesk on support intent#41653
lyzno1 merged 2 commits into
mainfrom
codex/snp-742-lazy-load-zendesk

Conversation

@lyzno1

@lyzno1 lyzno1 commented Sep 2, 2026

Copy link
Copy Markdown
Member

Summary

  • keep the Common Layout server gate for Cloud edition, widget configuration, and CSP nonce
  • load the Zendesk SDK only after the existing Contact Us action
  • preserve single-flight loading, timeout and retry handling, and queued conversation-field synchronization
  • settle an interrupted load when its Console owner unmounts while preserving React Strict Mode replay
  • remove the obsolete utils.ts forwarding layer so consumers use the runtime owner directly

Measured impact

With cache disabled on an authenticated localhost:3000 session:

  • Home and Apps loaded with 0 Zendesk requests and no Zendesk script or iframe
  • the first Contact Us action opened the widget and loaded 36 Zendesk requests totaling 628,440 B, including 613,377 B of JavaScript
  • closing and reopening the widget added 0 Zendesk requests and kept a single script and widget instance

This moves approximately 0.63 MB of third-party network and JavaScript work out of the Console startup path. The cost is deferred to the first support intent, not removed for users who open Contact Us.

Validation

  • vp test run --project unit app/components/base/zendesk/__tests__/runtime.spec.ts app/components/base/zendesk/__tests__/script.spec.tsx app/components/base/zendesk/__tests__/index.spec.tsx app/components/main-nav/components/__tests__/support-menu.spec.tsx context/__tests__/console-bootstrap.spec.tsx (37 tests)
  • focused vp check for the updated Zendesk script and regression spec
  • browser-verified Home and Apps cold loads, first widget open, close, and reopen on localhost:3000 with a configured widget key

Screenshots

Not applicable. The support menu UI and Contact Us behavior are unchanged.

Fixes SNP-742

From Codex

@github-actions github-actions Bot added the web This relates to changes on the web. label Sep 2, 2026
@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.79832% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.93%. Comparing base (bda60a3) to head (6d541d3).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
web/app/components/base/zendesk/runtime.ts 92.64% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #41653      +/-   ##
==========================================
- Coverage   86.93%   86.93%   -0.01%     
==========================================
  Files        5309     5314       +5     
  Lines      306039   306232     +193     
  Branches    61329    61363      +34     
==========================================
+ Hits       266061   266217     +156     
- Misses      34691    34728      +37     
  Partials     5287     5287              
Flag Coverage Δ
dify-ui 93.75% <ø> (ø)
web 87.06% <95.79%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lyzno1
lyzno1 enabled auto-merge September 2, 2026 10:31
@lyzno1
lyzno1 added this pull request to the merge queue Sep 2, 2026
Merged via the queue into main with commit bc71602 Sep 2, 2026
52 checks passed
@lyzno1
lyzno1 deleted the codex/snp-742-lazy-load-zendesk branch September 2, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants