authorgravatar for 97427849+flamboh@users.noreply.github.comoliver <97427849+flamboh@users.noreply.github.com> 2026-09-21 14:58:23-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-21 14:58:23-07:00
log2c2fa8cd7ded97be76587ae1cfce54ee0a65f544
tree45dfdb86e724ec402a304fade5b0ab94a1749285
parent33cb911ceb89d55b812f486d4e001d0f86d77680
signature Signed by PGP key B5690EEEBB952194

fix(web): pull request embed chip shows the state icon (#12951)


1 files changed, 5 insertions(+), 4 deletions(-)

apps/web/src/components/contextChipParts.tsx+5-4
...@@ -9,7 +9,7 @@ import {...@@ -9,7 +9,7 @@ import {
9} from "react";9} from "react";
1010
11import { cn } from "~/lib/utils";11import { cn } from "~/lib/utils";
12import { PullRequestGlyph } from "~/components/pullRequest/pullRequestIcons";12import { PULL_REQUEST_STATE_PRESENTATION } from "~/components/pullRequest/pullRequestIcons";
13import { PierreEntryIcon } from "./chat/PierreEntryIcon";13import { PierreEntryIcon } from "./chat/PierreEntryIcon";
14import {14import {
15 COMPOSER_INLINE_CHIP_ICON_CLASS_NAME,15 COMPOSER_INLINE_CHIP_ICON_CLASS_NAME,
...@@ -123,6 +123,9 @@ export function PullRequestChip(props: {...@@ -123,6 +123,9 @@ export function PullRequestChip(props: {
123 onOpen: (event: MouseEvent<HTMLElement>, url: string) => void;123 onOpen: (event: MouseEvent<HTMLElement>, url: string) => void;
124}) {124}) {
125 const previewTarget = usePullRequestPreviewTarget(props.environmentId, props.metadata.url);125 const previewTarget = usePullRequestPreviewTarget(props.environmentId, props.metadata.url);
126 const displayState =
127 props.metadata.state === "open" && props.metadata.isDraft ? "draft" : props.metadata.state;
128 const StateIcon = PULL_REQUEST_STATE_PRESENTATION[displayState].Icon;
126 const button = (129 const button = (
127 <Button130 <Button
128 variant="chip"131 variant="chip"
...@@ -136,9 +139,7 @@ export function PullRequestChip(props: {...@@ -136,9 +139,7 @@ export function PullRequestChip(props: {
136 data-markdown-copy={props.copyMarkdown}139 data-markdown-copy={props.copyMarkdown}
137 onClick={(event) => props.onOpen(event, props.metadata.url)}140 onClick={(event) => props.onOpen(event, props.metadata.url)}
138 >141 >
139 <PullRequestGlyph.pullRequest142 <StateIcon className={cn(COMPOSER_INLINE_CHIP_ICON_CLASS_NAME, "size-3.5")} />
140 className={cn(COMPOSER_INLINE_CHIP_ICON_CLASS_NAME, "size-3.5")}
141 />
142 <span className={props.labelClassName}>{props.label}</span>143 <span className={props.labelClassName}>{props.label}</span>
143 </Button>144 </Button>
144 );145 );