Skip to content

Commit

Permalink
unify commenitng and collaboration FSs
Browse files Browse the repository at this point in the history
  • Loading branch information
bkrmendy committed Jan 4, 2024
1 parent f8c8b50 commit d15a1a9
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion editor/src/components/canvas/design-panel-root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export const RightPane = React.memo<ResizableRightPaneProps>((props) => {
</>,
)}
{when(
isFeatureEnabled('Commenting'),
isFeatureEnabled('Multiplayer'),
<MenuTab
label={'Comments'}
selected={selectedTab === RightMenuTab.Comments}
Expand Down
2 changes: 1 addition & 1 deletion editor/src/components/canvas/multiplayer-presence.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export const MultiplayerPresence = React.memo(() => {
<>
<FollowingOverlay />
<MultiplayerShadows />
{when(isFeatureEnabled('Commenting'), <CommentIndicators />)}
<CommentIndicators />
<MultiplayerCursors />
{when(isCommentMode(mode) && mode.comment != null, <CommentPopup />)}
</>
Expand Down
2 changes: 1 addition & 1 deletion editor/src/components/editor/canvas-toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ export const CanvasToolbar = React.memo(() => {
/>
</Tooltip>
{when(
isFeatureEnabled('Commenting'),
isFeatureEnabled('Multiplayer'),
<Tooltip title={commentButtonTooltip} placement='bottom'>
<InsertModeButton
testid={CommentModeButtonTestId}
Expand Down
2 changes: 1 addition & 1 deletion editor/src/components/editor/global-shortcuts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ export function handleKeyDown(
return []
},
[COMMENT_SHORTCUT]: () => {
if (isFeatureEnabled('Commenting')) {
if (isFeatureEnabled('Multiplayer')) {
return [
EditorActions.switchEditorMode(EditorModes.commentMode(null, 'not-dragging')),
EditorActions.setRightMenuTab(RightMenuTab.Comments),
Expand Down
2 changes: 1 addition & 1 deletion editor/src/components/editor/liveblocks-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ export async function checkLiveblocksEnabledOnServer(): Promise<void> {
}

export function isLiveblocksEnabled(): boolean {
return isLiveblocksEnabledOnServer && isFeatureEnabled('Collaboration')
return isLiveblocksEnabledOnServer && isFeatureEnabled('Multiplayer')
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ async function runAddHookForProjectChangesTest(test: AddHookForProjectChangesTes
}

describe('addHookForProjectChanges', () => {
setFeatureForUnitTestsUseInDescribeBlockOnly('Collaboration', true)
setFeatureForUnitTestsUseInDescribeBlockOnly('Multiplayer', true)

it('adding file causes it to be added to the project contents', async () => {
const code = 'export const A = <div />'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export function collateCollaborativeProjectChanges(
}
}
}
if (isFeatureEnabled('Collaboration')) {
if (isFeatureEnabled('Multiplayer')) {
if (oldContents != newContents) {
zipContentsTree(oldContents, newContents, onElement)
}
Expand Down
2 changes: 1 addition & 1 deletion editor/src/components/editor/store/editor-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ export function emptyCollaborativeEditingSupportSession(): CollaborativeEditingS

export function emptyCollaborativeEditingSupport(): CollaborativeEditingSupport {
let session: CollaborativeEditingSupportSession | null = null
if (isFeatureEnabled('Collaboration')) {
if (isFeatureEnabled('Multiplayer')) {
session = emptyCollaborativeEditingSupportSession()
}
return {
Expand Down
9 changes: 3 additions & 6 deletions editor/src/utils/feature-switches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ export type FeatureName =
| 'Performance Test Triggers'
| 'Canvas Strategies Debug Panel'
| 'Project Thumbnail Generation'
| 'Commenting'
| 'Debug - Print UIDs'
| 'Steganography'
| 'Collaboration'
| 'Multiplayer'
| 'Baton Passing For Control'

export const AllFeatureNames: FeatureName[] = [
Expand All @@ -29,10 +28,9 @@ export const AllFeatureNames: FeatureName[] = [
'Performance Test Triggers',
'Canvas Strategies Debug Panel',
'Project Thumbnail Generation',
'Commenting',
'Debug - Print UIDs',
'Steganography',
'Collaboration',
'Multiplayer',
'Baton Passing For Control',
]

Expand All @@ -46,10 +44,9 @@ let FeatureSwitches: { [feature in FeatureName]: boolean } = {
'Performance Test Triggers': !(PRODUCTION_CONFIG as boolean),
'Canvas Strategies Debug Panel': false,
'Project Thumbnail Generation': false,
Commenting: false,
'Debug - Print UIDs': false,
Steganography: false,
Collaboration: false,
Multiplayer: false,
'Baton Passing For Control': false,
}

Expand Down

0 comments on commit d15a1a9

Please sign in to comment.