-
Notifications
You must be signed in to change notification settings - Fork 310
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: source editor that supports multiple files #759
base: better-playground
Are you sure you want to change the base?
feat: source editor that supports multiple files #759
Conversation
@nmn Hey Naman! I'm still working through the functionality for this feature, but I'm having some trouble getting the styling correct. I've added 'overflow: auto,' to the container component, but the result is above. Without that, the header causes the remainder of the text to overflow slightly and the preview pane is not entirely visible. Any suggestions? Also, it's currently setting default tabs to those provided within |
@aminaopio I suggest building a sidebar instead. Within the sidebar, you can use You can add a single icon button to show the sidebar that can be absolutely positioned appear over the code editor. This way you can avoid dealing with layout issues. If you continue to deal with issues, lmk, and I'll help with the UI. |
e962bf8
to
58bd372
Compare
Hi @nmn, I ended up having to tuck the icon button into a header anyway, but let me know your thoughts. Maybe the UI could use some work.... |
I have a project with Rollup working properly here:
Using this project, you should be able to have a four tab design with the following tabs:
You can probably skip the eslint and typescript parts of the project for now. That should make the setup fairly small. |
Ok I just looked over this again now that I'm fully awake, and I see what you're saying |
However, I'm having some trouble visualizing what you mean by 4 tab design @nmn
I was under the impression that what I'm implementing currently is just the multi-file support for the code editor alone |
We have design options, but what I'm imagining is that the left half of the screen is the code editor (plus a sidebar), and the right half of the screen has tabs to let you see either the JS output, collected styles, generated CSS or preview. A grid of four corners like in your hand-drawn picture could also work. |
You can start with that. Do you want me to integrate the Rollup project into my playground PR so you can just rebase on top and do the work on adding tabs for the source editor? |
Hey @aminaopio Sorry, I confused the two Playground related PRs. Please carry on with your work on adding tabs. |
Oh okay all good! I'll start implementing what you suggested once this one gets finished up and merged
We can try this out on our own, but may need assistance. I'll get back to you on this one. Thanks! |
@nmn Is this okay to merge? And can you go ahead an integrate the rollup project as well? Thanks! |
@aminaopio I think you will need to rebase your branch before we can merge. The basic functionality seems to work, but the design could use a bit more love too.
None of these changes are blockers, but we will need to get the other parts of the playground working before we are able to merge it anyway. |
… context ## Linked PR/Issues Fixes # (issue) ## Additional Context <!--- Screenshots, Tests, Breaking Change, Anything Else ? ---> Screenshots, Tests, Anything Else ## Pre-flight checklist - [ ] I have read the contributing guidelines [Contribution Guidelines](https://github.com/facebook/stylex/blob/main/.github/CONTRIBUTING.md) - [ ] Performed a self-review of my code
975e86a
to
2ea6d52
Compare
@nmn Ok thanks for the feedback, it should be good to go now. I imported icons from FontAwesome and double-clicking will enable edit mode for the filename (let me know if the white bg is too harsh/if the red trash icon should be a diff color). We're hoping to implement the rest of the playground in parallel with working on other issues. Do you have any beginner-friendly ideas for contributing to the docs? |
What changed / motivation ?
The StyleX website has an empty-ish page for the playground. This tackles one of the issues: A source editor pane that support tabs for multiple files.
Linked PR/Issues
This helps address issue #732
Additional Context
Implemented Change (w/o server running):
feat759.mov
Screenshots:
Pre-flight checklist
Contribution Guidelines