Make the probe viewer usable on phones and short screens - #82
Open
h-mayorquin wants to merge 2 commits into
Open
h-mayorquin wants to merge 2 commits into
h-mayorquin wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When I opened the viewer on my phone I realized that the probe page was not usable. The page is locked to the height of the screen and on a narrow screen the probe list pushes the viewer below the bottom edge where it can't be reached. The same lock cuts off the bottom toolbar on laptop windows shorter than about 680px. This PR lets the page scroll when the screen is narrower than 960px or shorter than 680px and caps the probe list at 40% of the screen height. Once the page scrolls a finger drag on the probe would scroll the page, so I also set
touch-action: noneon the canvas to keep the drag as a pan. The mouse wheel over the probe still zooms, and on a large desktop window nothing changes. I also let the export and share buttons wrap under the title on narrow screens. I tested it on a Pixel 9 with a preview deployed from my fork:https://h-mayorquin.github.io/probeinterface_library/
The second commit renames the classes and components of the probe page. Names like
app-sidebar,app-mainandviewer-canvasdescribe where things sit instead of what they are, and that made the layout hard to talk about while working on this. SoSidebaris nowProbeSelectionMenu,ProbeCanvasisProbeDrawing,ProbeOverviewisProbeMinimap, and thesidebar-*andviewer-*classes follow the same scheme. I kept it as a separate commit so the functional change can be reviewed on its own. I compared screenshots of three probes at three window sizes before and after the rename and saw no visual change.