0 && "**:pointer-events-none")}>
@@ -115,38 +164,23 @@ export function PullRequestListGroups({
count={counts.get(group.key) ?? group.entries.length}
/>
) : null}
- {group.entries.map((entry) => {
- const entryKey = pullRequestEntryKey(entry);
- const environmentLabel = environmentLabels?.get(entry.environmentId);
- return (
-
0 &&
- scorePullRequestMatch(entry, query) <= MATCHED_ELSEWHERE_SCORE
- }
- selected={
- selected?.environmentId === entry.environmentId &&
- selected.repository === entry.repository &&
- selected.host?.toLowerCase() === entry.host.toLowerCase() &&
- selected.number === entry.number
- }
+ {nestPullRequestStacks(group.entries).map((row) =>
+ row.kind === "entry" ? (
+ renderRow(row.entry)
+ ) : (
+ toggleStack(row.key)}
onSelect={onSelect}
- onIntent={onIntent}
- hostActions={hostActionsOf(entry)}
- onActed={onActed}
- closing={closingKeys.has(entryKey)}
- sweeping={sweepingKeys.has(entryKey)}
- onCloseSweepStart={onCloseSweepStart}
- />
- );
- })}
+ >
+ {row.entries.map(renderRow)}
+
+ ),
+ )}
))}
diff --git a/apps/web/src/components/pullRequest/PullRequestStackGroup.tsx b/apps/web/src/components/pullRequest/PullRequestStackGroup.tsx
new file mode 100644
index 0000000000000..b98e54441489a
--- /dev/null
+++ b/apps/web/src/components/pullRequest/PullRequestStackGroup.tsx
@@ -0,0 +1,87 @@
+import type { PullRequestStackMembership } from "@t3tools/contracts";
+import { T, useGT, Var } from "gt-react";
+import { ChevronRightIcon } from "lucide-react";
+import type { ReactNode } from "react";
+
+import { cn } from "~/lib/utils";
+import type { EnvironmentPullRequestEntry } from "./pullRequestList.logic";
+import { PullRequestGlyph } from "./pullRequestIcons";
+import type { PullRequestRowTarget } from "./PullRequestRow";
+import { PullRequestStackPopover } from "./PullRequestStackPopover";
+
+/** Two or more rows of one stack, under a header that folds them away. */
+export function PullRequestStackGroup({
+ membership,
+ entries,
+ open,
+ onToggle,
+ onSelect,
+ children,
+}: {
+ membership: PullRequestStackMembership;
+ /** Bottom layer first. */
+ entries: ReadonlyArray