-
Notifications
You must be signed in to change notification settings - Fork 16
new-log-viewer: Resize panel width when the browser window resizes. #94
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
b5e278e
Enforce a min width on the editor in place of the previous max panel …
junhaoliao 337e013
Refactor panel width setter / getters to use documentElement; getComp…
junhaoliao 740080e
Change PANEL_CLIP_THRESHOLD_IN_PIXELS to 360 and EDITOR_MIN_WIDTH_IN_…
junhaoliao 9101e31
Merge branch 'main' into panel-window-resize
junhaoliao b6926de
Change panel sizes.
junhaoliao 7e52a9d
Revert changes on sidebar / panel sizes.
junhaoliao 8eb1b90
Include `tabListRef.current.clientWidth` into `PANEL_CLIP_THRESHOLD_I…
junhaoliao 3caf68e
Refactor sidebar resizing logic.
junhaoliao 0db470e
Adjust sidebar panel width before setting it; change PANEL_CLIP_THRES…
junhaoliao 9dcabbc
Revise the logic for setting panel width to ensure it does not exceed…
junhaoliao 7d23a26
Adjust panel open width logic.
junhaoliao a1c812d
Clamp the panel width also during resizes.
junhaoliao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
See suggestion below since can't suggest
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.
Similar to the one in handleActiveTabNameChange, I feel we want to use
Math.min(newPanelWidth, window.innerWidth - EDITOR_MIN_WIDTH_IN_PIXELS)
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.
I feel like that line in handleActiveTabNameChange is dangerous, as can set below the clipping width. The max here is meant to solve issues where
window.innerWidth - EDITOR_MIN_WIDTH_IN_PIXELS
calculation is flawed. When the window.innerwidth is small, the actual editor width is smaller than EDITOR_MIN_WIDTH_IN_PIXELS. This can give very small values nonsensical values for maxHandleXPos/available width. Say the innerwidth is 400, the editor min width is 360. Then the maxHandleXPos/avaialble is 40. However, in reality. the editor is probably only taking up 40px, and the available width should be 360.However, im sure my calc is flawed in other ways... but for now it seems to work.
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.
I still think we should come up with a better fix for this later, and just approve something that works for now
Uh oh!
There was an error while loading. Please reload this page.
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.
I agree. Let's fix it at least in a way that mobile users can read the content in the panel; we can optimize the experience in a later PR.
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.
I havn't tested on mobile... if my comment was unclear i basically just want to keep the max
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.
right, we kept the max and also added a min:
FYR