mirror of
https://github.com/lobehub/lobehub.git
synced 2026-03-26 13:19:34 +07:00
* ✨ feat: add electron page tabs functionality Implement browser-style page tabs in the Electron titlebar: - Add TabBar component with explicit tab creation via context menu (desktop only) - Tab creation triggers: TopicItem/PageItem context menu "Open in New Tab" or double-click - TabBar only visible when tab count >= 2 - Update active tab's reference when navigating within it (tab follows user navigation) - Reuse existing plugin system (pluginRegistry, 11 page plugins, PageReference types) - Persist tabs to localStorage with automatic recovery on restart - Apply logic to TopicItem (agent & group) and PageItem Changes: - src/store/electron/actions/tabPages.ts: New store slice with tab state + actions - src/features/Electron/titlebar/TabBar/: New UI component + storage + hooks - src/features/Electron/navigation/: New useTabNavigation hook + extracted cachedData helper - src/app/.../Topic/List/Item/: Double-click creates tab, context menu "Open in New Tab" - src/app/.../page/.../Item/: Double-click creates tab, context menu "Open in New Tab" - i18n: New keys in topic.ts and file.ts namespaces * ✨ feat: enhance agent topic plugin and tab resolution logic - Added a new line to ensure the cached title is included when resolving tabs in the useResolvedTabs hook. - Minor adjustment in the agentTopicPlugin to improve code clarity. These changes improve the handling of cached titles in the tab resolution process and enhance the overall functionality of the agent topic plugin. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat: enhance agent and conversation handling in PageEditor - Refactored PageAgentProvider to eliminate direct pageAgentId prop, improving context management. - Updated Conversation and Copilot components to utilize conversation state for agent selection, ensuring better handling of chat-group session IDs. - Adjusted FileCopilot to synchronize active agent ID with conversation context, enhancing file interaction capabilities. These changes streamline agent management and improve the overall user experience in the PageEditor feature. Signed-off-by: Innei <tukon479@gmail.com> * 🔧 chore: update ESLint suppressions for chat service [skip ci] - Removed the suppression for `object-shorthand` in `src/services/chat/index.ts` to improve code quality. - Adjusted the ESLint suppressions in `eslint-suppressions.json` for better linting consistency. These changes enhance the linting process by ensuring adherence to coding standards in the chat service files. Signed-off-by: Innei <tukon479@gmail.com> * 🔧 chore: optimize NavigationBar panel width handling * ✨ feat: add tab context menu with close actions Add right-click context menu on tab items: - Close current tab - Close other tabs - Close tabs to the left (disabled on first tab) - Close tabs to the right (disabled on last tab) * 🐛 fix: defer single-click navigation on desktop to prevent double-click addTab race * ✨ feat: implement onActivate method for RecentlyViewed plugins to manage store state transitions - Added onActivate method to RecentlyViewedPlugin interface for handling tab activations. - Updated agentPlugin and agentTopicPlugin to switch topics based on tab activation. - Enhanced PluginRegistry to notify plugins on tab activation. - Modified TabBar to trigger onActivate when a tab is activated. - Improved AgentIdSync to preserve topic state during agent switches. Signed-off-by: Innei <tukon479@gmail.com> * refactor: update test for BackendProxyProtocolManager to throw on upstream fetch failure - Changed test description to reflect behavior change from returning a 502 status to throwing an error. - Updated test implementation to use expect().rejects.toThrow for handling fetch errors. Signed-off-by: Innei <tukon479@gmail.com> * refactor: use optional chaining for agent configuration properties - Updated agent configuration properties to use optional chaining for safer access. - This change prevents potential runtime errors when properties are undefined. Signed-off-by: Innei <tukon479@gmail.com> * refactor: optimize navigation handling in TabBar with startTransition - Introduced startTransition for navigation updates to improve performance and user experience. - Updated handleActivate, handleCloseOthers, handleCloseLeft, and handleCloseRight methods to use startTransition for routing. - Enhanced code readability by grouping navigation logic within startTransition. Signed-off-by: Innei <tukon479@gmail.com> --------- Signed-off-by: Innei <tukon479@gmail.com>