Uh oh!
There was an error while loading. Please reload this page.
chore(lint): clear baseline lint errors in plugin-chatbot (#2713 Wave 3.3) - #2741
Merged
Conversation
…713 Wave 3) - useObjectChat (8 rules-of-hooks): the hook called different useCallbacks in each isApiMode return branch (both sets conditional). useChat is already unconditional; destructure its result + hoist all 8 callbacks above the branch so hook order is stable. Callback bodies unchanged (API `messages` -> apiMessages). - FloatingChatbotTrigger (rules-of-hooks): unwrap try/catch around provider-safe useObjectTranslation (#2709 fix) - shimmer (static-components): motion.create(Component) must key off the `as` prop; memoized per Component + justified scoped disable at the render Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wave 3 of the #2713 lint-gate restoration.
@object-ui/plugin-chatbotwas red at baseline onmain. Errors only; no behavior change.useObjectChat, a core AI-chat hook with delicate send / reconcile / handoff flows. I'd like a closer look before merge even though CI is green.What changed
useObjectChat— 8×react-hooks/rules-of-hooks— the hook called differentuseCallbacks in each of its twoisApiModereturn branches, so both sets were conditional. That's a real bug: React throws "rendered more/fewer hooks" ifisApiModeever toggles between renders.useChatis already called unconditionally (the team's comment says so). This change:chatResultunconditionally (it's always defined), andisApiModebranch,so the same hooks run in the same order every render. Only the returned object differs by mode — every callback body is byte-identical, just de-indented; the API-mode
messageslocal is renamedapiMessagesto avoid shadowing. (See the diff: theuseObjectChat.tshunk is a pure move/de-indent/rename.)FloatingChatbotTrigger(rules-of-hooks) —useChatbotLabelwrapped the provider-safeuseObjectTranslationin try/catch → removed (the feat(fields): select+multiple → multi-value chip picker; restore fields/core lint gates #2709 fix).shimmer(static-components) —motion.create(Component)genuinely builds a motion component and must key off theasprop, so it can't be module-scoped. Memoized perComponent(stable ref → no per-render remount) with a justified scoped disable at the render site.No lint config was loosened.
Verification
eslint→ 0 errors (10 at baseline).turbo run build→ 9/9 tasks green (confirms the hoisted destructure + renames type-check).useObjectChat:plugin-chatbotfull suite: 218 passed / 14 files, incl. the delicateuseObjectChat.sendFailure,useObjectChat.handoffContext,ChatbotEnhanced.sendError,withTurnId,withHandoffContext.ChatDock/ConsoleChatbotFab/chatDockReturnLocation/useDeferredFirstSend→ 23 passed / 4 files.Refs #2713 · follows #2730, #2737, #2738, #2740 · pattern from #2709
🤖 Generated with Claude Code