From 95dc9eebeb53e7f77a96c71bdf52f59d7689bed5 Mon Sep 17 00:00:00 2001 From: Domagoj Kriskovic Date: Wed, 15 Jan 2025 10:26:52 +0100 Subject: [PATCH] Add comment option in editor toolbar (#22849) * Add comment option in editor toolbar * move addComment to commands GitOrigin-RevId: 690b70f67abe5653f28ec9ec61deb3f201a78131 --- .../source-editor/components/toolbar/toolbar-items.tsx | 10 ++++++++++ .../source-editor/extensions/toolbar/commands.ts | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/services/web/frontend/js/features/source-editor/components/toolbar/toolbar-items.tsx b/services/web/frontend/js/features/source-editor/components/toolbar/toolbar-items.tsx index 52ec88e2e2..0fea34bc6a 100644 --- a/services/web/frontend/js/features/source-editor/components/toolbar/toolbar-items.tsx +++ b/services/web/frontend/js/features/source-editor/components/toolbar/toolbar-items.tsx @@ -12,6 +12,7 @@ import { MathDropdown } from './math-dropdown' import { TableInserterDropdown } from './table-inserter-dropdown' import { withinFormattingCommand } from '@/features/source-editor/utils/tree-operations/formatting' import { bsVersion } from '@/features/utils/bootstrap-5' +import { isSplitTestEnabled } from '@/utils/splitTestUtils' const isMac = /Mac/.test(window.navigator?.platform) @@ -124,6 +125,15 @@ export const ToolbarItems: FC<{ command={commands.wrapInHref} icon={bsVersion({ bs5: 'add_link', bs3: 'link' })} /> + {isSplitTestEnabled('review-panel-redesign') && ( + + )} { } return true } + +export const addComment = () => { + window.dispatchEvent(new Event('add-new-review-comment')) +}