⬆️(frontend) update widget logic to latest version#649
Conversation
The new widget loader consume `window._lasuite_widget` property to know which widget to load. The previous version was using `window._stmsg_header`. /!\ Update NEXT_PUBLIC_LAGAUFRE_WIDGET_PATH and NEXT_PUBLIC_FEEDBACK_WIDGET_PATH to target the new widget version before deploying this commit.
📝 WalkthroughWalkthroughThree feedback and widget components are being updated to reference a different global queue on the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/frontend/src/features/ui/components/feedback-widget/index.tsx (1)
31-63: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winConfirm rollout sequencing for the new widget queue name.
This now writes only to
window._lasuite_widget; ifNEXT_PUBLIC_FEEDBACK_WIDGET_PATHstill serves the older bundle, these init payloads will be dropped and the widget will stop bootstrapping. Please verify the new bundle is deployed atomically with this rename, or keep a temporary compatibility alias during rollout.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/frontend/src/features/ui/components/feedback-widget/index.tsx` around lines 31 - 63, The PR currently only writes init payloads to window._lasuite_widget which can break bootstrapping if the deployed bundle still expects the legacy global; update the widget initialization in index.tsx so it maintains a compatibility alias: ensure both the new global (window._lasuite_widget) and the legacy global (check for the previous global name and/or create one) reference the same array or receive the same push, then push the same payload (using loaderScript, feedbackScript, widget, params, etc.) to both globals so older bundles still receive init events during rollout.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/frontend/src/features/ui/components/feedback-widget/index.tsx`:
- Around line 31-63: The PR currently only writes init payloads to
window._lasuite_widget which can break bootstrapping if the deployed bundle
still expects the legacy global; update the widget initialization in index.tsx
so it maintains a compatibility alias: ensure both the new global
(window._lasuite_widget) and the legacy global (check for the previous global
name and/or create one) reference the same array or receive the same push, then
push the same payload (using loaderScript, feedbackScript, widget, params, etc.)
to both globals so older bundles still receive init events during rollout.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 17b2123a-9c48-49f6-bd57-d8f2d33f1722
📒 Files selected for processing (3)
src/frontend/src/features/ui/components/feedback-button/index.tsxsrc/frontend/src/features/ui/components/feedback-widget/index.tsxsrc/frontend/src/features/ui/components/lagaufre/index.tsx
Purpose
The new widget loader consume
window._lasuite_widgetproperty to know which widget to load. The previous version was usingwindow._stmsg_header./!\ Update NEXT_PUBLIC_LAGAUFRE_WIDGET_PATH and
NEXT_PUBLIC_FEEDBACK_WIDGET_PATH
to target the new widget version before deploying this commit.
Summary by CodeRabbit