Skip to content

Commit

Permalink
Fix selectors for new GitHub issue design
Browse files Browse the repository at this point in the history
  • Loading branch information
filiptronicek committed Feb 11, 2025
1 parent 8236955 commit 9ce965a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/button/button-contributions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export interface ButtonContributionParams {
/**
* Additional class names that should be added to the elements.
*/
additionalClassNames?: ("secondary" | "medium" | "left-align-menu")[];
additionalClassNames?: ("secondary" | "medium" | "left-align-menu" | "tall")[];

/**
* A selector that is used to insert the button before a specific element.
Expand Down Expand Up @@ -301,7 +301,7 @@ export const buttonContributions: ButtonContributionParams[] = [
},

{
id: "gh-issues",
id: "gh-issue",
exampleUrls: ["https://github.com/svenefftinge/browser-extension-test/issues/1"],
selector: "#partial-discussion-header > div.gh-header-show > div > div",
containerElement: createElement("div", {
Expand All @@ -319,7 +319,17 @@ export const buttonContributions: ButtonContributionParams[] = [
],
},
{
id: "gh-pulls",
id: "gh-issue-new", // this isn't referring to "new issue", but to new "issue"
exampleUrls: ["https://github.com/svenefftinge/browser-extension-test/issues/1"],
selector: `xpath://*[@id="js-repo-pjax-container"]/react-app/div/div/div/div/div[1]/div/div/div[3]/div`,
containerElement: createElement("div", {}),
insertBefore: `xpath://*[@id="js-repo-pjax-container"]/react-app/div/div/div/div/div[1]/div/div/div[3]/div/div`,
application: "github",
// we need to make the button higher: the buttons here use 2rem instead of 1.75rem
additionalClassNames: ["tall"],
},
{
id: "gh-pull",
exampleUrls: ["https://github.com/svenefftinge/browser-extension-test/pull/2"],
selector: "#partial-discussion-header > div.gh-header-show > div > div",
containerElement: createElement("div", {
Expand Down
4 changes: 4 additions & 0 deletions src/button/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@
--dropdown-box-shadow: var(--shadow-floating-large, var(--color-shadow-large));
}

.github.tall {
--primary-height: var(--control-medium-size, 2rem);
}

.github .chevron-icon {
padding: 3px;
}
Expand Down

0 comments on commit 9ce965a

Please sign in to comment.