Skip to content

Conversation

Dumluregn
Copy link
Contributor

@Dumluregn Dumluregn commented Mar 17, 2025

Suggested merge commit message (convention)

Docs (fullscreen): Add feature guide.

Feature (ui): Add a possibility to switch toolbar behavior in the runtime using the ToolbarView#switchBehavior() method.

Internal (fullscreen): Allow to configure toolbar behavior while in fullscreen mode.


Additional information

Checkout the same branch in commercial repo.

Part regarding the toolbar behavior switching was already reviewed in #18160.

Renames:

  • command name: fullscreen -> toggleFullscreen to follow the convention of starting command names with a verb.
  • icon names: fullscreen-on and fullscreen-off -> fullscreen-disable and fullscreen-enable to avoid confusion.
  • AbstractHandler#_container -> AbstractHandler#_wrapper to avoid confusion with a configurable custom container.

Refactors:

  • Move feature checks to the enable() / disable() methods for consistency, readability and easier testing.

Fixes:

  • If custom container is used, hide all the other elements in this container to prevent creating the unscrollable, empty space. You can end up with the editor outside the viewport and unaccessible.
    • This also required to relocate the pagination view to the fullscreen container to keep it visible.
  • this._document = this._editor.sourceElement!.ownerDocument; turned out to not be reliable in some cases (e.g. pagination manual test. Fall back to the global document if sourceElement` is not defined.
  • On editor.destroy(), disable the fullscreen only if wrapper is visible.
  • When revision history is visible, hide document outline header (document outline element hiding is handled by RH).

@Dumluregn Dumluregn force-pushed the ck/fullscreen-guide branch from 0e0e25e to 794be40 Compare March 17, 2025 08:59
@Dumluregn Dumluregn force-pushed the ck/fullscreen-guide branch from 794be40 to ddd6dd0 Compare March 18, 2025 08:59
@DawidKossowski DawidKossowski requested a review from scofalik March 20, 2025 09:44
Copy link
Contributor

@scofalik scofalik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good in general. Some comments.

Unfortunately I was unable to build docs, both on this branch and on master. I'll get back to it when I manage to build them.

definitions: [
{
title: 'Document with an image',
description: 'Simple heading with text and and and image.',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"and and and" woot? :D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xd
image

@@ -182,8 +204,15 @@ export default class AbstractEditorHandler {
this._overrideRevisionHistoryCallbacks();
}

// Hide all other elements in the container to ensure they don't create an empty unscrollable space.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would there be anything in the container? Is this to account some mistake on the integrator part? Like e.g. whitespace text nodes or something? If so, shouldn't we remove them instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example the pageless demo in docs uses the container where there is the whole rest of website content and we need to hide it. We can't just fix the position because the rest of the page (outside the container) has to stay usable.
image

@scofalik
Copy link
Contributor

I build docs and I see some things that we could improve. Maybe some of them are due to some building errors, IDK:


Something is wrong with paddings here with the table:

image

I wonder if it is good that we don't add any even slight padding to the sides of the container. The button is almost next to the screen edge, it looks and feels a bit weird:

image

Compare to how far from the screen are GDocs buttons (I understand they have a bit different layout, but the point is to make it simpler to click toolbar/menubar buttons).

image

When I leave fullscreen mode, the page is scrolled to the top -- the previous scrolled position is not preserved.


On a big screen, the pageless demo looks weird.

image

It is moved to the left and still has some grayish background on the right.

Instead, I'd make the background-background white and I guess still probably centered 🤔.


I am experiencing some warnings errors when building docs, e.g.:

./packages/ckeditor5-fullscreen/src/fullscreenconfig.ts:34:19 - warning Encountered an unescaped open brace without an inline tag

34       * @default () => {}
Error: Failed while convert {@link module:fullscreen/fullscreenconfig~FullscreenConfig plugin configuration API} tag in ckeditor5/44.3.0/features/fullscreen.md. No doclet found. Link remain not transformed.
Error: Invalid internal links in /ckeditor5/44.3.0/features/fullscreen.html:
  * '../getting-started/setup/editor-types.html#decoupled-editor' - decoupled

The doc page looks like it has incorrect layout, or IDK something went wrong:

image

It seems that it uses the wide layout, like on Examples / Document editor, but the editors are not full-wide, so it looks like something is broken. I propose to either use regular layout (I understand that might be a problem for showcasing custom container?) or have the editor full-wide?


I am also missing a sample where the basic editor (non-fullscreen) would be quite small, small editable size, no menu, maybe inline annotations? So that the fullscreen experience would feel more transformative.


Sidebar has no margin between the editing area:

image

Dumluregn and others added 7 commits March 21, 2025 10:56
Co-authored-by: Szymon Cofalik <s.cofalik@cksource.com>
Co-authored-by: Dawid Kossowski <20561161+DawidKossowski@users.noreply.github.com>
…document-outline

Internal (fullscreen): Improve source editing integration with document outline in fullscreen mode.
Dumluregn and others added 10 commits March 24, 2025 12:23
Internal (fullscreen): Integrate with CKBox. Closes #18189.

Internal (fullscreen): Fix dialogs and balloons positioning in scrollable container. Closes #18153.

Internal (fullscreen): Remove icon and rename fullscreen menu bar. Closes #18187.

Internal (fullscreen): Rename fullscreen toolbar buttons to "Enter/leave fullscreen mode". Closes #18188.
@Dumluregn
Copy link
Contributor Author

List of docs fixes left to do (I'll extract it to the ticket):

  • I wonder if it is good that we don't add any even slight padding to the sides of the container. The button is almost next to the screen edge, it looks and feels a bit weird

  • When I leave fullscreen mode, the page is scrolled to the top -- the previous scrolled position is not preserved.

  • On a big screen, the pageless demo looks weird. It is moved to the left and still has some grayish background on the right. Instead, I'd make the background-background white and I guess still probably centered 🤔.

  • I am also missing a sample where the basic editor (non-fullscreen) would be quite small, small editable size, no menu, maybe inline annotations? So that the fullscreen experience would feel more transformative.

@scofalik scofalik merged commit abeef83 into ck/epic/1235-fullscreen-mode Mar 24, 2025
5 of 7 checks passed
@scofalik scofalik deleted the ck/fullscreen-guide branch March 24, 2025 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants