Skip to content
Merged
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
11 changes: 7 additions & 4 deletions packages/editor/src/components/collab-sidebar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,20 +252,23 @@ function NotesSidebar( { postId } ) {
}

export default function NotesSidebarContainer() {
const { postId, editorMode } = useSelect( ( select ) => {
const { getCurrentPostId, getEditorMode } = select( editorStore );
const { postId, editorMode, revisionsMode } = useSelect( ( select ) => {
const { getCurrentPostId, getEditorMode, isRevisionsMode } = unlock(
select( editorStore )
);
return {
postId: getCurrentPostId(),
editorMode: getEditorMode(),
revisionsMode: isRevisionsMode(),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

TIL about isRevisionsMode

Another mode. 🥳

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's getting harder to keep track of all the modes 😄

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perhaps it should be disabled when in preview mode generally? 🤔

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think we don't renender full editor in preview mode. Just block editor, no?

};
}, [] );

if ( ! postId || typeof postId !== 'number' ) {
return null;
}

// Hide Notes sidebar in Code Editor mode since block-level commenting.
if ( editorMode === 'text' ) {
// Hide Notes sidebar for Code Editor and in-editor revision mode.
if ( editorMode === 'text' || revisionsMode ) {
return null;
}

Expand Down
Loading