Skip to content

Commit

Permalink
removes all generative AI features
Browse files Browse the repository at this point in the history
  • Loading branch information
bdougie committed Aug 16, 2024
1 parent a3efbb1 commit 292534b
Show file tree
Hide file tree
Showing 9 changed files with 144 additions and 599 deletions.
49 changes: 0 additions & 49 deletions src/content-scripts/components/AICodeReview/AICodeReviewButton.ts

This file was deleted.

133 changes: 0 additions & 133 deletions src/content-scripts/components/AICodeReview/AICodeReviewMenu.ts

This file was deleted.

41 changes: 1 addition & 40 deletions src/content-scripts/github.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,19 @@
import {
getGithubUsername,
isGithubProfilePage,
isGithubPullRequestPage,
isGithubRepoPage,
isPullRequestCreatePage,
isPullRequestFilesChangedPage,
} from "../utils/urlMatchers";
import { isOpenSaucedUser } from "../utils/fetchOpenSaucedApiData";
import injectViewOnOpenSauced from "../utils/dom-utils/viewOnOpenSauced";
import injectInviteToOpenSauced from "../utils/dom-utils/inviteToOpenSauced";
import { prefersDarkMode } from "../utils/colorPreference";
import injectAddPRToHighlightsButton from "../utils/dom-utils/addPRToHighlights";

// import injectRepoVotingButtons from "../utils/dom-utils/repoVotingButtons";
import domUpdateWatch from "../utils/dom-utils/domUpdateWatcher";
import injectChangeSuggestorButton from "../utils/dom-utils/changeSuggestorButton";
import prEditWatch, { prReviewWatch } from "../utils/dom-utils/prWatcher";
import injectChatDialog from "../utils/dom-utils/addChatDialog";
import { pageUrlWatch } from "../utils/dom-utils/pageUrlWatcher";

const processGithubPage = async () => {
if (prefersDarkMode(document.cookie)) {
document.documentElement.classList.add("dark");
}
if (isPullRequestCreatePage(window.location.href)) {
// void injectDescriptionGeneratorButton();
} else if (isPullRequestFilesChangedPage(window.location.href)) {
prReviewWatch(injectChangeSuggestorButton, 500);
} else if (isGithubPullRequestPage(window.location.href)) {
prEditWatch(injectChangeSuggestorButton, 500);
// void injectDescriptionGeneratorButton();
void injectAddPRToHighlightsButton();
} else if (isGithubProfilePage(window.location.href)) {
if (isGithubProfilePage(window.location.href)) {
const username = getGithubUsername(window.location.href);

if (!username) {
Expand All @@ -42,29 +24,8 @@ const processGithubPage = async () => {
} else {
injectInviteToOpenSauced(username);
}
} else if (isGithubRepoPage(window.location.href)) {
const ownerName = getGithubUsername(window.location.href) ?? "";
const repoName = window.location.href.split("/").pop() ?? "";

await injectChatDialog(ownerName, repoName);

pageUrlWatch(() => {
if (document.getElementById("repo-query-root")) {
document.getElementById("repo-query-root")?.remove();
}
}, 50);
}

/*
* commenting out repo voting because it's not ready yet // issue #106
* } else if (isGithubRepoPage(window.location.href)) {
* const ownerName = getGithubUsername(window.location.href) ?? "";
* const repoName = window.location.href.split("/").pop() ?? "";
*
* await injectRepoVotingButtons(ownerName, repoName);
* }
*/

domUpdateWatch(processGithubPage, 50);
};

Expand Down
Loading

0 comments on commit 292534b

Please sign in to comment.