Skip to content

Commit 684a327

Browse files
committed
chore: update version to 6.4 and enhance styling for PR selection container
1 parent c474e97 commit 684a327

1 file changed

Lines changed: 44 additions & 5 deletions

File tree

MergeDependabotPRs.user.js

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ==UserScript==
22
// @name Auto-Merge Dependabot PRs
33
// @namespace typpi.online
4-
// @version 6.3
4+
// @version 6.4
55
// @description Merges Dependabot PRs in any of your repositories - pulls the PRs into a table and lets you select which ones to merge.
66
// @author Nick2bad4u
77
// @match https://github.com/notifications
@@ -20,7 +20,7 @@
2020
// @downloadURL https://update.greasyfork.org/scripts/525498/Auto-Merge%20Dependabot%20PRs.user.js
2121
// @updateURL https://update.greasyfork.org/scripts/525498/Auto-Merge%20Dependabot%20PRs.meta.js
2222
// ==/UserScript==
23-
/* global GM_getValue, GM_setValue, GM_xmlhttpRequest */
23+
/* global GM_getValue, GM_setValue, GM_addStyle, GM_xmlhttpRequest */
2424
// @var number merge_delay "Delay between merge requests in milliseconds" 2000
2525

2626
(async function () {
@@ -727,9 +727,7 @@
727727
}, 5000);
728728
}
729729

730-
const style = document.createElement('style');
731-
document.head.appendChild(style);
732-
style.textContent = `
730+
const mainCSS = `
733731
.merge-button, mergebutton, body > div.pr-selection-container > button {
734732
position: fixed;
735733
bottom: 10px;
@@ -779,8 +777,49 @@
779777
}
780778
.merge-button {
781779
transition: background-color 0.3s ease;
780+
}
781+
.pr-selection-container {
782+
position: fixed;
783+
bottom: 50px;
784+
right: 10px;
785+
z-index: 1000;
786+
background-color: #79e4f2;
787+
color: #000000;
788+
padding: 10px;
789+
border: 1px solid #ccc;
790+
max-height: 300px;
791+
overflow-y: auto;
792+
min-width: 350px;
793+
box-sizing: border-box;
794+
box-shadow: 0 2px 8px rgba(0,0,0,0.15);
795+
}
796+
.pr-selection-close {
797+
display: inline-block;
798+
width: 32px;
799+
height: 32px;
800+
line-height: 32px;
801+
text-align: center;
802+
position: absolute;
803+
top: 2px;
804+
right: 6px;
805+
cursor: pointer;
806+
font-weight: bold;
807+
color: #333;
808+
background: none;
809+
border: none;
810+
font-size: 1.2em;
811+
padding: 0;
782812
}
783813
`;
814+
if (typeof GM_addStyle === 'function') {
815+
GM_addStyle(mainCSS);
816+
} else {
817+
// fallback for environments without GM_addStyle
818+
const fallbackStyle = document.createElement('style');
819+
fallbackStyle.textContent = mainCSS;
820+
document.head.appendChild(fallbackStyle);
821+
}
822+
784823
window.addEventListener('load', addButton);
785824

786825
function showConfigPanel() {

0 commit comments

Comments
 (0)