Repository navigation
fix(layout): fit header, PSTricks diagrams and the sandbox to phone screens - #12
Merged
Merged
Conversation
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
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.
Summary
At 390px the page was ~506–536px wide, so phones zoomed the whole page out (tiny text, blank strip on the right). Causes and fixes:
components/common/layout.tsx): logo + 5 links stayed on one row. Nav nowflex-wraps; the redundantHomelink ishidden sm:inline(the logo already links home).components/latex.tsx):.pspicturerenders at its fixed TeX pixel size (400–800px). NewuseFitPicturessetszoom = min(1, parentWidth / naturalWidth)per picture, re-run viaResizeObserver+MutationObserver.zoom(unliketransform) shrinks the layout box too, and the MathJaxrputlabels scale with it.pages/sandbox.tsx,components/tex-editor-client.tsx): controls wrap, grid isgrid-cols-1belowlg, CodeMirror getsEditorView.lineWrapping.After:
document.documentElement.scrollWidth === 390on home,/examples/unit-circle,/sandboxat a 390px viewport. Desktop is unchanged.Draggable diagrams: under
zoomthe library read pointer coordinates in screen pixels, so the dragged vector lagged behind the finger. Fixed in Mathapedia/LaTeX2JS#41. This PR needs alatex2react/@latex2js/pstricksrelease with that fix, then a version bump here.Before / after (390px)
Link to Devin session: https://app.devin.ai/sessions/7fcd2deb6fb144849a9dd3f8dc116d42
Open in Devin Desktop: https://app.devin.ai/desktop/session/7fcd2deb6fb144849a9dd3f8dc116d42?variant=devin
Requested by: @pyramation