♻️ Refactor: delete unused code & improve component render action#2698
Merged
♻️ Refactor: delete unused code & improve component render action#2698
Conversation
…<style jsx global> 提取出来,避免多轮对话时重复注入相同的全局样式
…tor, remove ChatTopNavContent replaced elsewhere - Rename extractMsgFromHistoryResponse.tsx -> lib/chatMessageExtractor.ts as pure utility, remove use client directive - Update import path in chatInterface.tsx to @/lib/chatMessageExtractor - Delete ChatTopNavContent.tsx: logo + app name display logic is already implemented elsewhere - Clean up redundant comments Made-with: Cursor
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the chat frontend to reduce per-render work and remove unused/duplicated code, while extracting previously inline TaskWindow/streaming styles into a shared stylesheet.
Changes:
- Extracts TaskWindow/streaming global styles from inline
<style jsx global>blocks intofrontend/styles/chat.cssand loads them on the chat route. - Refactors chat streaming message processing to use
useMemoand consolidates scroll effects. - Moves
SearchResultItemto module scope in the right panel, and removes an unusedChatTopNavContentimplementation in the chat route folder.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/styles/chat.css | New global stylesheet for chat/task window animations and markdown/code/diagram layout fixes. |
| frontend/lib/chatMessageExtractor.ts | Minor cleanup (remove "use client", simplify special tag replacement, comment cleanup). |
| frontend/app/[locale]/chat/streaming/taskWindow.tsx | Removes inline global CSS now provided by chat.css. |
| frontend/app/[locale]/chat/streaming/chatStreamMain.tsx | Uses useMemo for message processing and consolidates auto-scroll behavior. |
| frontend/app/[locale]/chat/page.tsx | Imports the new global chat stylesheet for the chat route. |
| frontend/app/[locale]/chat/internal/chatInterface.tsx | Switches message extraction import to the shared lib module. |
| frontend/app/[locale]/chat/internal/ChatTopNavContent.tsx | Deletes unused chat-local top-nav content component. |
| frontend/app/[locale]/chat/components/chatRightPanel.tsx | Hoists SearchResultItem to module scope and threads t/appConfig as props. |
| frontend/app/[locale]/chat/components/chatLeftSidebar.tsx | Memoizes conversation categorization to avoid recomputation on unrelated state changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
WMC001
approved these changes
Mar 27, 2026
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 free
to 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.
Uh oh!
There was an error while loading. Please reload this page.