refactor: optimize component rendering with memoization and improve state management

- Added memoization to ChatHistoryPanel, ChatMessageList, and TaskBoard components to prevent unnecessary re-renders.
- Refactored HomePage to utilize useMemo for derived state calculations, enhancing performance.
- Updated main.tsx to conditionally render React.StrictMode based on the environment.
- Improved chat and channel store hooks to allow for selector functions, enhancing flexibility in state selection.
- Enhanced streaming message handling in chat store to manage pending deltas more effectively.
- Refactored LoginPage to include animated decorations for improved user experience.
- Implemented lazy loading for routes in the router to optimize initial load time.
This commit is contained in:
duanshuwen
2026-04-18 11:05:49 +08:00
parent 85d92b937f
commit dfa4388087
12 changed files with 533 additions and 189 deletions

View File

@@ -9,8 +9,14 @@ if (!container) {
throw new Error('Missing #app container for React entry.');
}
const app = <App />;
ReactDOM.createRoot(container).render(
<React.StrictMode>
<App />
</React.StrictMode>,
import.meta.env.DEV
? app
: (
<React.StrictMode>
{app}
</React.StrictMode>
),
);