Skip to content
Merged
Changes from all 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
7 changes: 5 additions & 2 deletions static/app/views/preprod/snapshots/snapshots.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export default function SnapshotsPage() {
for (const [groupKey, groupedPairs] of groups) {
const label =
groupedPairs[0]!.head_image.group ??
groupedPairs[0]!.head_image.display_name ??

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fallback chain order contradicts intended display_name priority

High Severity

The PR intends the fallback chain to be display_name → group → image_file_name, but the code implements group ?? display_name ?? image_file_name at all three label sites. Because ?? evaluates left-to-right, group is still preferred over display_name, so display_name is only used when group is nullish — the opposite of what's described. The display_name term needs to come before group in the chain.

Additional Locations (2)
Fix in Cursor Fix in Web

groupedPairs[0]!.head_image.image_file_name;
items.push({
type,
Expand All @@ -156,7 +157,8 @@ export default function SnapshotsPage() {
}
}
for (const [groupKey, images] of groups) {
const label = images[0]!.group ?? images[0]!.image_file_name;
const label =
images[0]!.group ?? images[0]!.display_name ?? images[0]!.image_file_name;
items.push({
type,
key: `${type}:${groupKey}`,
Expand Down Expand Up @@ -195,7 +197,8 @@ export default function SnapshotsPage() {
return [...groups.entries()]
.sort(([a], [b]) => a.localeCompare(b))
.map(([groupKey, images]) => {
const label = images[0]!.group ?? images[0]!.image_file_name;
const label =
images[0]!.group ?? images[0]!.display_name ?? images[0]!.image_file_name;
return {
type: 'solo' as const,
key: `solo:${groupKey}`,
Expand Down
Loading