-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
Sidebar optimisation as separate panel instead of overlay #289
Conversation
@@ -35,10 +35,7 @@ const CtlBar = (props: Props) => { | |||
}} | |||
> | |||
{pageNum > 1 && ( | |||
<> | |||
<Pager pageCursor={pageCursor} pageNum={pageNum} setPageCursor={setPageCursor} /> | |||
<strong style={{ color: 'white', fontSize: '0.9rem', padding: 0 }}>|</strong> |
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 removed the |
separator as I thought it looked better with just space but I can re-add
@@ -247,12 +253,7 @@ Check this document: https://pdfme.com/docs/custom-schemas`); | |||
onEditEnd(); | |||
}} | |||
zoomLevel={zoomLevel} | |||
setZoomLevel={(zoom) => { | |||
if (mainRef.current) { | |||
mainRef.current.scrollTop = getPagesScrollTopByIndex(pageSizes, pageCursor, scale); |
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 tried to align the left scroll centrally but this did not seem worth the effort.
Similarly, I didn't think pulling the viewport to the top was good UX, it felt OK to just zoom in / out from where you were.
packages/ui/src/components/Paper.tsx
Outdated
...size, | ||
transformOrigin: 'top left', | ||
// NOTE: These values do not apply, but changing them with scale ensures the | ||
// container is updated to show appropriately sized scrollbars when you zoom in/out. |
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.
there is probably a better way of doing this
test and reviewing |
Also, I'll fix main branch failing test. sorry |
Very cool. this is a ideal sidebar position...! thank you. but i fond bug, when i set multi page pdf template to form or viewer, PDF pages overflow the root element. also, when i set multi page pdf as besePdf to designer, we can see wrong position CtlBar. you can reproduce from this template.json. This behavior should be maintained. 1026.1.movSo, we need check this pattern
|
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.
Please explain the changes to this file.
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.
The CtlBar is absolutely positioned to its container.
The outer div places the CtrlBar in the correct place.
The inner div no longer needs any special positioning. Sticky is not required because the div is absolute to the parent and does not move.
…r-optimisation
I'm looking into this now 👀 |
consolidate use of sizeExclSizebar
I think this is all working fine now - I have updated the PR description with information about the changes. I didn't have any problem with the position of the CtrlBar though on the Designer, I'm not sure how you were seeing that 🤔 Single Page Designer: Screen.Recording.2023-10-26.at.14.39.22.mov |
Single Page Viewer: Screen.Recording.2023-10-26.at.14.40.45.mov |
Multi-page Designer: Screen.Recording.2023-10-26.at.14.46.01.mov |
Multi-page Viewer: Screen.Recording.2023-10-26.at.14.47.08.mov |
} | ||
|
||
const Main = (props: Props, ref: Ref<HTMLDivElement>) => { | ||
const Canvas = (props: Props, ref: Ref<HTMLDivElement>) => { |
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 renamed this to Canvas
as it felt more specific than Main
, but I will revert if you disagree.
@@ -247,7 +253,15 @@ const Main = (props: Props, ref: Ref<HTMLDivElement>) => { | |||
.every((schema) => schema.rotate !== undefined); | |||
|
|||
return ( | |||
<div ref={ref} style={{ overflow: 'overlay' }}> |
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.
overflow: overlay
was deprecated a while ago and does not have consistent support. We're using overflow: scroll
or auto
now where needed.
); | ||
}} | ||
/> | ||
<div ref={containerRef} style={{ ...size, position: 'relative', overflow: 'auto' }}> |
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 have changed Preview to be consistent with the Designer, with a wrapping Div which is the viewport/canvas for scrolling.
Hi @hand-dot, Are these tests failing because it's taking a long time to run the generator integration tests? I don't think I have made any changes here that would impact this... 🤔 |
Sometime it occurs. Let's run again |
Okay test is passing, I gonna check code tomorrow |
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.
The UX of pdfme has significantly improved.
It's Saturday night in Japan right now, and I can enjoy a beer in the best mood.
Thank you for the amazing PR.
implements #248
IMPROVEMENTS:
Screen.Recording.2023-10-26.at.13.22.34.mov
Screen.Recording.2023-10-26.at.13.20.58.mov