diff --git a/services/web/app/src/Features/Project/ProjectController.mjs b/services/web/app/src/Features/Project/ProjectController.mjs
index b9be98b3f0..fc2710799f 100644
--- a/services/web/app/src/Features/Project/ProjectController.mjs
+++ b/services/web/app/src/Features/Project/ProjectController.mjs
@@ -515,7 +515,6 @@ const _ProjectController = {
'command-palette',
'overleaf-library',
'focus-mode',
- 'editor-upgrade-button-relocation',
'markdown-visual',
'ai-disabled-collaborators',
'group-link-sharing',
diff --git a/services/web/frontend/js/features/ide-react/components/toolbar/toolbar.tsx b/services/web/frontend/js/features/ide-react/components/toolbar/toolbar.tsx
index ccdf791918..5314b3b9d3 100644
--- a/services/web/frontend/js/features/ide-react/components/toolbar/toolbar.tsx
+++ b/services/web/frontend/js/features/ide-react/components/toolbar/toolbar.tsx
@@ -31,9 +31,6 @@ export const Toolbar = () => {
const { cobranding, isRestrictedTokenMember } = useEditorContext()
const { permissionsLevel } = useIdeReactContext()
const showUpgradePrompt = getMeta('ol-showUpgradePrompt')
- const upgradeButtonRelocation = useFeatureFlag(
- 'editor-upgrade-button-relocation'
- )
const improvedFlakyConnections = useFeatureFlag(
'intermittent-connection-improvements'
)
@@ -131,7 +128,7 @@ export const Toolbar = () => {
- {showUpgradePrompt && upgradeButtonRelocation && }
+ {showUpgradePrompt && }
@@ -147,7 +144,6 @@ export const Toolbar = () => {
)}
- {showUpgradePrompt && !upgradeButtonRelocation && }
diff --git a/services/web/test/frontend/features/ide-react/unit/toolbar.spec.tsx b/services/web/test/frontend/features/ide-react/unit/toolbar.spec.tsx
index b12c2511ff..0086db6220 100644
--- a/services/web/test/frontend/features/ide-react/unit/toolbar.spec.tsx
+++ b/services/web/test/frontend/features/ide-react/unit/toolbar.spec.tsx
@@ -251,6 +251,42 @@ describe('', function () {
// TODO: Test all the dynamic items
})
+ describe('upgrade button', function () {
+ afterEach(function () {
+ cy.window().then(win => {
+ win.metaAttributesCache.delete('ol-showUpgradePrompt')
+ })
+ })
+
+ const mountWithUpgradePrompt = (showUpgradePrompt: boolean) => {
+ cy.window().then(win => {
+ win.metaAttributesCache.set('ol-showUpgradePrompt', showUpgradePrompt)
+ })
+ cy.mount(
+
+
+
+ )
+ }
+
+ it('shows the upgrade button in the menu bar when the upgrade prompt is enabled', function () {
+ mountWithUpgradePrompt(true)
+ // Shown in the left-hand menu bar (the shipped position)...
+ cy.get('.ide-redesign-toolbar-menu').within(() => {
+ cy.findByRole('link', { name: 'Upgrade' }).should('be.visible')
+ })
+ // ...and no longer in the top-right actions area
+ cy.get('.ide-redesign-toolbar-actions').within(() => {
+ cy.findByRole('link', { name: 'Upgrade' }).should('not.exist')
+ })
+ })
+
+ it('does not show the upgrade button when the upgrade prompt is disabled', function () {
+ mountWithUpgradePrompt(false)
+ cy.findByRole('link', { name: 'Upgrade' }).should('not.exist')
+ })
+ })
+
describe('offline gating', function () {
const offlineIndicatorText = 'You’re offline'