| ... | @@ -1,4 +1,4 @@ | ... | @@ -1,4 +1,4 @@ |
| 1 | import { SearchIcon } from "lucide-react"; | 1 | import { SearchIcon, UserCheckIcon } from "lucide-react"; |
| 2 | import { PullRequestStackPopover } from "./PullRequestStackPopover"; | 2 | import { PullRequestStackPopover } from "./PullRequestStackPopover"; |
| 3 | import { memo, type RefCallback } from "react"; | 3 | import { memo, type RefCallback } from "react"; |
| 4 | | 4 | |
| ... | @@ -121,7 +121,7 @@ function PullRequestRowImpl({ | ... | @@ -121,7 +121,7 @@ function PullRequestRowImpl({ |
| 121 | <span className="col-start-1 row-start-1 block truncate text-sm font-medium text-foreground"> | 121 | <span className="col-start-1 row-start-1 block truncate text-sm font-medium text-foreground"> |
| 122 | {entry.title} | 122 | {entry.title} |
| 123 | </span> | 123 | </span> |
| 124 | <span className="col-start-2 row-start-1 flex max-w-36 items-center justify-self-end gap-2 text-xs"> | 124 | <span className="col-start-2 row-start-1 flex items-center justify-self-end gap-2 text-xs"> |
| 125 | {entry.stack ? ( | 125 | {entry.stack ? ( |
| 126 | <PullRequestStackPopover | 126 | <PullRequestStackPopover |
| 127 | environmentId={entry.environmentId} | 127 | environmentId={entry.environmentId} |
| ... | @@ -137,31 +137,11 @@ function PullRequestRowImpl({ | ... | @@ -137,31 +137,11 @@ function PullRequestRowImpl({ |
| 137 | } | 137 | } |
| 138 | /> | 138 | /> |
| 139 | ) : null} | 139 | ) : null} |
| 140 | {/* Only a verdict somebody has actually given: "review required" is the absence of | 140 | <PullRequestDiffStat |
| 141 | one, and saying so on every unreviewed row would say nothing. */} | 141 | additions={entry.additions} |
| 142 | {entry.reviewDecision === "approved" || entry.reviewDecision === "changes-requested" ? ( | 142 | deletions={entry.deletions} |
| 143 | <span | 143 | className="shrink-0 whitespace-nowrap text-[11px]" |
| 144 | className={cn( | 144 | /> |
| 145 | "sr-only @md/pr-row:not-sr-only @md/pr-row:min-w-0 @md/pr-row:truncate", | | |
| 146 | entry.reviewDecision === "approved" | | |
| 147 | ? "text-emerald-600/90 dark:text-emerald-400/80" | | |
| 148 | : "text-amber-600/90 dark:text-amber-400/80", | | |
| 149 | )} | | |
| 150 | > | | |
| 151 | {entry.reviewDecision === "approved" ? "Approved" : "Changes requested"} | | |
| 152 | </span> | | |
| 153 | ) : null} | | |
| 154 | {entry.checksState === undefined ? null : ( | | |
| 155 | <PullRequestChecksPopover | | |
| 156 | checksState={entry.checksState} | | |
| 157 | environmentId={entry.environmentId} | | |
| 158 | reference={{ | | |
| 159 | projectId: entry.projectId, | | |
| 160 | repository: entry.repository, | | |
| 161 | number: entry.number, | | |
| 162 | }} | | |
| 163 | /> | | |
| 164 | )} | | |
| 165 | </span> | 145 | </span> |
| 166 | <PullRequestMetaLine className="@container/pr-row-meta col-start-1 row-start-2 overflow-hidden text-xs text-muted-foreground/70"> | 146 | <PullRequestMetaLine className="@container/pr-row-meta col-start-1 row-start-2 overflow-hidden text-xs text-muted-foreground/70"> |
| 167 | {matchedElsewhere ? ( | 147 | {matchedElsewhere ? ( |
| ... | @@ -215,9 +195,37 @@ function PullRequestRowImpl({ | ... | @@ -215,9 +195,37 @@ function PullRequestRowImpl({ |
| 215 | labelClassName="sr-only @xs/pr-row-meta:not-sr-only @xs/pr-row-meta:truncate" | 195 | labelClassName="sr-only @xs/pr-row-meta:not-sr-only @xs/pr-row-meta:truncate" |
| 216 | /> | 196 | /> |
| 217 | {entry.labels.length > 0 ? <PullRequestRowLabels labels={entry.labels} /> : null} | 197 | {entry.labels.length > 0 ? <PullRequestRowLabels labels={entry.labels} /> : null} |
| | 198 | {/* Only a verdict somebody has actually given: "review required" is the absence of |
| | 199 | one, and saying so on every unreviewed row would say nothing. */} |
| | 200 | {entry.reviewDecision === "approved" ? ( |
| | 201 | <Tooltip> |
| | 202 | <TooltipTrigger render={<span className="inline-flex shrink-0" />}> |
| | 203 | <UserCheckIcon |
| | 204 | aria-hidden |
| | 205 | className="size-3.5 text-emerald-600/90 dark:text-emerald-400/80" |
| | 206 | /> |
| | 207 | <span className="sr-only">Approved</span> |
| | 208 | </TooltipTrigger> |
| | 209 | <TooltipPopup>Approved</TooltipPopup> |
| | 210 | </Tooltip> |
| | 211 | ) : entry.reviewDecision === "changes-requested" ? ( |
| | 212 | <span className="min-w-0 truncate text-amber-600/90 dark:text-amber-400/80"> |
| | 213 | Changes requested |
| | 214 | </span> |
| | 215 | ) : null} |
| | 216 | {entry.checksState === undefined ? null : ( |
| | 217 | <PullRequestChecksPopover |
| | 218 | checksState={entry.checksState} |
| | 219 | environmentId={entry.environmentId} |
| | 220 | reference={{ |
| | 221 | projectId: entry.projectId, |
| | 222 | repository: entry.repository, |
| | 223 | number: entry.number, |
| | 224 | }} |
| | 225 | /> |
| | 226 | )} |
| 218 | </PullRequestMetaLine> | 227 | </PullRequestMetaLine> |
| 219 | <span className="col-start-2 row-start-2 flex items-center justify-self-end gap-3 whitespace-nowrap text-[11px] text-muted-foreground/70 tabular-nums"> | 228 | <span className="col-start-2 row-start-2 flex items-center justify-self-end gap-3 whitespace-nowrap text-[11px] text-muted-foreground/70 tabular-nums"> |
| 220 | <PullRequestDiffStat additions={entry.additions} deletions={entry.deletions} /> | | |
| 221 | <span className="hidden @sm/pr-row:inline"> | 229 | <span className="hidden @sm/pr-row:inline"> |
| 222 | {formatRelativeTimeLabel(entry.updatedAt)} | 230 | {formatRelativeTimeLabel(entry.updatedAt)} |
| 223 | </span> | 231 | </span> |