-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Presence list and document outline for fullscreen mode #17975
Presence list and document outline for fullscreen mode #17975
Conversation
… into epic/1235-fullscreen-mode-presence-list
… into epic/1235-fullscreen-mode-presence-list
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 think it would make sense that left scroll should only be displayed to the height of document outline, not the whole sidebar.
With default styling, the H1 headings in document outline are larger than the "Document outline" caption, which seems odd - let's maybe discuss it on some meeting with Dagmara, I'll add it to the logbook.
There's an error in the console if you go to fullscreen, go back and click in the editable area:
Screen.Recording.2025-02-26.at.16.54.24.mov
const presenceListWrapper = ` | ||
<div class="ck ck-fullscreen__left-sidebar-item"> | ||
<div class="ck ck-fullscreen__left-sidebar-header">Connected users</div> | ||
<div class="ck ck-fullscreen__presence-list" data-ck-fullscreen="presence-list"></div> | ||
</div> | ||
`; | ||
|
||
const fragment = document.createRange().createContextualFragment( presenceListWrapper ); | ||
|
||
document.querySelector( '[data-ck-fullscreen="left-sidebar-sticky"]' )!.appendChild( fragment ); |
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.
Maybe for consistency across this one file we'll keep the convention of creating an element and setting its innerHTML
here and later in DO?
this.generatePresenceListElement(); | ||
this.generateDocumentOutlineElement(); |
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.
Let's try to keep in the specialized classes only the code that differs between them and the rest in the abstract editor, after calling the defaultEnable()
and before executing the configured callback. It will make it easier to spot the differences (and perhaps unify the editor types one day to get rid of them).
import { PresenceListUI, PresenceList } from '@ckeditor/ckeditor5-real-time-collaboration'; | ||
import { DocumentOutline, DocumentOutlineUI } from '@ckeditor/ckeditor5-document-outline'; | ||
import mockCloudServices, { CloudServicesMock } from '@ckeditor/ckeditor5-real-time-collaboration/tests/_utils/mockcloudservices.js'; |
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's a problem with using the commercial features in the open source repository. We decided to use /* istanbul ignore next -- @preserve */
to prevent CC to fall below 100%, but provide the coverage on the premium packages side. So e.g. in document outline package there should be a test with fullscreen loaded that checks if everything is ok.
let abstractHandler, domElement, editor, presenceList, documentOutline; | ||
|
||
mockCloudServices(); | ||
|
||
beforeEach( async () => { | ||
domElement = global.document.createElement( 'div' ); | ||
global.document.body.appendChild( domElement ); | ||
presenceList = document.createElement( 'div' ); | ||
document.body.appendChild( presenceList ); | ||
documentOutline = document.createElement( 'div' ); | ||
document.body.appendChild( documentOutline ); | ||
|
||
editor = await ClassicEditor.create( domElement, { | ||
plugins: [ | ||
Paragraph, | ||
Essentials | ||
] | ||
Essentials, | ||
PresenceListUI, | ||
PresenceList, | ||
CloudServicesMock, | ||
DocumentOutline, | ||
DocumentOutlineUI | ||
], | ||
cloudServices: { | ||
tokenUrl: 'abc', | ||
webSocketUrl: 'web-socket-url' | ||
}, | ||
collaboration: { | ||
channelId: 'test' | ||
}, | ||
presenceList: { | ||
container: presenceList | ||
}, | ||
documentOutline: { | ||
container: documentOutline | ||
} |
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.
For simplicity, I'd keep the config here minimalistic and create more complex editors on demand in tests that need them. But here as I wrote before we don't want to test the commercial features anyway.
@@ -52,6 +52,7 @@ import CloudServices from '@ckeditor/ckeditor5-cloud-services/src/cloudservices. | |||
import Style from '@ckeditor/ckeditor5-style/src/style.js'; | |||
import GeneralHtmlSupport from '@ckeditor/ckeditor5-html-support/src/generalhtmlsupport.js'; | |||
import Bookmark from '@ckeditor/ckeditor5-bookmark/src/bookmark.js'; | |||
import PresenceList from '@ckeditor/ckeditor5-real-time-collaboration/src/presencelist.js'; |
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.
This manual test throws for me right now as there is no .presence
element in HTML, but let's only use open-source features in the manual test (I'm not sure if it even worked on CI) and premium features - using all-features-rtc
manual test from commercial repo.
|
||
.ck-fullscreen__left-sidebar { | ||
font-family: Helvetica, Arial, sans-serif; | ||
--ck-user-avatar-size: 32px; |
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.
Correct me if I'm wrong, but in presence list outside the fullscreen avatars have 40px and in annotations - 28px. I'm not sure if we really want to introduce a third size? In designs it's also 28px as far as I can see - https://www.figma.com/design/0fCM0UevmXtoL8DbVPt3wT/Full-screen?node-id=147-20312&m=dev.
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.
in collapsed view it should be 32px because of white borders which looks like avatars are smaller than counter,
it was mentioned on some call and then i asked Dagmara if my changes looks fine
but i will remove 32px from not collapsed view
margin-left: 10px; | ||
margin-right: 10px; | ||
background-color: hsl(34.29, 77.78%, 91.18%); |
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.
It's time to remove this color :D
display: flex; | ||
justify-content: center; | ||
overflow: auto; | ||
max-height: 100%; | ||
} | ||
|
||
.ck-fullscreen__main-container .ck-fullscreen__sidebar { | ||
.ck-fullscreen__sidebar { | ||
width: 270px; |
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.
According to the designs width should be 300px.
5c81c22
to
3a1dd7a
Compare
…itor5 into epic/1235-fullscreen-mode-presence-list
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.
In this file we have a snippet with fullscreen container layout, please update it according to the changes from the PR.
@@ -196,6 +204,74 @@ export default class AbstractEditorHandler { | |||
} | |||
} | |||
|
|||
/* istanbul ignore next -- @preserve */ | |||
public generatePresenceListElement(): void { |
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.
Missing API docs for some of the new methods. They should also be private.
return; | ||
} | ||
|
||
const presneceListElement = createElement( document, 'div', { |
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.
presneceListElement
=> presenceListElement
Suggested merge commit message (convention)
Internal: Presence list and document outline for fullscreen mode.
Additional information
For example – encountered issues, assumptions you had to make, other affected tickets, etc.