Resolving WIP Status of merge request does not update window title

Problem

When a user marks a MR as ready by clicking on the "Mark as ready" button in the MR widget, the title of the merge request on the page is updated, but the window title in the browser still has the Draft: mention included.

image.png

Proposal

The window title should correctly update at the same time as the merge request name in the UI.

Possible fixes

Add document.title = document.title.replace('Draft: ', ''); after line 156 of app/assets/javascripts/merge_request.js.

diff --git a/app/assets/javascripts/merge_request.js b/app/assets/javascripts/merge_request.js
index 03bfc4a9602e..8fa0c2e2381f 100644
--- a/app/assets/javascripts/merge_request.js
+++ b/app/assets/javascripts/merge_request.js
@@ -154,6 +154,7 @@ MergeRequest.toggleDraftStatus = function (title, isReady) {
 
   if (titleEl) {
     titleEl.textContent = title;
+    document.title = document.title.replace('Draft: ', '');
   }
 
   const draftToggles = document.querySelectorAll('.js-draft-toggle-button');
Edited Jan 16, 2025 by Marcel van Remmerden
Assignee Loading
Time tracking Loading