Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
16 changes: 13 additions & 3 deletions test/src/button-contributions-copy.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
6 changes: 2 additions & 4 deletions test/src/button-contributions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ describe("Platform match tests", function () {

before(async function () {
browser = await puppeteer.launch({
headless: true,
browser: "chrome",
headless: "new",
});
page = await browser.newPage();
});
Expand Down Expand Up @@ -66,8 +65,7 @@ describe("Query Selector Tests", function () {

before(async function () {
browser = await puppeteer.launch({
headless: true,
browser: "chrome",
headless: "new",
});
page = await browser.newPage();
});
Expand Down
Loading