Skip to content

Commit 874ffea

Browse files
donjor-agent[bot]rsi-pr-agent
authored andcommitted
fix(web): use shared primitives for GitHub issue controls (#1799)
## Problem Issue filters and warning notices bypass shared UI primitives. ## Change #1791 ui-consistency-1: render interactive Badge chips, preserving color, truncation, accessible names, and click isolation. #1791 ui-consistency-2: remove search height overrides. #1791 ui-consistency-3: verified GroupText fix already present in `2e655783ec`. #1791 ui-consistency-4: held with maintainer approval; upstream PullRequestGhosts GhostBar is static, while Skeleton adds continuous per-bar animation beyond the existing ancestor animation. #1791 ui-consistency-5: compose warning Alert and AlertDescription. #1793 ui-consistency-1: verified icon-xs fix already present in `2e655783ec`. Visible changes: Badge owns chip focus and hover; search uses the default Input height (0.5 spacing unit shorter); notices adopt Alert padding, radius, and text sizing. No upstream files changed. ## Scope and approval Maintainer explicitly approved this issue-free GitHub issue UI consistency cleanup and the Skeleton hold. The cited backfill PRs are review-only and remain untouched. ## Verification `vp lint apps/web/src/components/githubIssue/GitHubIssueChips.tsx apps/web/src/components/githubIssue/GitHubIssueListControls.tsx apps/web/src/routes/_chat.issues.tsx` → exit 0. `cd apps/web && vp run typecheck` → exit 0. `cd apps/web && vp run build` → exit 0. `vp run fork:ci` → exit 0; 63 files, 776 tests passed; 0 lint errors, 451 existing warnings. No test files changed; touched-test run not applicable. Host browser grounding: see Evidence. Implementation: GPT Sol via Pi; host: Claude Opus via Claude Code. ## Evidence Web client, dark, 1280x800, seeded dev data: `hyprws` vs all five fix branches merged. - Shows: filter bar at rest; label filter chip - No visible change at desktop width - Warning alert: not reachable with seeded data ![1799 before and after](https://github.com/user-attachments/assets/df9bd59a-b403-48f1-a75b-21f82e18f3b4) ## Fork trailers Squashes: - b92adaa fix(web): use shared primitives for GitHub issue controls (#1799) (#1799) - ac933b6 fixup! fix(web): use shared primitives for GitHub issue controls (#1799) (#1799) Fork-Domain: github-issues Fork-Tier: qol Fork-Upstreamable: no
1 parent 5238881 commit 874ffea

6 files changed

Lines changed: 39 additions & 35 deletions

File tree

‎apps/web/src/components/chat/GitHubDestinationLink.fork.tsx‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,8 @@ function GitHubDestinationLink({
235235
const label = destinationLabel(destination, linkTarget);
236236
const button = (
237237
<Button
238-
size="icon-micro"
238+
size="icon-xs"
239239
variant={preferred ? "ghost" : "ghost-muted"}
240-
className="size-7 [&_svg]:size-3.5"
241240
aria-label={`${label}${preferred ? ", default" : ""}`}
242241
onClick={(event) => {
243242
event.preventDefault();

‎apps/web/src/components/githubIssue/GitHubIssueChips.tsx‎

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import type { GitHubIssueLabel, GitHubIssueType } from "@t3tools/contracts";
2-
import type { MouseEvent, ReactNode } from "react";
2+
import type { CSSProperties, ReactNode } from "react";
33

44
import { cn } from "../../lib/utils";
5+
import { Badge } from "../ui/badge";
56
import { PullRequestLabelChip } from "../pullRequest/pullRequestPresentation";
67
import { pullRequestLabelColor } from "../pullRequest/pullRequestList.logic";
78
import { gitHubIssueTypeHexColor, gitHubIssueTypeLabel } from "./githubIssueChips.logic";
@@ -67,32 +68,39 @@ export function GitHubIssueChip({
6768
readonly children?: ReactNode;
6869
}) {
6970
const label = gitHubIssueChipName(kind, name);
70-
const chip = (
71+
const hex = gitHubIssueChipColor(kind, color);
72+
if (onFilter !== undefined) {
73+
return (
74+
<Badge
75+
size={size ?? "sm"}
76+
variant={hex ? "label" : "secondary"}
77+
className={cn("min-w-0 max-w-40 shrink justify-start", className)}
78+
{...(hex ? { style: { "--label": hex } as CSSProperties } : {})}
79+
render={
80+
<button
81+
type="button"
82+
aria-label={`Filter by ${label}`}
83+
onClick={(event) => {
84+
event.stopPropagation();
85+
onFilter();
86+
}}
87+
/>
88+
}
89+
>
90+
<span className="truncate">{label}</span>
91+
{children}
92+
</Badge>
93+
);
94+
}
95+
return (
7196
<PullRequestLabelChip
72-
label={{ name: label, color: gitHubIssueChipColor(kind, color) }}
97+
label={{ name: label, color: hex }}
7398
{...(size ? { size } : {})}
74-
className={cn(onFilter ? "max-w-full" : className)}
99+
className={cn(className)}
75100
>
76101
{children}
77102
</PullRequestLabelChip>
78103
);
79-
if (onFilter === undefined) return chip;
80-
return (
81-
<button
82-
type="button"
83-
aria-label={`Filter by ${label}`}
84-
className={cn(
85-
"relative inline-flex min-w-0 max-w-40 shrink cursor-pointer rounded-sm outline-none transition-opacity hover:opacity-80 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",
86-
className,
87-
)}
88-
onClick={(event: MouseEvent) => {
89-
event.stopPropagation();
90-
onFilter();
91-
}}
92-
>
93-
{chip}
94-
</button>
95-
);
96104
}
97105

98106
export function GitHubIssueLabelChip({

‎apps/web/src/components/githubIssue/GitHubIssueFilterBar.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ function GitHubIssueFilterRow({
175175
const count = filter.values.length;
176176
return (
177177
<Group className="max-w-full">
178-
<GroupText className="h-auto gap-1.5 rounded-md px-2 text-xs sm:text-xs">
178+
<GroupText>
179179
<FieldIcon className="size-3.5" />
180180
{field}
181181
</GroupText>

‎apps/web/src/components/githubIssue/GitHubIssueFilterPrimitives.fork.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export function ComboboxCollection(props: ComboboxPrimitive.Collection.Props) {
4040
export function GroupText({ className, render, ...props }: useRender.ComponentProps<"div">) {
4141
const defaultProps = {
4242
className: cn(
43-
"relative inline-flex items-center whitespace-nowrap gap-2 rounded-lg border border-input bg-muted not-dark:bg-clip-padding px-2.75 text-muted-foreground text-base sm:text-sm shadow-xs/5 outline-none transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[inherit] before:shadow-2xs before:shadow-black/6 dark:bg-input/64 dark:before:shadow-white/6 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 [&_svg]:-mx-0.5",
43+
"relative inline-flex items-center whitespace-nowrap gap-1.5 rounded-md border border-input bg-muted not-dark:bg-clip-padding px-2 text-muted-foreground text-xs shadow-xs/5 outline-none transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[inherit] before:shadow-2xs before:shadow-black/6 dark:bg-input/64 dark:before:shadow-white/6 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 [&_svg]:-mx-0.5",
4444
className,
4545
),
4646
"data-slot": "group-text",

‎apps/web/src/components/githubIssue/GitHubIssueListControls.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export function GitHubIssueSearchField({
5151
readonly className?: string;
5252
}) {
5353
return (
54-
<InputGroup className={cn("min-w-48 flex-1 **:[input]:h-9 sm:**:[input]:h-8", className)}>
54+
<InputGroup className={cn("min-w-48 flex-1", className)}>
5555
<InputGroupAddon>
5656
<SearchIcon aria-hidden />
5757
</InputGroupAddon>

‎apps/web/src/routes/_chat.issues.tsx‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,14 @@ import { WorkspacePageHeader } from "../components/WorkspacePageHeader";
5757
import { ProjectChooserScopeLabelFork } from "../components/ProjectChooserScopeLabel.fork"; // fork-hook: workspaces/chooser-scope-label
5858
import { RightPanelTabs } from "../components/RightPanelTabs";
5959
import { githubIssueSurface } from "../rightPanelStore.fork";
60+
import { Alert, AlertDescription } from "../components/ui/alert";
6061
import { Button } from "../components/ui/button";
6162
import { RefreshIcon } from "../components/ui/refresh-icon";
6263
import { Separator } from "../components/ui/separator";
6364
import { SidebarInset } from "../components/ui/sidebar";
6465
import { Spinner } from "../components/ui/spinner";
6566
import { isElectron } from "../env";
66-
import { useIsMobile } from "../hooks/useMediaQuery";
67+
import { useMediaQuery } from "../hooks/useMediaQuery";
6768
import { isTerminalFocused } from "../lib/terminalFocus";
6869
import { primaryServerKeybindingsAtom } from "../state/server";
6970
import { useProjects } from "../state/entities";
@@ -257,7 +258,7 @@ export function GitHubIssuesPage({
257258
};
258259
const updateFilters = (patch: IssuesSearchPatch) => updateSearch({ ...patch, ...clearSelection });
259260
const closeDetail = () => updateSearch(clearSelection);
260-
const isMobile = useIsMobile();
261+
const isMobile = useMediaQuery("max-md");
261262
const searchRef = useRef<HTMLDivElement | null>(null);
262263
const onListKeyDown = useGitHubIssueKeyboard({
263264
page: variant === "page",
@@ -489,13 +490,9 @@ export function GitHubIssuesPage({
489490
message: error.message,
490491
})) ?? []),
491492
].map((notice) => (
492-
<div
493-
key={notice.key}
494-
role="status"
495-
className="rounded-lg border border-warning/30 bg-warning-surface px-3 py-2 text-warning-foreground text-xs"
496-
>
497-
{notice.message}
498-
</div>
493+
<Alert key={notice.key} role="status" variant="warning">
494+
<AlertDescription>{notice.message}</AlertDescription>
495+
</Alert>
499496
));
500497

501498
if (variant === "panel") {

0 commit comments

Comments
 (0)