From c94bf93dd0cf6848ebaf198915d4b58aefb95c5a Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Mon, 29 Sep 2025 20:06:40 -0700 Subject: [PATCH 1/5] Add `GH_PR_CREATE` and `GH_ISSUE_CREATE` to the playground replica. --- tests/playground/replica.tsx | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) 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."]], From dfd00367a7c359abd36874bffa315bbaa44e67c7 Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Mon, 29 Sep 2025 23:33:48 -0700 Subject: [PATCH 2/5] Rename `replicaData` to `claudeData` since it was confusingly only used by the claude prototype. --- tests/playground/claude.tsx | 2 +- tests/playground/{replicaData.tsx => claudeData.tsx} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename tests/playground/{replicaData.tsx => claudeData.tsx} (100%) diff --git a/tests/playground/claude.tsx b/tests/playground/claude.tsx index df846d3..dd8fbc8 100644 --- a/tests/playground/claude.tsx +++ b/tests/playground/claude.tsx @@ -7,7 +7,7 @@ import { allLeafValues, timeAgo } from "@/components/misc" import type { CommentTableRow } from "@/entrypoints/background" import type { FilterState } from "@/entrypoints/popup/popup" import { EnhancerRegistry } from "@/lib/registries" -import { generateMockDrafts } from "./replicaData" +import { generateMockDrafts } from "./claudeData" export const ClaudePrototype = () => { 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 From 7db63a0d729e8513ef544f9d7739aa28f9c75600 Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Mon, 29 Sep 2025 23:45:18 -0700 Subject: [PATCH 3/5] Update icon and use `` and `` as our placeholders. --- .../github/GitHubIssueAppendEnhancer.tsx | 2 +- .../github/GitHubIssueCreateEnhancer.tsx | 9 ++++----- .../github/GitHubPrAppendEnhancer.tsx | 6 +++--- .../github/GitHubPrCreateEnhancer.tsx | 15 +++++++-------- .../enhancers/__snapshots__/gh-ui.test.ts.snap | 18 ++++++------------ 5 files changed, 21 insertions(+), 29 deletions(-) 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}{" "} -{ + implements CommentEnhancer { forSpotTypes(): string[] { return [GH_ISSUE_CREATE] } @@ -81,7 +80,7 @@ export class GitHubIssueCreateEnhancer - 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}{" "} -{ + implements CommentEnhancer { forSpotTypes(): string[] { return [GH_PR_CREATE] } @@ -93,10 +92,10 @@ export class GitHubPrCreateEnhancer return ( <> - + - 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> Date: Tue, 30 Sep 2025 00:04:31 -0700 Subject: [PATCH 4/5] right-align the badge popups for better screenshots. --- src/components/Badge.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 && (
From 7af1cd4c87a07fc469d1023e69bfe649aacfa31c Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Tue, 30 Sep 2025 00:05:18 -0700 Subject: [PATCH 5/5] format fixup --- src/lib/enhancers/github/GitHubIssueCreateEnhancer.tsx | 3 ++- src/lib/enhancers/github/GitHubPrCreateEnhancer.tsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/enhancers/github/GitHubIssueCreateEnhancer.tsx b/src/lib/enhancers/github/GitHubIssueCreateEnhancer.tsx index cd18810..4fb8d08 100644 --- a/src/lib/enhancers/github/GitHubIssueCreateEnhancer.tsx +++ b/src/lib/enhancers/github/GitHubIssueCreateEnhancer.tsx @@ -19,7 +19,8 @@ export interface GitHubIssueCreateSpot extends CommentSpot { } export class GitHubIssueCreateEnhancer - implements CommentEnhancer { + implements CommentEnhancer +{ forSpotTypes(): string[] { return [GH_ISSUE_CREATE] } diff --git a/src/lib/enhancers/github/GitHubPrCreateEnhancer.tsx b/src/lib/enhancers/github/GitHubPrCreateEnhancer.tsx index f58bea8..9125b7d 100644 --- a/src/lib/enhancers/github/GitHubPrCreateEnhancer.tsx +++ b/src/lib/enhancers/github/GitHubPrCreateEnhancer.tsx @@ -21,7 +21,8 @@ export interface GitHubPrCreateSpot extends CommentSpot { } export class GitHubPrCreateEnhancer - implements CommentEnhancer { + implements CommentEnhancer +{ forSpotTypes(): string[] { return [GH_PR_CREATE] }