Skip to content
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

[playground] Allow resizing of playground sections #524

Open
aralroca opened this issue Oct 7, 2024 · 3 comments · May be fixed by #537
Open

[playground] Allow resizing of playground sections #524

aralroca opened this issue Oct 7, 2024 · 3 comments · May be fixed by #537
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers Winter Of Code 4.0

Comments

@aralroca
Copy link
Collaborator

aralroca commented Oct 7, 2024

Related to #158

In the Brisa Playground code size, preview, and terminal are modifiable by developers.

@chankruze
Copy link

chankruze commented Oct 9, 2024

@enzonotario @aralroca should we use any external package or should we try with vanilla css ?

As we already have automatic layout set to true, here
https://github.com/chankruze/brisa/blob/a97caf0b0c7921308ac525282ff5d101620ed442/packages/www/src/pages/playground/index.tsx#L71

const editor = monaco.editor.create(document.querySelector('#code-editor'), {
    theme: document.body.classList.contains('dark') ? "vs-dark" : "vs-light",
        automaticLayout: true,
    });

@enzonotario
Copy link
Collaborator

I was trying to use an existing WebComponent (https://opensource.adobe.com/spectrum-web-components/components/split-view/), with no success so far.

I think it would be better to use an existing solution, because do it from zero, considering Responsive, Accessibility, etc, would be long.

Feel free to propose a solution. If not, I'll give it a try on weekend.

@chankruze chankruze linked a pull request Oct 9, 2024 that will close this issue
3 tasks
@enzonotario enzonotario assigned chankruze and unassigned enzonotario Oct 9, 2024
@Swayam29082004
Copy link

Fixed in #524
Fix Monaco Editor Initialization
This update ensures the Monaco Editor initializes only after the DOM content has fully loaded, using the DOMContentLoaded event listener. Additionally, requestAnimationFrame is used to defer the Monaco editor initialization, ensuring it's done after the layout is ready, which prevents issues when the editor is initialized too early. This solution improves reliability for dynamic page layouts and resizing scenarios.
document.addEventListener('DOMContentLoaded', () => { const container = document.querySelector('#code-editor'); if (container) { requestAnimationFrame(() => { const editor = monaco.editor.create(container, { theme: document.body.classList.contains('dark') ? "vs-dark" : "vs-light", automaticLayout: true, }); }); } });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers Winter Of Code 4.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants