feat: IDE layout#62
Conversation
- Adds react-icons dependency
- views -> panels
Will open a new PR
@hammer fixed this and improved (I think 😅) the UX of this component.
|
Created a ticket for this feature #68 |
danvk
left a comment
There was a problem hiding this comment.
Left a bunch of comments. I really like the VS Code look!
I think there are a few high level things that we should hash out:
- We should pick a system for doing async calls in React before our application gets too big. React has
<Suspense>built in but there are also many other tools out there like react-query. Basically, calling anasyncfunction in auseEffectis extremely error-prone and something that should be avoided. - The way we're using Jotai in this PR feels like it's mostly acting as a wrapper around how you'd do everything with Redux. I think we'll get more value from Jotai if we have several atoms rather than just one big one.
| return { | ||
| ...state, | ||
| panes: { | ||
| ...state.panes, |
There was a problem hiding this comment.
There is a Jotai Immer integration which could cut down on all this object spreading: https://jotai.org/docs/integrations/immer
There was a problem hiding this comment.
Will try that integration. Was trying to keep the code as clean of external dependencies as possible. But I understand that this type of code is harder to maintain and read.
|
Here's what it might look like to roll our own hook to safely wrap Promises (there's a little bit of diff noise due to the capital/lowercase C thing): 35aab1b
|
if Redux patterns are more comfortable to the team perhaps we should use Zustand? |
@danvk were are you testing? I'm in OSX with safari (Tauri's browser). |
We would keep Jotai for this PR so that we can merge and move forward with the project. |
|
@sehyod can you review this again. |








This PR closes #1, and closes #44, by adding the following features:
Implementation details
App state - using Jotai
openFilesAtom- The main (read-write) state for the open files (overall and per pane)leftPaneAtom- Read-only atom with the left pane files (and active file)rightPaneAtom- Read-only atom with the right pane files (and active file)openFileInPaneAtom- that will open a file in a given tabactivateFileInPaneAtom- that will activate a file open in a tab (selected in the explorer or in the tabs)closeFileInPaneAtom- that will close a file in a tabsplitFileToPaneAtom- that will move a file between two tabs (UI via explorer -> open files)react-iconslibrary with vs code iconsUpdated terminology: view -> panel
AppExplorerPanel- contains the open files and project treeReferencesPanel- contains the uploaded referencesAIPanel- contains the AI interactionsCenterPanel- contains the split view (LEFT, RIGHT) with two tabled areas with file-rendered-view componentsView components (used by the
CenterPanel- component that renders in the central area with open filesEmptyView- view (splash screen) for when no file is selectedTextView- generic view that displays text content (used for .xml and .json files)PdfViewer- PDF presenter (for.pdffiles)TipTapView- the TipTap editor (used for any other file not listed above)Reusable UI components (
/components)PanelSection- This is a panel section with a title and a collapsible, and scrollable, contentPanelWrapper- This is a side panel with multiplePanelSectioncomponents, and a titleTabPane- This is a x-scrollable list of tabs with an x (close) icon/action. Used for the open files tab.PrimarySideBar- Not actually reusable (maybe will be used for the right side also) but a UI componentIDE Panels
Left
Explorer
References
Right