-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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: added the "Open Preview in a New Tab" #1101
feat: added the "Open Preview in a New Tab" #1101
Conversation
Stijnus
commented
Jan 15, 2025
is this ready? |
I did my testing on my end but Yes it should be ready but please to be sure test before you merge it. thx, Br, |
Nice on. works fine for me so far. Just one thing, but not a must => if the external preview is open, can we prevent from switching to the preview tab within the main ui? So stay on code editor. |
like a detach window function or how i need to interper it ? can you be more precise? |
I was thinking about it, i don't think there is any way to communicate between these two tabs. so don't know how this is possible. I suggest we merge this PR and open a separate PR to explore this concept. |
ì was playing arround this today after the PR : The fundamental issue is that the web app running inside the WebContainer iframe has its own isolated context, regardless of whether it uses localStorage or not. Here's what's happening:
The current approach of trying to sync through the parent window's localStorage or broadcast channels won't work because:
Possible solutions could be:
|
thanks for investigating and summarizing this. I just saw it works the same in bolt.new, so I assume this is correct what you found out. @patak-dev but maybe you want to change/enhance this as well for bolt.new, then we can use it as well :P |
Makes sense @leex279, thanks for the heads up! |
@Stijnus sli.dev, a browser based presentation tool also uses BroadcastChannels for communicating changes across tabs and even windows and it's a very robust and responsive experience. Would it not be possible to have a thin shell around the webcontainer which listens to the broadcast and then propagates to the webcontainer? Or is this what you meant with "Set up a message passing system between the WebContainer and parent" |
[Open Preview] [▼] // Two buttons side by side | +-- [Mobile (375x667)] // Dropdown menu |-- [Tablet (768x1024)] |-- [Laptop (1366x768)] +-- [Desktop (1920x1080)]
@Stijnus looks nice. Add them in a new PR, so we can test it out :) |
Give 30 min will update soon finishing other Dev project first :) |
Hi, I have update the PR please test if you have the time :) Br, Stijnus |
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.
everything looks good
Merged 🎉 Interested to see whether this work on electron too, @thecodacus |
I am also not sure. 😅 |
Thank you... a mention in the readme would be nice 😊 |
@Stijnus just saw the contrast is very bad for dark mode: maybe you can fix that in another PR :) |
Np fix it today!
Op za 18 jan 2025 om 14:57 schreef Leex ***@***.***>
… @Stijnus <https://github.com/Stijnus> just saw the contrast is very bad
for dark mode:
image.png (view on web)
<https://github.com/user-attachments/assets/54e2e977-ebf9-463a-ae17-f5c3386f187e>
maybe you can fix that in another PR :)
—
Reply to this email directly, view it on GitHub
<#1101 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARJQVTLOUN3ULUXYRLLRKZL2LJMU5AVCNFSM6AAAAABVHIXIWGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKOJZG4ZDMOJZGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Then don't forget to add yourself to the readme ;-) |
Pr is ready making the request now..
Br,
Stijn
…On Sat, 18 Jan 2025 at 15:41, Oliver Jägle ***@***.***> wrote:
Then don't forget to add yourself to the readme ;-)
—
Reply to this email directly, view it on GitHub
<#1101 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARJQVTMOEO7LCUXV4EMUDED2LJRYXAVCNFSM6AAAAABVHIXIWGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKOJZG42DGOJTGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Just in time before I do my next video :D thanks. |