| ... | ... | @@ -27,6 +27,7 @@ import { |
| 27 | 27 | LayersIcon, |
| 28 | 28 | ListChecksIcon, |
| 29 | 29 | PenLineIcon, |
| 30 | Plug2Icon, |
| 30 | 31 | Maximize2Icon, |
| 31 | 32 | Minimize2Icon, |
| 32 | 33 | SearchIcon, |
| ... | ... | @@ -1721,7 +1722,7 @@ function PullRequestsRouteView() { |
| 1721 | 1722 | // kind force the hostname to tell them apart. |
| 1722 | 1723 | const hostEntries = hosts.length > 0 ? hosts : expectedHosts; |
| 1723 | 1724 | const hostMenuOptions: ReadonlyArray<PullRequestFilterOption<string>> = [ |
| 1724 | | { value: "", label: "All hosts", Icon: LayersIcon }, |
| 1725 | { value: "", label: "All", Icon: Plug2Icon }, |
| 1725 | 1726 | ...hostEntries.map((entry) => { |
| 1726 | 1727 | // `expectedHosts` stands in before the server has answered, and nothing is known to be |
| 1727 | 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 | 2045 | triggerIcon, |
| 2045 | 2046 | triggerLabel, |
| 2046 | 2047 | outlined = false, |
| 2048 | iconOnly = false, |
| 2047 | 2049 | value, |
| 2048 | 2050 | options, |
| 2049 | 2051 | onChange, |
| ... | ... | @@ -2053,6 +2055,7 @@ function CompactFilterMenu<Value extends string>({ |
| 2053 | 2055 | triggerIcon?: ReactNode; |
| 2054 | 2056 | triggerLabel?: string; |
| 2055 | 2057 | outlined?: boolean; |
| 2058 | iconOnly?: boolean; |
| 2056 | 2059 | value: Value; |
| 2057 | 2060 | options: ReadonlyArray<PullRequestFilterOption<Value>>; |
| 2058 | 2061 | onChange: (value: Value) => void; |
| ... | ... | @@ -2063,8 +2066,11 @@ function CompactFilterMenu<Value extends string>({ |
| 2063 | 2066 | return ( |
| 2064 | 2067 | <Menu> |
| 2065 | 2068 | <MenuTrigger |
| 2066 | | aria-label={triggerLabel ? `${label}: ${current.label}` : label} |
| 2067 | | render={outlined ? <Button variant="outline" /> : undefined} |
| 2069 | aria-label={triggerLabel || iconOnly ? `${label}: ${current.label}` : label} |
| 2070 | title={iconOnly ? `${label}: ${current.label}` : undefined} |
| 2071 | render={ |
| 2072 | outlined ? <Button variant="outline" size={iconOnly ? "icon" : "default"} /> : undefined |
| 2073 | } |
| 2068 | 2074 | className={ |
| 2069 | 2075 | outlined |
| 2070 | 2076 | ? className |
| ... | ... | @@ -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 | 2087 | {triggerIcon} |
| 2080 | 2088 | <span>{triggerLabel}</span> |
| ... | ... | @@ -2377,6 +2385,16 @@ function PullRequestsColumn({ |
| 2377 | 2385 | </div> |
| 2378 | 2386 | {sortMenu} |
| 2379 | 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 | 2398 | {!condensed ? ( |
| 2381 | 2399 | <PullRequestRefreshControl refreshing={refreshing} onRefresh={onRefresh} /> |
| 2382 | 2400 | ) : null} |