Merge pull request #35514 from overleaf/worktree-mg-comment-fix

Split add-comment to own extension and always register command

GitOrigin-RevId: 2e25643b7fe4ff30693479975945d94cc586bd61
This commit is contained in:
Malik Glossop
2026-09-17 11:27:36 +00:00
committed by Copybot
parent c65a630438
commit bbbbc49bc0
9 changed files with 116 additions and 90 deletions
@@ -217,6 +217,38 @@ describe('<EditorFloatingMenu />', function () {
})
})
describe('adding a comment with the floating menu disabled', function () {
describe('when migrationEnabled is true', function () {
it('still creates a pending comment via the command', function () {
mountEditor({ migrationEnabled: true, floatingMenu: false })
// The quick-actions popup stays hidden...
cy.get('.editor-floating-menu').should('not.exist')
// The toolbar / menu / shortcut path (all dispatch this event) works.
cy.window().then(win => {
win.dispatchEvent(new Event('add-new-review-comment'))
})
cy.get('.ol-cm-change-c').should('exist')
})
})
describe('when migrationEnabled is false', function () {
it('still creates a pending comment via the command (legacy tooltip)', function () {
mountEditor({ migrationEnabled: false, floatingMenu: false })
cy.get('.review-tooltip-menu').should('not.exist')
cy.window().then(win => {
win.dispatchEvent(new Event('add-new-review-comment'))
})
cy.get('.ol-cm-change-c').should('exist')
})
})
})
describe('bulk tracked-change actions', function () {
beforeEach(function () {
mountEditorWithChanges()