Commit Graph

38 Commits

Author SHA1 Message Date
MyPrototypeWhat 48670ff0c8 Perf/optimize rendering (#3923)
* optimize useMessageOperations

* chore: update dependencies and refactor React imports

- Added @ant-design/v5-patch-for-react-19 and rc-virtual-list to package.json.
- Updated React and ReactDOM types to version 19 in package.json and yarn.lock.
- Refactored ReactDOM usage to createRoot in main.tsx for better compatibility with React 18+.
- Changed useContext to use in SyntaxHighlighterProvider and ThemeProvider components.
- Adjusted flex-direction in Messages components to column for improved layout.
- Removed unused state in CodeBlock component.

* refactor(Messages): enhance scrolling behavior and introduce scroll utilities

- Added createScrollHandler and scrollToBottom utilities for improved scroll management.
- Updated Messages component to utilize new scroll utilities for better user experience.
- Refactored scroll handling logic to ensure smooth scrolling when new messages are added.
- Changed containerRef type to HTMLElement for better type safety.

* refactor(Messages): streamline message handling and introduce useTopicMessages hook

- Removed direct message selection from useMessageOperations and created a new useTopicMessages hook for better separation of concerns.
- Updated Messages component to utilize the new useTopicMessages hook for fetching messages.
- Enhanced message display logic with computeDisplayMessages function for improved message rendering.
- Refactored scrolling behavior to maintain a smooth user experience during message updates.

* refactor(Message Operations): introduce useTopicLoading hook for improved loading state management

- Removed loading state from useMessageOperations and created a new useTopicLoading hook for better separation of concerns.
- Updated components to utilize the new useTopicLoading hook for fetching loading states related to topics.
- Enhanced code organization and readability by streamlining message operations and loading state handling.

* refactor(Messages): replace updateMessage with updateMessageThunk for improved async handling

- Updated useMessageOperations and MessageAnchorLine components to utilize updateMessageThunk for message updates.
- Enhanced error handling and database synchronization in the new thunk implementation.
- Streamlined message update logic to improve code clarity and maintainability.

* refactor(SyntaxHighlighterProvider, MessageTools, AddMcpServerPopup): update styles and improve type safety

- Changed import statements to use TypeScript's type imports for better clarity and type safety.
- Updated MessageTools and AddMcpServerPopup components to replace bodyStyle with styles prop for consistent styling approach.
- Enhanced overall code organization and maintainability by adhering to TypeScript best practices.

* refactor(Messages): update layout and remove unnecessary prop

- Removed the hasChildren prop from the Messages component for cleaner code.
- Adjusted flex-direction in the mini chat Messages component to column-reverse for improved layout consistency.

* refactor: enhance type safety and component return types

- Updated functional components to return React.ReactElement instead of JSX.Element for better type consistency.
- Changed import statements to use TypeScript's type imports for improved clarity.
- Initialized useRef hooks with null for better type safety in various components.
- Adjusted props types to use HTMLAttributes for more accurate type definitions.

* chore: update package dependencies

- Removed outdated dependencies: @agentic/exa, @agentic/searxng, @agentic/tavily, and rc-virtual-list.
- Added back @ant-design/v5-patch-for-react-19 and rc-virtual-list with specified versions for improved compatibility.

* fix(useMessageOperations): ensure message retrieval from store when updating content
2025-03-27 12:06:47 +08:00
hobee 7ebc257ef9 feat(主题): 添加settingTheme字段以增强主题切换功能
在ThemeProvider中添加settingTheme字段,用于在Sidebar组件中显示当前主题状态。这样用户可以更直观地了解当前主题设置
2025-03-25 08:50:03 +08:00
kangfenmao dd1b538687 fix: i18n and lint 2025-03-22 22:31:43 +08:00
fullex 91517d59d5 fix: miniWindow not sync with theme change (#3643)
* fix: miniWindow not sync theme change

* fix: mac: miniWindow theme display incorrect

* fix: mac: miniWindow display error when system dark+ app light
2025-03-21 13:11:21 +08:00
kangfenmao 32c02803fd refactor: Extract StyleSheetManager into a separate context component
- Move StyleSheetManager logic from App.tsx to a new dedicated context component
- Simplify App.tsx by importing the new StyleSheetManager
- Preserve existing prop validation and filtering logic
2025-03-02 19:51:20 +08:00
kangfenmao 544528a320 refactor: Simplify Segmented component styling
- Remove custom Segmented styling from AntdProvider
- Update HomeTabs Segmented component with refined styles
- Consolidate Segmented styling in a single location
- Improve visual consistency with rounded corners and transparent background
2025-02-28 23:25:36 +08:00
ZhuangYumin 3c12b0d1a3 feat: let quick assistant follow theme setting 2025-02-28 13:14:45 +08:00
kangfenmao 54b7bfd663 fix: Improve null handling in code block and syntax highlighting 2025-02-20 12:04:29 +08:00
shniubobo b846b809f2 fix: Remove trailing newline in codeblocks 2025-02-14 10:10:30 +08:00
kangfenmao f4ac3bd2a8 feat: support for vba code mode #949
close #949
2025-02-04 13:22:41 +08:00
kangfenmao 13ea20083d chore(version): 0.9.11 2025-01-19 20:50:33 +08:00
kangfenmao 0f3c7aa648 feat: add mini window 2025-01-19 13:59:32 +08:00
kangfenmao ccd3becc87 style: adjusted padding and container gap styles 2025-01-08 11:06:51 +08:00
kangfenmao 308bafe29e feat: added optional chaining for code variable 2025-01-06 14:54:04 +08:00
littel_penguin66 b706892d7a Add Japanese localization for i18n (#533) 2024-12-25 22:04:29 +08:00
kangfenmao 7cb381be40 feat: knowledge base 2024-12-19 09:24:20 +08:00
kangfenmao 55d0792161 fix: escaped special characters in code snippets #419 2024-12-09 09:50:15 +08:00
kangfenmao e507afa311 fix: plain text render 2024-12-05 22:33:21 +08:00
kangfenmao 62fa366205 style: update code block padding and topic position 2024-11-30 12:01:00 +08:00
kangfenmao d377376bae feat: add border to list item 2024-11-24 01:35:41 +08:00
kangfenmao fe02baf2bd style: removed dark theme styles, updated search and ui 2024-11-20 19:14:09 +08:00
kangfenmao 8e2e3aab84 chore(version): 0.8.16 2024-11-20 18:50:27 +08:00
kangfenmao a827da19f0 style: update styles for improved visual consistency and layout 2024-11-20 16:37:52 +08:00
kangfenmao 0d28e6805c feat: add search popup 2024-11-19 14:17:38 +08:00
injurka ab37ec05c9 feat: russia locale 2024-11-13 08:21:13 +08:00
kangfenmao 234751c538 feat: add mermaid preview and download feature 2024-11-10 17:09:18 +08:00
kangfenmao c127790fd7 fix: removed theme dependency in syntaxhighlighterprovider, added mermaid delay 2024-11-09 15:02:38 +08:00
kangfenmao 4af84d7b84 feat: add mermaid library and theme initialization 2024-11-09 14:51:39 +08:00
kangfenmao 47f906a974 fix: mermaid图渲染有问题 #310 2024-11-09 14:16:42 +08:00
kangfenmao 8b2e5f1676 style: improved syntax highlighting functionality and code loading 2024-11-09 10:05:34 +08:00
kangfenmao 1577a0ad7b fix: code style init value 2024-11-08 11:59:32 +08:00
injurka db45f12daf fix: expand code syntax highlighting options (#307)
* added locale for context-menu

* fix: expand code syntax highlighting options

* fix: type for theme

---------

Co-authored-by: injurka <ikornilov.ext@prosebya.ru~>
2024-11-08 11:59:05 +08:00
kangfenmao ba16e6a84d chore(version): 0.7.12 2024-10-06 10:12:46 +08:00
kangfenmao 0abcaabdfe feat: add assistant setting popup 2024-09-29 22:31:07 +08:00
kangfenmao ef172e4446 feat: use rounded corner design 2024-09-24 23:59:38 +08:00
kangfenmao f26ebf44c7 feat: add new add topic button 2024-09-20 15:11:50 +08:00
kangfenmao 62973d8fd2 refactor: use sequelize replace better-sqlite3 2024-09-13 13:26:22 +08:00
kangfenmao af2186e629 refactor: provider sdk 2024-09-03 19:00:24 +08:00