-
Notifications
You must be signed in to change notification settings - Fork 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
Prevent cumulative layout shift when rich workspace is loading #4254
Conversation
2 flaky tests on run #10169 ↗︎
Details:
nodes/Links.spec.js • 1 flaky test
api/UsersApi.spec.js • 1 flaky test
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
ac816c8
to
12f6bfa
Compare
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 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.
Nice improvement!
Instead of only increasing editor height with growing document length, let's stick to a fixed height (25vh) and use that one already while loading the document. The editor still increases when it gets focused. Fixes: #2834 Fixes: #2803 Signed-off-by: Jonas <[email protected]>
The initial jumping is trickier as we'd need to know the availability of a rich workspace before the file list is loaded. We'd need a hook in the files app code to have a synchronous pass over of the propfind data to text before rendering. |
Indeed, I just discovered the same. So inside Text the only thing we can do, is reserve a fixed size for the rich workspace regardless of whether the How about always limiting the height of non-focused rich workspace to
|
Instead of only increasing editor height with growing document length, let's stick to a fixed height (150px) and use that one already while loading the document. The editor still increases when it gets focused. Fixes: #2834 Fixes: #2803 Signed-off-by: Jonas <[email protected]>
12f6bfa
to
748d58a
Compare
I think we should try to find a way to prefetch the information, then we need no layout shift at all: Some code paths that could be worth to investigate: Point when the file list is loaded and being setup before rendering, possibly a good time to emit an event with the file list data? https://github.com/nextcloud/server/blob/8de29843497efed3eff05db1f90a15937d0a504c/apps/files/js/filelist.js#L2284 Maybe there is a way to extend the list of properties dynamically which is taken from https://github.com/nextcloud/server/blob/8de29843497efed3eff05db1f90a15937d0a504c/apps/files/js/filelist.js#L2199 when the file list does the PROPFIND. We do something similar in group folders but I wouldn't reuse the code there due to the complexity and in depth dependency on files internals: https://github.com/nextcloud/groupfolders/blob/master/src/client.js#L141 |
Pushed a first draft of my suggested approach to #4776 Seems to work fine except for some quirks with the file list headers and dav properties when navigating around. |
Awesome, let's close this PR in favour of #4776 then. |
📝 Summary
Instead of only increasing editor height with growing document length, let's stick to a fixed height (25vh) and use that one already while loading the document.
The editor height still increases when it gets focused.
🖼️ Screencasts
🚧 TODO
🏁 Checklist
npm run lint
/npm run stylelint
/composer run cs:check
)