diff --git a/src/components/Badge.tsx b/src/components/Badge.tsx index 48b6221..03c20a3 100644 --- a/src/components/Badge.tsx +++ b/src/components/Badge.tsx @@ -60,7 +60,7 @@ const Badge = ({ text, type, data }: BadgeProps) => { {PopupComponent && data && (
diff --git a/src/lib/enhancers/github/GitHubIssueAppendEnhancer.tsx b/src/lib/enhancers/github/GitHubIssueAppendEnhancer.tsx index bbb9d75..afc57a0 100644 --- a/src/lib/enhancers/github/GitHubIssueAppendEnhancer.tsx +++ b/src/lib/enhancers/github/GitHubIssueAppendEnhancer.tsx @@ -91,7 +91,7 @@ export class GitHubIssueAppendEnhancer - #{spot.number} |{" "} + #{spot.number}{" "} - New |{" "} + <draft>{" "} " } buildUrl(spot: GitHubIssueCreateSpot): string { diff --git a/src/lib/enhancers/github/GitHubPrAppendEnhancer.tsx b/src/lib/enhancers/github/GitHubPrAppendEnhancer.tsx index aff5118..621eb1e 100644 --- a/src/lib/enhancers/github/GitHubPrAppendEnhancer.tsx +++ b/src/lib/enhancers/github/GitHubPrAppendEnhancer.tsx @@ -1,4 +1,4 @@ -import { FeedPullRequestOpenIcon } from "@primer/octicons-react" +import { GitPullRequestIcon } from "@primer/octicons-react" import OverType, { type OverTypeInstance } from "overtype" import type React from "react" import type { @@ -87,10 +87,10 @@ export class GitHubPrAppendEnhancer return ( <> - + - #{spot.number} |{" "} + #{spot.number}{" "} - + - New |{" "} + <draft>{" "} " } buildUrl(spot: GitHubPrCreateSpot): string { diff --git a/tests/lib/enhancers/__snapshots__/gh-ui.test.ts.snap b/tests/lib/enhancers/__snapshots__/gh-ui.test.ts.snap index 656c5f3..f9c2a7c 100644 --- a/tests/lib/enhancers/__snapshots__/gh-ui.test.ts.snap +++ b/tests/lib/enhancers/__snapshots__/gh-ui.test.ts.snap @@ -16,7 +16,6 @@ exports[`github ui > gh_issue:should render correct UI elements 1`] = ` # 523 - | gh_issue_edit:should render correct UI elements 1`] = ` # 56 - | gh_issue_edit_multiple:should render correct UI elements 1` # 3 - | gh_issue_new:should render correct UI elements 1`] = ` /> - New | + <draft> gh_pr:should render correct UI elements 1`] = ` - # 517 - | gh_pr_edit:should render correct UI elements 1`] = ` - # 58 - | gh_pr_edit_multiple:should render correct UI elements 1`] = - # 5 - | gh_pr_new:should render correct UI elements 1`] = ` - - New | + <draft> { const [drafts] = useState(generateMockDrafts()) diff --git a/tests/playground/replicaData.tsx b/tests/playground/claudeData.tsx similarity index 100% rename from tests/playground/replicaData.tsx rename to tests/playground/claudeData.tsx diff --git a/tests/playground/replica.tsx b/tests/playground/replica.tsx index f866587..5a2bf1d 100644 --- a/tests/playground/replica.tsx +++ b/tests/playground/replica.tsx @@ -2,7 +2,9 @@ import { PopupRoot } from "@/components/PopupRoot" import type { CommentStorage, CommentTableRow } from "@/entrypoints/background" import type { CommentSpot } from "@/lib/enhancer" import type { GitHubIssueAppendSpot } from "@/lib/enhancers/github/GitHubIssueAppendEnhancer" +import type { GitHubIssueCreateSpot } from "@/lib/enhancers/github/GitHubIssueCreateEnhancer" import type { GitHubPrAppendSpot } from "@/lib/enhancers/github/GitHubPrAppendEnhancer" +import type { GitHubPrCreateSpot } from "@/lib/enhancers/github/GitHubPrCreateEnhancer" const gh_pr: GitHubPrAppendSpot = { domain: "github.com", @@ -12,6 +14,15 @@ const gh_pr: GitHubPrAppendSpot = { type: "GH_PR_APPEND", unique_key: "github.com:diffplug/selfie:517", } +const gh_pr_new: GitHubPrCreateSpot = { + base: "main", + domain: "github.com", + head: "cavia-porcellus:selfie:main", + slug: "diffplug/selfie", + title: "Update README.md", + type: "GH_PR_CREATE", + unique_key: "github.com:diffplug/selfie:main...cavia-porcellus:selfie:main", +} const gh_issue: GitHubIssueAppendSpot = { domain: "github.com", number: 523, @@ -20,8 +31,15 @@ const gh_issue: GitHubIssueAppendSpot = { type: "GH_ISSUE_APPEND", unique_key: "github.com:diffplug/selfie:523", } +const gh_issue_new: GitHubIssueCreateSpot = { + domain: "github.com", + slug: "diffplug/gitcasso", + title: "New issue title", + type: "GH_ISSUE_CREATE", + unique_key: "github.com:diffplug/gitcasso:new", +} -const spots: CommentSpot[] = [gh_pr, gh_issue] +const spots: CommentSpot[] = [gh_pr, gh_pr_new, gh_issue, gh_issue_new] const sampleSpots: CommentStorage[] = spots.map((spot) => { const state: CommentStorage = { drafts: [[0, "Lorem ipsum dolor sit amet, consectetur adipiscing elit."]],