-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat: upload documents #25
Conversation
- App reads file structure on startup - App adds sample structure on load - Redesigned FoldersView - Uploaded files are saved to `/uploads` folder - Selectede files in the sidebar show on center - TipTap files show with editor - other files show a placeholder view
src/filesystem.tsx
Outdated
const REF_STUDIO_DIR = '.ref-studio/project-x'; | ||
const UPLOADS_DIR = 'uploads'; |
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.
Should we put these paths into environment variables, so they're easily accessible by the sidecar as well?
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.
I don't think you would need to access these folders directly, but instead you (sidebar) will given the file path(s) to work with. Or insterad the folder containing uploaded files.
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.
I think we should consider using macOS' container folders (~/Library/Containers/
) and then look for a cross-platform implementation of that. I'm sure there is some module that does that 🤔
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.
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.
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.
Maybe now, we can get rid of the .ref-studio
prefix as we are working in the app data folder. Will change this and keep only the project placeholder (i.e. project-x).
src/TipTapEditor/MenuBar.tsx
Outdated
export function MenuBar({ editor }: { editor: Editor }) { | ||
const [counter, setCounter] = React.useState(1); |
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.
If I understand correctly, counter
is only used to force re-render, since you never use its value. Maybe you could create a useForceUpdate
hook that does it, instead of having an unnecessary counter here. This way we could also use the hook in other components.
I also prefer a boolean state toggling between true and false to force re-render, instead of having a counter that could theoretically grow to infinite.
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.
You are right! I forgot this "hack". Not sure about the useForceUpdate
hook. For now will update this to a boolean toggle.
I've had to implement this in order for the menu bar to update when the editor (state) changes.
Sync file-system folder with RefStudio
/uploads
folder