authorgravatar for maria@kuuro.netmaria <maria@kuuro.net> 2026-09-13 04:22:17-03:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-13 04:22:17-03:00
log20363c32c9bfdbf49c2716ef11d1f18483fcc01b
tree828118503d31c983ba5eada0cd272a436874a4f3
parent17f8e2a8acba76d5516e0a52c85bf802b0e17892
signature Signed by PGP key B5690EEEBB952194

feat(web): add provider selector to pull request toolbar (#11524)

Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>

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

apps/web/src/routes/_chat.pull-requests.tsx+22-4
...@@ -27,6 +27,7 @@ import {...@@ -27,6 +27,7 @@ import {
27 LayersIcon,27 LayersIcon,
28 ListChecksIcon,28 ListChecksIcon,
29 PenLineIcon,29 PenLineIcon,
30 Plug2Icon,
30 Maximize2Icon,31 Maximize2Icon,
31 Minimize2Icon,32 Minimize2Icon,
32 SearchIcon,33 SearchIcon,
...@@ -1721,7 +1722,7 @@ function PullRequestsRouteView() {...@@ -1721,7 +1722,7 @@ function PullRequestsRouteView() {
1721 // kind force the hostname to tell them apart.1722 // kind force the hostname to tell them apart.
1722 const hostEntries = hosts.length > 0 ? hosts : expectedHosts;1723 const hostEntries = hosts.length > 0 ? hosts : expectedHosts;
1723 const hostMenuOptions: ReadonlyArray<PullRequestFilterOption<string>> = [1724 const hostMenuOptions: ReadonlyArray<PullRequestFilterOption<string>> = [
1724 { value: "", label: "All hosts", Icon: LayersIcon },1725 { value: "", label: "All", Icon: Plug2Icon },
1725 ...hostEntries.map((entry) => {1726 ...hostEntries.map((entry) => {
1726 // `expectedHosts` stands in before the server has answered, and nothing is known to be1727 // `expectedHosts` stands in before the server has answered, and nothing is known to be
1727 // unreadable yet; once the summaries arrive they carry whether each one could be read.1728 // unreadable yet; once the summaries arrive they carry whether each one could be read.
...@@ -2044,6 +2045,7 @@ function CompactFilterMenu<Value extends string>({...@@ -2044,6 +2045,7 @@ function CompactFilterMenu<Value extends string>({
2044 triggerIcon,2045 triggerIcon,
2045 triggerLabel,2046 triggerLabel,
2046 outlined = false,2047 outlined = false,
2048 iconOnly = false,
2047 value,2049 value,
2048 options,2050 options,
2049 onChange,2051 onChange,
...@@ -2053,6 +2055,7 @@ function CompactFilterMenu<Value extends string>({...@@ -2053,6 +2055,7 @@ function CompactFilterMenu<Value extends string>({
2053 triggerIcon?: ReactNode;2055 triggerIcon?: ReactNode;
2054 triggerLabel?: string;2056 triggerLabel?: string;
2055 outlined?: boolean;2057 outlined?: boolean;
2058 iconOnly?: boolean;
2056 value: Value;2059 value: Value;
2057 options: ReadonlyArray<PullRequestFilterOption<Value>>;2060 options: ReadonlyArray<PullRequestFilterOption<Value>>;
2058 onChange: (value: Value) => void;2061 onChange: (value: Value) => void;
...@@ -2063,8 +2066,11 @@ function CompactFilterMenu<Value extends string>({...@@ -2063,8 +2066,11 @@ function CompactFilterMenu<Value extends string>({
2063 return (2066 return (
2064 <Menu>2067 <Menu>
2065 <MenuTrigger2068 <MenuTrigger
2066 aria-label={triggerLabel ? `${label}: ${current.label}` : label}2069 aria-label={triggerLabel || iconOnly ? `${label}: ${current.label}` : label}
2067 render={outlined ? <Button variant="outline" /> : undefined}2070 title={iconOnly ? `${label}: ${current.label}` : undefined}
2071 render={
2072 outlined ? <Button variant="outline" size={iconOnly ? "icon" : "default"} /> : undefined
2073 }
2068 className={2074 className={
2069 outlined2075 outlined
2070 ? className2076 ? className
...@@ -2074,7 +2080,9 @@ function CompactFilterMenu<Value extends string>({...@@ -2074,7 +2080,9 @@ function CompactFilterMenu<Value extends string>({
2074 )2080 )
2075 }2081 }
2076 >2082 >
2077 {triggerLabel ? (2083 {iconOnly ? (
2084 <current.Icon aria-hidden className="size-4" />
2085 ) : triggerLabel ? (
2078 <>2086 <>
2079 {triggerIcon}2087 {triggerIcon}
2080 <span>{triggerLabel}</span>2088 <span>{triggerLabel}</span>
...@@ -2377,6 +2385,16 @@ function PullRequestsColumn({...@@ -2377,6 +2385,16 @@ function PullRequestsColumn({
2377 </div>2385 </div>
2378 {sortMenu}2386 {sortMenu}
2379 {filtersMenu}2387 {filtersMenu}
2388 <CompactFilterMenu
2389 label="Filter by provider"
2390 outlined
2391 iconOnly={host !== undefined}
2392 triggerIcon={<Plug2Icon aria-hidden className="size-4" />}
2393 triggerLabel="All"
2394 value={host ?? ""}
2395 options={hostMenuOptions}
2396 onChange={(next) => onHost(next === "" ? undefined : next)}
2397 />
2380 {!condensed ? (2398 {!condensed ? (
2381 <PullRequestRefreshControl refreshing={refreshing} onRefresh={onRefresh} />2399 <PullRequestRefreshControl refreshing={refreshing} onRefresh={onRefresh} />
2382 ) : null}2400 ) : null}