-
Notifications
You must be signed in to change notification settings - Fork 313
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! |
* feat: add dynamic styles to benchmarks fixture * fix style * adding more styles to fixure * fix style * standardize css property names in dynamic fixture * fix style
* prefix dev classnames with property name * added debug config and babel tests * add caching to default path
…, borderStyle to valid-shorthands (facebook#817)
ff8e109
to
1df2576
Compare
resolving conflicts Better styling in playground component, still needs work Import FontAwsome Icon library, changed tab input
1df2576
to
28cdb24
Compare
Tried to squash as much as I could, but commits from better-playground popped up as well...is that normal?
I think it's done? |
I'm so sorry. I suggested rebasing on Can you re-rebase onto the |
* chore: Update Flow and type defs * chore: update more dependencies * chore: update eslint deps * chore: rollup and types updated * chore: update terser * release: v0.9.0-beta.1 * chore: fix babel rollup bundling
* feat: add no-unused eslint rule * Addressed comments; added tests: named exports, indirect style invoke; added features: non-default export, used style as return, full import pattern support
* feat: add postcss-plugin * fix postcss-plugin readme text * remove .ts, .tsx from node_modules @stylexjs/open-props globs in postcss.config.js * do not rely on internal exports path * fix: remove redundant @layer stylex
* chore: Clean up Nextjs-example with postcss-plugin * chore: remove unnecessary 'bright' dep * chore: add json-scheme types
feat: allow file editing and updates the preview update reload button fix: cleanup and improve perf
chore: prettier feat: loading indicator for sidebar while WC boots refactor: add filereader to dropzone, error rev feat: added dropzone to src directory feat: prevent duplicate filenames - Add check to ensure filenames are unique - Prevent accidental overwriting of existing files feat: failed to load error message and reload preview button refactor: reverting back to filesref fix: ensuring consistency across tab styling chore: reduce codeChangeTimeout to 1000ms - Fix sidebar files not rendering fix: resolve sidebar file rendering issue - Allow main.jsx file to be editable refactor: improve UX by keeping cursor position during changes refactor: optimize component performance - Reduce re-renders by using useRef for tracking files - Add support for updating multiple files at a time feat: delete and rename file operations - Add support for deleting and renaming files - Remove deleted files in previews directory - Update UI widths for sidebar, editor, and preview feat: create and update file operations - Add support for creating and updating files - Fix issue causing the preview to render twice - Improve variable naming for better readability feat: WIP update rollup project feat: WIP view preview files Import FontAwsome Icon library, changed tab input minor change added javascript import for codemirror Implemented src, js, and metadata directories Better styling in playground component, still needs work added changes from better-playground Running prettier/lint, issue unrelated to feature
* feat: add postcss-plugin * fix postcss-plugin readme text * remove .ts, .tsx from node_modules @stylexjs/open-props globs in postcss.config.js * do not rely on internal exports path * fix: remove redundant @layer stylex
* chore: Clean up Nextjs-example with postcss-plugin * chore: remove unnecessary 'bright' dep * chore: add json-scheme types
resolving conflicts Better styling in playground component, still needs work Import FontAwsome Icon library, changed tab input
That's my bad, I didn't notice
We should be good to go @nmn. For future reference, what's the proper way to clean up commit history? Would running |
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/ server running):
feat759.mov
Screenshots:
Pre-flight checklist
Contribution Guidelines