Skip to content

Commit cf575a7

Browse files
committed
fix(shortcut): update selectors again
1 parent f1f6ac7 commit cf575a7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

shortcut.user.js

Lines changed: 6 additions & 3 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("bdi.js-issue-title.markdown-title").innerText;
44+
const title = document.querySelector("div[data-component=TitleArea] .text-normal.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,7 +62,10 @@ 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.querySelector("span.State").innerText.trim().toUpperCase();
65+
const state = document
66+
.querySelector("div[data-component=TitleArea] div[data-component=PH_LeadingVisual] span")
67+
.innerText.trim()
68+
.toUpperCase();
6669

6770
return { title, commits, labels, author, authoredByMe, hasLinuxRebuilds, hasDarwinRebuilds, state };
6871
};
@@ -118,7 +121,7 @@ const setupPrPage = async () => {
118121
if (match === null) return;
119122

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

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

0 commit comments

Comments
 (0)