chore(docs): remove chat linkage#5959
Conversation
|
WalkthroughThis pull request removes the Chat feature integration from the docs application. It deletes the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/docs/components/docs/components/code-demo/code-demo.tsx (1)
84-161: CompleteuseMemodependency arrays forpreviewContentandeditorContentBoth memo blocks are missing several values they close over, which can lead to stale renders if those props ever change:
previewContentcurrently depends on[displayMode, isGradientBox, gradientColor, previewHeight, hideWindowActions, asIframe, showPreview, isInView, className]but also usesfiles, iframeInitialWidth, iframeSrc, title, resizeEnabled, code, noInline, overflow, renderContent.editorContentcurrently depends on[displayMode, showEditor, isInView, files, highlightedLines, showPreview, showSandpackPreview, showOpenInCodeSandbox]but also usestypescriptStrictandrenderContent.Given the project’s prior care around hook deps, it would be safer and more consistent to include all referenced values, e.g.:
- const previewContent = useMemo(() => { + const previewContent = useMemo(() => { // ... - }, [ - displayMode, - isGradientBox, - gradientColor, - previewHeight, - hideWindowActions, - asIframe, - showPreview, - isInView, - className, - ]); + }, [ + asIframe, + className, + code, + files, + gradientColor, + hideWindowActions, + iframeInitialWidth, + iframeSrc, + isGradientBox, + noInline, + overflow, + previewHeight, + renderContent, + resizeEnabled, + showPreview, + title, + ]); - const editorContent = useMemo(() => { + const editorContent = useMemo(() => { // ... - }, [ - displayMode, - showEditor, - isInView, - files, - highlightedLines, - showPreview, - showSandpackPreview, - showOpenInCodeSandbox, - ]); + }, [ + files, + highlightedLines, + renderContent, + showEditor, + showOpenInCodeSandbox, + showSandpackPreview, + typescriptStrict, + ]);This keeps the behavior correct even if callers start passing dynamic values later, and aligns with the existing emphasis on precise hook dependencies. Based on learnings, …
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
apps/docs/.env.example(0 hunks)apps/docs/actions/open-in-chat.ts(0 hunks)apps/docs/components/docs/components/code-demo/code-demo.tsx(1 hunks)apps/docs/components/heroui-chat-banner.tsx(0 hunks)apps/docs/components/random-banner.tsx(0 hunks)turbo.json(1 hunks)
💤 Files with no reviewable changes (4)
- apps/docs/.env.example
- apps/docs/components/heroui-chat-banner.tsx
- apps/docs/components/random-banner.tsx
- apps/docs/actions/open-in-chat.ts
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2025-10-25T17:08:46.283Z
Learnt from: adbjo
Repo: heroui-inc/heroui PR: 5846
File: packages/components/tabs/src/tabs.tsx:156-157
Timestamp: 2025-10-25T17:08:46.283Z
Learning: In packages/components/tabs/src/tabs.tsx, the renderTabs useMemo dependency array intentionally includes `variant` and `isVertical` to prevent potential side-effects, even though they might appear redundant based on static analysis.
Applied to files:
apps/docs/components/docs/components/code-demo/code-demo.tsx
📚 Learning: 2025-10-25T17:11:59.338Z
Learnt from: adbjo
Repo: heroui-inc/heroui PR: 5846
File: packages/components/tabs/src/tabs.tsx:155-155
Timestamp: 2025-10-25T17:11:59.338Z
Learning: In packages/components/tabs/src/tabs.tsx, the renderTabs useMemo dependency array intentionally includes both `domRef` and `cursorRef` to maintain consistency in how ref objects are handled in dependency arrays, even though ref objects have stable identity across renders.
Applied to files:
apps/docs/components/docs/components/code-demo/code-demo.tsx
📚 Learning: 2025-10-27T21:52:33.324Z
Learnt from: adbjo
Repo: heroui-inc/heroui PR: 5846
File: packages/components/tabs/src/tabs.tsx:115-125
Timestamp: 2025-10-27T21:52:33.324Z
Learning: In packages/components/tabs/src/tabs.tsx, the useEffect dependency array at line 125 intentionally uses `domRef.current` rather than `domRef` because domRef.current can change between renders (when React sets it during the commit phase), whereas domRef itself has stable identity and won't change.
Applied to files:
apps/docs/components/docs/components/code-demo/code-demo.tsx
📚 Learning: 2025-10-27T21:48:35.308Z
Learnt from: adbjo
Repo: heroui-inc/heroui PR: 5846
File: packages/components/tabs/src/tabs.tsx:76-101
Timestamp: 2025-10-27T21:48:35.308Z
Learning: In packages/components/tabs/src/tabs.tsx, the updateCursorPosition useCallback dependency array intentionally includes `cursorRef.current` to handle the case where the cursor span element is unmounted and remounted (e.g., when `disableAnimation` or `disableCursorAnimation` toggles). This ensures the callback is recreated when the ref points to a new element, triggering a dependency chain that re-establishes the ResizeObserver and initializes the new cursor element with the data-initialized attribute.
</learning]
Applied to files:
apps/docs/components/docs/components/code-demo/code-demo.tsx
🔇 Additional comments (2)
turbo.json (1)
4-10: Env cleanup inglobalEnvlooks consistent with chat removalRemoving chat-related variables from
globalEnvwhile keepingPLAIN_USER_AUTHENTICATEDis coherent with the rest of the PR and should not affect unrelated tasks.apps/docs/components/docs/components/code-demo/code-demo.tsx (1)
3-10: Import cleanup is correct and minimalThe React and
@heroui/reactimports now match actual usage (no unused hooks/components from the removed chat feature), which keeps the module lean and avoids tree‑shaking noise.
Closes #
📝 Description
⛳️ Current behavior (updates)
🚀 New behavior
💣 Is this a breaking change (Yes/No):
📝 Additional Information
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.