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

Examples mobile fixes #6335

Merged
merged 9 commits into from
May 2, 2024
Merged

Examples mobile fixes #6335

merged 9 commits into from
May 2, 2024

Conversation

kpal81xd
Copy link
Contributor

@kpal81xd kpal81xd commented May 2, 2024

Fixes #3991
Fixes #5215

  • Upgraded mobile code editor for mobile with proper highlighting and theme (read only)
  • Fixed controls and code editor styling (clipped under Examples header)
  • Made long controls scrollable
  • Increased device pixel ratio to of the window (capped at 2)
  • Gizmo distance and size invariant for different aspect ratios

Preview

Code editor
image

Scrollable & Smaller controls
image

I confirm I have read the contributing guidelines and signed the Contributor License Agreement.

@kpal81xd kpal81xd self-assigned this May 2, 2024
@kpal81xd kpal81xd requested a review from a team May 2, 2024 09:45
@mvaligursky
Copy link
Contributor

mvaligursky commented May 2, 2024

Increased device pixel ratio to of the window (capped at 2)

That would possibly have a negative performance impact on fragment limited examples. But considering there is per example control, we can adjust it as needed.

Is there a good way to make the Controls panel less wide so that you can see the example you're adjusted on the side?

Copy link
Contributor

@mvaligursky mvaligursky left a comment

Choose a reason for hiding this comment

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

Looks great!

@kpal81xd
Copy link
Contributor Author

kpal81xd commented May 2, 2024

Increased device pixel ratio to of the window (capped at 2)

That would possibly have a negative performance impact on fragment limited examples. But considering there is per example control, we can adjust it as needed.

Is there a good way to make the Controls panel less wide so that you can see the example you're adjusted on the side?

I could try but I feel like on smaller screens more controls will overflow to the next line

@kpal81xd
Copy link
Contributor Author

kpal81xd commented May 2, 2024

@mvaligursky made the controls panel shorter since its scrollable so you can see more of the screen

@mvaligursky
Copy link
Contributor

Great solution! Merge away.

Copy link
Contributor

@willeastcott willeastcott left a comment

Choose a reason for hiding this comment

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

Love the polish here - awesome!

@kpal81xd kpal81xd added the bug label May 2, 2024
@kpal81xd kpal81xd merged commit 2d9e620 into main May 2, 2024
7 checks passed
@kpal81xd kpal81xd deleted the examples-mobile-fixes branch May 2, 2024 14:49
@Maksims
Copy link
Contributor

Maksims commented May 2, 2024

How does UI look on high DPI screens, like retina Macs?
Best would be to solve it using CSS instead of whole screen DPI.

slimbuck pushed a commit to slimbuck/engine that referenced this pull request May 20, 2024
* fixed code editor for mobile

* split up components of code editors into separate classes

* updated device pixel ratio to use of window (capped at 2)

* fixed gizmo sizing for mobile

* updated gizmo jsdoc

* rerender code editor once tokenizer patched

* removed unused variable

* made controls panel smaller for mobile

* disable min height when not collapsed for controls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants