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

Remove tool bar UI background #5525

Merged
merged 1 commit into from
Jul 12, 2022
Merged

Remove tool bar UI background #5525

merged 1 commit into from
Jul 12, 2022

Conversation

takahirox
Copy link
Contributor

@takahirox takahirox commented Jun 23, 2022

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.

image

unknown

Concepts and thoughts

  • Current my main focus is resolving the problem that the viewport is vertically narrow in landscape mode on mobile devices. Allow to hide the bottom 2D UI bar #5188
  • I'm not a designer. I hope we can go with this change so far, and then the designers or artists brush up, improve, or clean up it.
  • I think Mic and Share icons should be always visible for user privacy. Users should be always aware of whther their mic, camera, or screen is shared. So I don't think of completely hiding the bottom tool bar.
  • I don't want to add complexity. So I don't want to add event handlers (eg: Add button to show/hide tool bar.) And I want consistent design/layout across platforms or device orientation for simplicity. If we change them depending on platforms or device orientation, testing cost will be higher or we will easily ignore some cases in testing.
  • Preferred design and layout should be very dependent on admins, scenes, users, events, or use cases. (Actually I have gotten the two feedbacks. Some users prefer always visible icons. Others prefer hide/show tray.) I hope admins or owners edit the design and layout in their custom clients if the default design or layout doesn't satisfy them. So I think it's good that the default is good design and simple implementation for them to edit rather than the default is perfect design and complex implementation.

@takahirox
Copy link
Contributor Author

Ah, wait. I need to fix them...

image

image

@takahirox
Copy link
Contributor Author

Fixed them

@takahirox
Copy link
Contributor Author

Lnadscape mode before and after. I'm not sure if the new one looks more beautiful, but at least more usable with vertically wider viewport.

unknown

Copy link
Contributor

@keianhzo keianhzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the style issue that I point out looks good to me and I think it's more usable than what we had.

I think I'd like it a bit better if the labels had more padding around, something like:
Screen Shot 2022-07-05 at 17 57 25
But that's more a design decision.

themes.json Show resolved Hide resolved
@takahirox
Copy link
Contributor Author

@keianhzo

Thanks for the review.

I think I'd like it a bit better if the labels had more padding around

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 };
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@netpro2k @keianhzo Do you think this is a proper way to set window-full-size canvas?

Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because entries[0].contentRect indicates the red line rect area.

image

Perhaps updating CSS or React (HTML tag placement) can change it to indicate the window area but not sure how to do.

Copy link
Contributor

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 useResizeViewportcode 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, updated.

Copy link
Contributor

@keianhzo keianhzo Jul 9, 2022

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, thanks.

@keianhzo
Copy link
Contributor

keianhzo commented Jul 8, 2022

@takahirox
Copy link
Contributor Author

Thanks for the suggestion.

I think we can get rid of this polyfill?

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.
@takahirox takahirox merged commit 1113bc1 into master Jul 12, 2022
@takahirox takahirox deleted the RemoveToolBar branch July 12, 2022 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow to hide the bottom 2D UI bar
2 participants