Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions packages/editor/src/components/collab-sidebar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ import AddCommentToolbarButton from './comment-button-toolbar';
import { useGlobalStylesContext } from '../global-styles-provider';
import { getCommentIdsFromBlocks } from './utils';

const isBlockCommentExperimentEnabled =
window?.__experimentalEnableBlockComment;
const modifyBlockCommentAttributes = ( settings ) => {
if ( ! settings.attributes.blockCommentId ) {
settings.attributes = {
Expand Down Expand Up @@ -329,8 +327,7 @@ export default function CollabSidebar() {
} );
}

// Check if the experimental flag is enabled.
if ( ! isBlockCommentExperimentEnabled || postStatus === 'publish' ) {
if ( postStatus === 'publish' ) {
return null; // or maybe return some message indicating no threads are available.
}

Expand Down
8 changes: 7 additions & 1 deletion packages/editor/src/components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ import {
} from '../../store/constants';
import { unlock } from '../../lock-unlock';

const isBlockCommentExperimentEnabled =
window?.__experimentalEnableBlockComment;
Comment on lines +35 to +36
Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe we should also add a check for globalThis.IS_GUTENBERG_PLUGIN to tree-share the code for the WP core.

Copy link
Contributor

Choose a reason for hiding this comment

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

Will this be addressed in a follow-up? Or in this PR, I think that's fine.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not 100% sure if it's needed. Looking at other experiments, none of them use globalThis.IS_GUTENBERG_PLUGIN.

Copy link
Contributor

Choose a reason for hiding this comment

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

My guess is that globalThis.IS_GUTENBERG_PLUGIN prevents the experimental code itself from being shipped into core, but I'm not sure. In any case, I think it's okay to ship this PR for now


const toolbarVariations = {
distractionFreeDisabled: { y: '-50px' },
distractionFreeHover: { y: 0 },
Expand Down Expand Up @@ -195,7 +198,10 @@ function Header( {
}
/>
) }
<CollabSidebar />

{ isBlockCommentExperimentEnabled ? (
<CollabSidebar />
) : undefined }

{ customSaveButton }
<MoreMenu />
Expand Down
Loading