Skip to content

feat: implement app preferences and window listeners hooks#139

Merged
ldm0 merged 3 commits intomasterfrom
split_component
Feb 16, 2026
Merged

feat: implement app preferences and window listeners hooks#139
ldm0 merged 3 commits intomasterfrom
split_component

Conversation

@ldm0
Copy link
Collaborator

@ldm0 ldm0 commented Feb 15, 2026

feat: add hotkeys management for file navigation and quick look
refactor: streamline App component by splitting into hooks

feat: add hotkeys management for file navigation and quick look
refactor: streamline App component by splitting into hooks
Copy link

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

This PR refactors the App component by extracting logic into four custom hooks, improving code organization, maintainability, and testability. The refactoring preserves all existing functionality while making the codebase more modular.

Changes:

  • Created useFilesTabState, useAppWindowListeners, useAppPreferences, and useAppHotkeys hooks to encapsulate related concerns
  • Reduced App.tsx from 514 lines to ~400 lines by moving logic into specialized hooks
  • Added comprehensive unit tests for all new hooks with good coverage

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
cardinal/src/hooks/useFilesTabState.ts Manages active tab and search focus state with callbacks
cardinal/src/hooks/useAppWindowListeners.ts Handles window focus/blur events, Tauri event listeners (status updates, lifecycle, quick launch), and drag-drop functionality
cardinal/src/hooks/useAppPreferences.ts Manages preferences state, watch configuration, tray icon settings, and theme/language reset
cardinal/src/hooks/useAppHotkeys.ts Handles keyboard shortcuts (Meta+F/R/O/C, arrow keys, space for Quick Look) and Quick Look native events
cardinal/src/hooks/tests/useFilesTabState.test.ts Tests tab switching and search focus state management
cardinal/src/hooks/tests/useAppWindowListeners.test.ts Tests event listeners, drag-drop routing, and window focus synchronization
cardinal/src/hooks/tests/useAppPreferences.test.ts Tests preferences lifecycle, watch config updates, and reset functionality
cardinal/src/hooks/tests/useAppHotkeys.test.ts Tests keyboard shortcuts and Quick Look event handling
cardinal/src/App.tsx Refactored to use new hooks, removed ~200 lines of code, improved readability with better separation of concerns

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

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

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

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

Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ldm0 ldm0 merged commit 22a6747 into master Feb 16, 2026
15 checks passed
@ldm0 ldm0 deleted the split_component branch February 16, 2026 07:12
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.

1 participant

Comments