Skip to content

♻️ Refactor: delete unused code & improve component render action#2698

Merged
WMC001 merged 8 commits intodevelopfrom
xyq/refactor_conversation_lags
Mar 27, 2026
Merged

♻️ Refactor: delete unused code & improve component render action#2698
WMC001 merged 8 commits intodevelopfrom
xyq/refactor_conversation_lags

Conversation

@xuyaqist
Copy link
Copy Markdown
Contributor

@xuyaqist xuyaqist commented Mar 16, 2026

  1. 删除了无用的chatTopNavbar组件(已移动至全局navigation文件夹下)
  2. 部分tsx文件仅为纯工具函数,将其提取至/lib目录下
  3. 提取公共的css文件
  4. 使用memo缓存数据,提高性能

…<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
Copilot AI review requested due to automatic review settings March 16, 2026 06:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 into frontend/styles/chat.css and loads them on the chat route.
  • Refactors chat streaming message processing to use useMemo and consolidates scroll effects.
  • Moves SearchResultItem to module scope in the right panel, and removes an unused ChatTopNavContent implementation 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.

@xuyaqist xuyaqist changed the title Refactor: delete unused code & improve component render action ♻️ Refactor: delete unused code & improve component render action Mar 16, 2026
xuyaqist and others added 2 commits March 18, 2026 10:22
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@WMC001 WMC001 merged commit 7f839f3 into develop Mar 27, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants