arya2004/cmt-autofill

Improve User Feedback in the Popup

オープン

#5 opened on 2025/10/02

 (1 件のコメント) (0 件のリアクション) (1 人の担当者)JavaScript (11 件のフォーク)auto 404
good first issuehacktoberfesthacktoberfest-acceptedhtmljavascript

Repository metrics

Stars
 (6 個のスター)
PR merge metrics
 (PR metrics pending)

説明

The extension uses alert() to notify the user when authors are saved or when errors occur. This can be disruptive. Improve the user experience by displaying these messages inside the popup interface itself, as dismissible messages or notification banners.

File to modify: popup.js

How to do it: Replace alert() calls with a function that creates and appends a temporary message element to the popup's body.

Example:

function showMessage(msg, isError = false) {
  const el = document.createElement('div');
  el.textContent = msg;
  el.className = isError ? 'popup-message error' : 'popup-message success';
  document.body.appendChild(el);
  setTimeout(() => el.remove(), 2500);
}
// Replace alert('Saved!') with:
showMessage('Authors saved!');
// ...and for errors:
showMessage('An error occurred', true);

Also, add basic styles to your popup CSS.

コントリビューターガイド