-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Remove tool bar UI background #5525
Conversation
Fixed them |
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.
Thanks for the review.
I hope someone (especially designers or artists) makes a follow up PR to adjust or improve the design. |
@@ -73,7 +73,7 @@ export function useResizeViewport(viewportRef, store, scene) { | |||
return; | |||
} | |||
|
|||
const canvasRect = entries[0].contentRect; | |||
const canvasRect = { width: window.innerWidth, height: window.innerHeight }; |
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.
This looks good to me, I think it should work well but just curious, why did you change entries[0].contentRect
?
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.
Oh ok, thanks for the explanation.
The useResizeViewport
hook takes a node and resizes the viewport according to the latest node size. With this change we are always setting the viewport to the window size which works in this case but breaks the hook contract as we are not resizing based on the viewportRef
anymore. It works in this case but it might be confusing for people using the hook in the future so I'd rather keeping the hook contract as it was and pass the right viewport reference to it.
Once the useResizeViewport
code has been reverted, you can assign the viewportRef
to the room layout div in RoomLayout.js
. That div should cover the entire window if I'm right.
return (
<div
className={classNames(styles.roomLayout, { [styles.objectFocused]: objectFocused }, className)}
ref={viewportRef}
{...rest}
>
{sidebar && <div className={classNames(styles.sidebar, sidebarClassName)}>{sidebar}</div>}
<div className={classNames(styles.modalContainer, styles.viewport)}>{modal}</div>
{(toolbarLeft || toolbarCenter || toolbarRight) && (
<Toolbar
className={classNames(styles.main, styles.toolbar, toolbarClassName)}
left={toolbarLeft}
center={toolbarCenter}
right={toolbarRight}
/>
)}
<div className={classNames(styles.main, styles.viewport, { [styles.streaming]: streaming }, viewportClassName)}>
{viewport}
</div>
</div>
);
Sorry for missing this on my first review.
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.
Thanks, updated.
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 also need to remove the viewportRef
from the last div, otherwise we can get unexpected behavior.
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.
Updated, thanks.
I think we can get rid of this polyfill? It seems to be well supported in all browsers since a while ago: https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver |
Thanks for the suggestion.
I want to think of it in another PR if needed. |
Tool bar UI is too tall especially in the landscape mode on mobile devices. This commit removes the background of the tool bar UI. The viewport becomes vertically wider.
Fixes: #5188
The tool bar UI is too tall especially in the landscape mode on mobile devices.
This PR removes the background of the tool bar UI. The viewport becomes vertically wider.
I'm not sure if you like it because I'm not a designer. I hope designers brush up the design later even if we go with this change.
Concepts and thoughts