-
Notifications
You must be signed in to change notification settings - Fork 453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split screen #471
Split screen #471
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR introduces split-screen functionality and centralizes modal management by implementing react-resizable-panels and refactoring the modal state handling system.
- Added ResizablePanelGroup in
MainPage.tsx
with configurable panel sizes and handles for flexible split-screen layout - Centralized modal management by moving NewDirectoryComponent to
CommonModals.tsx
and implementing ModalContext - Replaced custom event dispatch with direct state management through useModalOpeners hook in shortcuts
- Simplified IconsSidebar by removing local modal state in favor of the new centralized modal system
- Added proper memoization and dependency management in ModalContext to prevent unnecessary re-renders
7 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile
|
||
const { noteToBeRenamed, fileDirToBeRenamed } = useFileContext() | ||
|
||
return ( | ||
<div> | ||
<NewDirectoryComponent isOpen={isNewDirectoryModalOpen} onClose={() => setIsNewDirectoryModalOpen(false)} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Consider wrapping NewDirectoryComponent in a conditional render like the other modals to prevent unnecessary mounting when closed
src/components/MainPage.tsx
Outdated
</div> | ||
) | ||
} | ||
|
||
const MainPageContent: React.FC = () => { | ||
const [showSimilarFiles, setShowSimilarFiles] = useState(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: showSimilarFiles state is maintained but SimilarFilesSidebar component was removed - this state and related props can be removed
src/components/MainPage.tsx
Outdated
<ResizableHandle /> | ||
|
||
<ResizablePanel defaultSize={showChatbot ? 50 : 80}> | ||
{(!showChatbot || currentlyOpenFilePath) && <MainContent />} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Condition may hide MainContent unexpectedly when both showChatbot is true and currentlyOpenFilePath is false
No description provided.