GitLab - Default Add Comment

Makes "Add comment now" the default action in GitLab and remove the Start a Review

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

Yazar
squiter
Günlük kurulumlar
0
Toplam kurulumlar
1
Değerlendirmeler
0 0 0
Versiyon
1.0
Oluşturulma
20.02.2026
Güncellenme
20.02.2026
Boyut
1,88 KB
Lisans
MIT
Geçerli

What this script does

GitLab normally defaults to Start a review, which makes pressing Enter start a review instead of posting a comment immediately.

This userscript changes that behavior by:

  • Hiding the Start a review button
  • Making Add comment now the default action
  • Pressing Enter submits the comment
  • Pressing Shift + Enter inserts a newline (normal markdown behavior)

The script works on GitLab merge request discussions and comment forms.


Why this exists

Many users prefer fast single comments instead of review mode.
This script optimizes the workflow to behave more like chat or GitHub-style commenting.


Technical details

  • Uses stable data-testid selectors when available.
  • Uses a MutationObserver because GitLab is a Vue SPA and frequently re-renders the DOM.
  • The script does not bypass GitLab logic — it clicks GitLab’s own button, so validation and quick actions still work normally.

Compatibility

✔ GitLab.com
✔ Most self-hosted GitLab instances (if URL match is adjusted)

Tested with the modern GitLab UI (Vue-based editor).


Known limitations

  • GitLab UI updates may break selectors in the future.
  • The script only acts when the comment button is enabled.
  • If another extension modifies GitLab comments, conflicts are possible.

Safety

This script:

  • Does not send data anywhere
  • Does not modify network requests
  • Runs entirely locally in your browser

Customization

If you want different behavior:

  • Change Enter to submit only with Ctrl/Cmd
  • Keep Start Review visible
  • Enable/disable per page

Feel free to fork and modify.