Skip to content

Commit 63847a3

Browse files
committed
revert: fix(shortcut): update selectors again
Reverts: cf575a7
1 parent ea1958c commit 63847a3

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

shortcut.user.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const query = async (doc, sel) => {
4141
};
4242

4343
const getPrDetails = pr => {
44-
const title = document.querySelector("div[data-component=TitleArea] .text-normal.markdown-title").innerText;
44+
const title = document.querySelector("bdi.js-issue-title.markdown-title").innerText;
4545
const commits = [...document.querySelectorAll(".TimelineItem-body a.markdown-title[href*='/commits/']")].flatMap(
4646
({ title, href }) => {
4747
const match = /\/NixOS\/nixpkgs\/pull\/(\d+)\/commits\/([0-9a-f]+)$/i.exec(href);
@@ -62,10 +62,7 @@ const getPrDetails = pr => {
6262
const authoredByMe = author === self;
6363
const hasLinuxRebuilds = !labels.some(l => /rebuild-linux: 0$/.test(l));
6464
const hasDarwinRebuilds = !labels.some(l => /rebuild-darwin: 0$/.test(l));
65-
const state = document
66-
.querySelector("div[data-component=TitleArea] div[data-component=PH_LeadingVisual] span")
67-
.innerText.trim()
68-
.toUpperCase();
65+
const state = document.querySelector("span.State").innerText.trim().toUpperCase();
6966

7067
return { title, commits, labels, author, authoredByMe, hasLinuxRebuilds, hasDarwinRebuilds, state };
7168
};
@@ -121,7 +118,7 @@ const setupPrPage = async () => {
121118
if (match === null) return;
122119

123120
const pr = match[1];
124-
const actions = await query(document, "div[data-component=PH_Actions]");
121+
const actions = await query(document, ".gh-header-show .gh-header-actions");
125122

126123
if (actions.querySelector(".run-nixpkgs-review") === null) {
127124
const btn = document.createElement("button");

0 commit comments

Comments
 (0)