Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 22 additions & 10 deletions apps/web/src/components/pullRequest/PullRequestRow.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { SearchIcon } from "lucide-react";
import { memo } from "react";

import { cn } from "~/lib/utils";
Expand Down Expand Up @@ -59,9 +60,25 @@ function PullRequestRowImpl({
mergeability={entry.mergeability}
baseBranch={entry.baseBranch}
/>
<span className="min-w-0">
<span className="@container/pr-row-meta min-w-0 overflow-hidden">
<span className="block truncate text-sm font-medium text-foreground">{entry.title}</span>
<PullRequestMetaLine className="mt-0.5 text-xs text-muted-foreground/70">
<PullRequestMetaLine className="mt-0.5 overflow-hidden text-xs text-muted-foreground/70">
Comment thread
macroscopeapp[bot] marked this conversation as resolved.
Outdated
{matchedElsewhere ? (
<Tooltip>
<TooltipTrigger
render={
<span className="flex shrink-0 items-center gap-1 rounded-full border border-border/60 px-1 text-[10px]" />
}
>
<span className="sr-only">matched in the description</span>
<SearchIcon aria-hidden className="size-3 shrink-0" />
<span aria-hidden className="hidden @xs/pr-row-meta:inline">
matched in the description
</span>
</TooltipTrigger>
<TooltipPopup side="top">Matched in the description</TooltipPopup>
</Tooltip>
) : null}
Comment thread
cursor[bot] marked this conversation as resolved.
<span className="flex shrink-0 items-center gap-1">
{showProvider ? (
<Tooltip>
Expand Down Expand Up @@ -89,15 +106,15 @@ function PullRequestRowImpl({
</span>
{showProjectTitle ? <span className="truncate">{entry.repository}</span> : null}
{environmentLabel ? (
<span className="max-w-32 shrink-0 truncate">{environmentLabel}</span>
<span className="min-w-0 max-w-32 truncate">{environmentLabel}</span>
) : null}
<PullRequestActorLabel actor={entry.author} className="max-w-40 shrink-0" />
<PullRequestActorLabel actor={entry.author} className="max-w-40" />
Comment thread
macroscopeapp[bot] marked this conversation as resolved.
Outdated
{/* Only a verdict somebody has actually given: "review required" is the absence of
one, and saying so on every unreviewed row would say nothing. */}
{entry.reviewDecision === "approved" || entry.reviewDecision === "changes-requested" ? (
<span
className={cn(
"shrink-0",
"min-w-0 truncate",
entry.reviewDecision === "approved"
? "text-emerald-600/90 dark:text-emerald-400/80"
: "text-amber-600/90 dark:text-amber-400/80",
Expand All @@ -117,11 +134,6 @@ function PullRequestRowImpl({
}}
/>
)}
{matchedElsewhere ? (
<span className="shrink-0 rounded-full border border-border/60 px-1.5 text-[10px]">
matched in the description
</span>
) : null}
</PullRequestMetaLine>
</span>
<span className="flex shrink-0 flex-col items-end gap-0.5 text-xs text-muted-foreground/70 tabular-nums">
Expand Down
38 changes: 24 additions & 14 deletions apps/web/src/routes/_chat.pull-requests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1628,22 +1628,27 @@ function CompactFilterMenu<Value extends string>({
value,
options,
onChange,
className,
}: {
label: string;
value: Value;
options: ReadonlyArray<PullRequestFilterOption<Value>>;
onChange: (value: Value) => void;
className?: string;
}) {
const current = options.find((option) => option.value === value) ?? options[0];
if (!current) return null;
return (
<Menu>
<MenuTrigger
aria-label={label}
className="inline-flex h-7 shrink-0 items-center gap-1 rounded-md px-1.5 text-sm font-medium text-muted-foreground hover:bg-accent hover:text-foreground"
className={cn(
"inline-flex h-7 min-w-0 items-center gap-1 rounded-md px-1.5 text-sm font-medium text-muted-foreground hover:bg-accent hover:text-foreground",
className,
)}
>
{current.label}
<ChevronDownIcon aria-hidden className="size-3 text-muted-foreground/70" />
<span className="truncate">{current.label}</span>
<ChevronDownIcon aria-hidden className="size-3 shrink-0 text-muted-foreground/70" />
</MenuTrigger>
<MenuPopup align="start" side="bottom" className="min-w-40">
<MenuRadioGroup value={value} onValueChange={(next) => onChange(next as Value)}>
Expand Down Expand Up @@ -1721,7 +1726,7 @@ function ExpandableSearch({
return (
<div
ref={containerRef}
className="w-56 shrink-0"
className="w-56 min-w-24 shrink"
onFocus={() => onFocusWithin?.(true)}
onBlur={() => {
onFocusWithin?.(false);
Expand Down Expand Up @@ -1808,6 +1813,7 @@ function PullRequestsColumn({
const inFlowSearchRef = useRef<HTMLDivElement | null>(null);
const [searchOpen, setSearchOpen] = useState(false);
const [searchFocusToken, setSearchFocusToken] = useState(0);
const searchExpanded = searchOpen || searchValue.length > 0;
// Mod+F belongs to this page's own search: the desktop shell binds no find-in-page, so the
// shortcut would otherwise do nothing. Condensed, it unfolds the topbar search; at the top,
// it focuses the in-flow bar and selects the query the way a find field would.
Expand Down Expand Up @@ -1860,20 +1866,24 @@ function PullRequestsColumn({
>
{titlebarControls}
{condensed ? (
<WorkspaceBreadcrumb ariaLabel="Pull request scope">
{/* The page name remains the foreground anchor in both states; the live filters are
its compact scope, grouped as the second crumb rather than pretending each menu
is a separate page in the hierarchy. */}
<WorkspaceBreadcrumbItem current>
<h1 className="truncate">Pull Requests</h1>
</WorkspaceBreadcrumbItem>
<WorkspaceBreadcrumbSeparator />
<WorkspaceBreadcrumbItem className="gap-1.5 overflow-hidden">
<WorkspaceBreadcrumb ariaLabel="Pull request scope" className="overflow-hidden">
{/* An expanded search owns the scarce horizontal space. The page title returns when
it folds, while the live filters remain available in both states. */}
{searchExpanded ? null : (
<>
<WorkspaceBreadcrumbItem current>
<h1 className="truncate">Pull Requests</h1>
</WorkspaceBreadcrumbItem>
<WorkspaceBreadcrumbSeparator />
</>
)}
Comment thread
macroscopeapp[bot] marked this conversation as resolved.
Outdated
<WorkspaceBreadcrumbItem className="shrink gap-1.5 overflow-hidden">
Comment thread
macroscopeapp[bot] marked this conversation as resolved.
Outdated
<CompactFilterMenu
label="Filter by state"
value={state}
options={STATE_TABS}
onChange={onState}
className="shrink-0"
/>
<CompactFilterMenu
label="Filter by involvement"
Expand All @@ -1900,7 +1910,7 @@ function PullRequestsColumn({
)}
<div className="min-w-0 flex-1" />
{condensed ? (
<div className="flex shrink-0 items-center gap-1.5">
<div className="flex min-w-[8.125rem] shrink items-center gap-1.5">
Comment thread
macroscopeapp[bot] marked this conversation as resolved.
Outdated
<ExpandableSearch
searchInput={searchInput}
searchValue={searchValue}
Expand Down
Loading