fix(desktop): one git glyph on the composer's coding row, with the PR number leading

The branch's PR chip carried its own pull-request icon next to the row's
branch glyph, so the strip opened with two git marks in a row. The chip now
takes showIcon, and the coding row renders it glyph-less and ahead of the
branch name — the leading branch icon covers both, and the row reads
icon → #number → branch. Sidebar rows keep the full chip.
This commit is contained in:
Brooklyn Nicholson 2026-08-12 20:34:58 -05:00
parent c5097da12b
commit 985594aaa3
2 changed files with 20 additions and 6 deletions

View File

@ -220,6 +220,11 @@ export const CodingStatusRow = memo(function CodingStatusRow({
}
>
<div className="flex min-w-0 flex-1 items-center gap-1">
{/* PR number first, right against the leading git glyph the chip
borrows that icon instead of carrying a second one of its own
(`showIcon={false}`), so the row reads glyph #number branch. */}
{pr && <PrTag pr={pr} showIcon={false} />}
{/* Branch name the other half of the review-pane target. `contents`
so the button lays out nothing of its own: the label stays the
same flex child it always was, and the hit area is the text. */}
@ -229,8 +234,6 @@ export const CodingStatusRow = memo(function CodingStatusRow({
</span>
</button>
{pr && <PrTag pr={pr} />}
{/* Worktree path + copy plain muted text, not a chip. Always in the
flex so hover doesn't reflow the row; opacity alone reveals the
pair. The path sizes to its content (the `flex-1` lives on the

View File

@ -22,8 +22,18 @@ export function openPullRequest(pr: HermesBranchPullRequest): void {
/** The branch's PR as a row chip: state glyph plus number, tooltipped with the
* title, and a link to the PR on click. Identity like {@link ProfileTag}
* never a status dot. */
export function PrTag({ className, pr }: { className?: string; pr: HermesBranchPullRequest }) {
* never a status dot. `showIcon={false}` drops the glyph for rows that already
* lead with a git icon the number can sit against (the composer's coding row),
* so the chip doesn't stack a second one beside it. */
export function PrTag({
className,
pr,
showIcon = true
}: {
className?: string
pr: HermesBranchPullRequest
showIcon?: boolean
}) {
const style = PR_STYLE[pullRequestBucket(pr)] ?? PR_STYLE.open
return (
@ -51,8 +61,9 @@ export function PrTag({ className, pr }: { className?: string; pr: HermesBranchP
onPointerDown={event => event.stopPropagation()}
type="button"
>
<Codicon name={style.icon} size="0.75rem" />
<span className="underline-offset-1 group-hover/pr:underline">{pr.number}</span>
{showIcon && <Codicon name={style.icon} size="0.75rem" />}
{/* Without the glyph the number needs the `#` to still read as a PR. */}
<span className="underline-offset-1 group-hover/pr:underline">{showIcon ? pr.number : `#${pr.number}`}</span>
</button>
</Tip>
)