Refactor state management for active tabs and optimize component rendering

- Introduced `activeTabStore` to manage active tab state with fine-grained subscriptions.
- Replaced direct prop passing of `isActive` with hooks (`useIsVaultActive`, `useIsSftpActive`) in components to determine active state.
- Memoized components (e.g., `SftpView`, `VaultView`, `TerminalLayer`, `TopTabs`) to prevent unnecessary re-renders.
- Updated various components to use `useCallback` and `useMemo` for stable references and performance improvements.
- Removed redundant state and props, simplifying the component structure.
- Disabled React.StrictMode in index.tsx for performance testing.
This commit is contained in:
LAPTOP-O016UC3M\Qi Chen
2025-12-08 20:08:52 +08:00
parent 06d4572aa0
commit c29fc418f9
10 changed files with 596 additions and 319 deletions

View File

@@ -9,7 +9,8 @@ if (!rootElement) {
const root = ReactDOM.createRoot(rootElement);
root.render(
<React.StrictMode>
// StrictMode causes double renders in development - disabled for performance testing
// <React.StrictMode>
<App />
</React.StrictMode>
// </React.StrictMode>
);